[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211025151536.1048186-3-maxime@cerno.tech>
Date: Mon, 25 Oct 2021 17:15:17 +0200
From: Maxime Ripard <maxime@...no.tech>
To: Thierry Reding <thierry.reding@...il.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Andrzej Hajda <a.hajda@...sung.com>,
Robert Foss <robert.foss@...aro.org>,
Jonas Karlman <jonas@...boo.se>,
Daniel Vetter <daniel.vetter@...el.com>,
David Airlie <airlied@...ux.ie>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Maxime Ripard <maxime@...no.tech>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
Neil Armstrong <narmstrong@...libre.com>
Cc: Seung-Woo Kim <sw0312.kim@...sung.com>,
linux-arm-msm@...r.kernel.org,
Joonyoung Shim <jy0922.shim@...sung.com>,
Rob Clark <robdclark@...il.com>,
Tian Tao <tiantao6@...ilicon.com>,
Chen Feng <puck.chen@...ilicon.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
linux-samsung-soc@...r.kernel.org,
Xinliang Liu <xinliang.liu@...aro.org>,
John Stultz <john.stultz@...aro.org>,
linux-kernel@...r.kernel.org, Inki Dae <inki.dae@...sung.com>,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
Sean Paul <sean@...rly.run>
Subject: [PATCH v6 02/21] drm/bridge: adv7511: Register and attach our DSI device at probe
In order to avoid any probe ordering issue, the best practice is to move
the secondary MIPI-DSI device registration and attachment to the
MIPI-DSI host at probe time. Let's do this.
Acked-by: Sam Ravnborg <sam@...nborg.org>
Tested-by: John Stultz <john.stultz@...aro.org>
Signed-off-by: Maxime Ripard <maxime@...no.tech>
---
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 9e3585f23cf1..f8e5da148599 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -910,9 +910,6 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge,
return ret;
}
- if (adv->type == ADV7533 || adv->type == ADV7535)
- ret = adv7533_attach_dsi(adv);
-
if (adv->i2c_main->irq)
regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0),
ADV7511_INT0_HPD);
@@ -1288,8 +1285,18 @@ 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 || adv7511->type == ADV7535) {
+ ret = adv7533_attach_dsi(adv7511);
+ if (ret)
+ goto err_unregister_audio;
+ }
+
return 0;
+err_unregister_audio:
+ adv7511_audio_exit(adv7511);
+ drm_bridge_remove(&adv7511->bridge);
err_unregister_cec:
i2c_unregister_device(adv7511->i2c_cec);
clk_disable_unprepare(adv7511->cec_clk);
--
2.31.1
Powered by blists - more mailing lists