• Marek Vasut's avatar
    drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT · 71f7d9c0
    Marek Vasut authored
    The TC358767/TC358867/TC9595 are all capable of operating in multiple
    modes, DPI-to-(e)DP, DSI-to-(e)DP, DSI-to-DPI. Only the first mode is
    currently supported. It is possible to find out the mode in which the
    bridge should be operated by testing connected endpoints in DT.
    
    Port allocation:
    port@0 - DSI input
    port@1 - DPI input/output
    port@2 - eDP output
    
    Possible connections:
    DPI -> port@1 -> port@2 -> eDP :: [port@0 is not connected]
    DSI -> port@0 -> port@2 -> eDP :: [port@1 is not connected]
    DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected]
    
    Add function to determine the bridge mode based on connected endpoints.
    Reviewed-by: default avatarLucas Stach <l.stach@pengutronix.de>
    Tested-by: Lucas Stach <l.stach@pengutronix.de> # In both DPI to eDP and DSI to DPI mode.
    Signed-off-by: default avatarMarek Vasut <marex@denx.de>
    Cc: Jonas Karlman <jonas@kwiboo.se>
    Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
    Cc: Maxime Ripard <maxime@cerno.tech>
    Cc: Neil Armstrong <narmstrong@baylibre.com>
    Cc: Sam Ravnborg <sam@ravnborg.org>
    Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-10-marex@denx.de
    71f7d9c0
tc358767.c 46 KB