drm: bridge: ldb: add support for using channel 1 only
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 5 Apr 2023 08:10:57 +0000 (10:10 +0200)
committerRobert Foss <rfoss@kernel.org>
Wed, 5 Apr 2023 09:01:42 +0000 (11:01 +0200)
commite09220f42b5c28dae51a3cf2810afcb4fad9909d
tree760f48792503b32743091cb4d6068889ea7f171e
parent8cc0b604f2345c304b7ddc828b880f4f3f21816a
drm: bridge: ldb: add support for using channel 1 only

The LDB driver currently checks whether dual mode is used, otherwise it
assumes only channel 0 is in use. Add support for using only channel 1. In
device tree terms, this means linking port 2 only.

Doing this cleanly requires changing the logic of the probe functions from
this:

 1. use of_graph_get_remote_node() on port 1 to find the panel
 2. use drm_of_lvds_get_dual_link_pixel_order() to detect dual mode

to this:

 1. use of_graph_get_remote_node() twice to find remote ports
 2. reuse the result of the above to know whether each channel is enabled
    and to find the panel
 3. if (both channels as enabled)
        use drm_of_lvds_get_dual_link_pixel_order() to detect dual mode

Also add a dev_dbg() to log the detected mode and log an error in case no
panel was found (no channel enabled).

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230405081058.2347130-2-luca.ceresoli@bootlin.com
drivers/gpu/drm/bridge/fsl-ldb.c