drm/bridge: tc358767: Wrap (e)DP aux I2C registration into tc_aux_link_setup()
authorMarek Vasut <marex@denx.de>
Tue, 29 Mar 2022 08:50:11 +0000 (10:50 +0200)
committerRobert Foss <robert.foss@linaro.org>
Thu, 31 Mar 2022 13:59:08 +0000 (15:59 +0200)
This bit of code is (e)DP and aux I2C link specific, move it into
tc_aux_link_setup() to permit cleaner addition of DSI-to-DPI mode.
No functional change.

Reviewed-by: Lucas 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: Marek 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: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220329085015.39159-8-marex@denx.de
drivers/gpu/drm/bridge/tc358767.c

index 1a77553962820c37ec09515e31c4cf37469ca38b..1f4b962502c7c302049f16c6016dfeaae194ad03 100644 (file)
@@ -656,6 +656,12 @@ static int tc_aux_link_setup(struct tc_data *tc)
        if (ret)
                goto err;
 
+       /* Register DP AUX channel */
+       tc->aux.name = "TC358767 AUX i2c adapter";
+       tc->aux.dev = tc->dev;
+       tc->aux.transfer = tc_aux_transfer;
+       drm_dp_aux_init(&tc->aux);
+
        return 0;
 err:
        dev_err(tc->dev, "tc_aux_link_setup failed: %d\n", ret);
@@ -1736,12 +1742,6 @@ static int tc_probe(struct i2c_client *client, const struct i2c_device_id *id)
        if (ret)
                return ret;
 
-       /* Register DP AUX channel */
-       tc->aux.name = "TC358767 AUX i2c adapter";
-       tc->aux.dev = tc->dev;
-       tc->aux.transfer = tc_aux_transfer;
-       drm_dp_aux_init(&tc->aux);
-
        tc->bridge.funcs = &tc_edp_bridge_funcs;
        if (tc->hpd_pin >= 0)
                tc->bridge.ops |= DRM_BRIDGE_OP_DETECT;