Revert "drm/bridge: adv7511: Attach to DSI host at probe time"
authorRob Clark <robdclark@chromium.org>
Thu, 29 Aug 2019 18:08:35 +0000 (11:08 -0700)
committerAndrzej Hajda <a.hajda@samsung.com>
Fri, 13 Sep 2019 07:25:00 +0000 (09:25 +0200)
This reverts commit 83f35bc3a852f1c3892c7474998c5cec707c7ba3.

There are at least two DSI controller drivers which relies on the old
behaviour of adv7511 driver. To avoid platform breakage this patch
should be reverted. This is a temporary solution, as it blocks adv7511
usage with other platforms.
Assumption that DSI device driver (bridge/panel) should first expose
drm_bridge/drm_panel object, then look for DSI bus is just incorrect -
it can work with devices controlled via i2c but it cannot work with
devices controlled via DSI - they will not be able to probe.
To solve the issue following steps should be performed:
- rework reverted patch allowing co-operation with broken DSI controller
  drivers - with simple/ugly workaround,
- fix controller drivers and then remove workaround.

Signed-off-by: Rob Clark <robdclark@chromium.org>
[a.hajda: changed commit message]
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190829180836.14453-1-robdclark@gmail.com
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

index 98bccac..f6d2681 100644 (file)
@@ -874,6 +874,9 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge)
                                 &adv7511_connector_helper_funcs);
        drm_connector_attach_encoder(&adv->connector, bridge->encoder);
 
+       if (adv->type == ADV7533)
+               ret = adv7533_attach_dsi(adv);
+
        if (adv->i2c_main->irq)
                regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0),
                             ADV7511_INT0_HPD);
@@ -1219,17 +1222,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
        drm_bridge_add(&adv7511->bridge);
 
        adv7511_audio_init(dev, adv7511);
-
-       if (adv7511->type == ADV7533) {
-               ret = adv7533_attach_dsi(adv7511);
-               if (ret)
-                       goto err_remove_bridge;
-       }
-
        return 0;
 
-err_remove_bridge:
-       drm_bridge_remove(&adv7511->bridge);
 err_unregister_cec:
        i2c_unregister_device(adv7511->i2c_cec);
        if (adv7511->cec_clk)