Message ID | 20241219080604.1423600-10-damon.ding@rock-chips.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Add eDP support for RK3588 | expand |
On Thu, Dec 19, 2024 at 04:05:58PM +0800, Damon Ding wrote: > If the panel can not be found in the beginning of rockchip_dp_probe() > using the platform bus, we can still try to find it in analogix_dp_bind() > through the DP AUX bus after the &analogix_dp_device.aux has been > initialized. > > Signed-off-by: Damon Ding <damon.ding@rock-chips.com> > --- > .../drm/bridge/analogix/analogix_dp_core.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index 9429c50cc1bc..eae02819e3bb 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -19,12 +19,14 @@ > #include <linux/platform_device.h> > > #include <drm/bridge/analogix_dp.h> > +#include <drm/display/drm_dp_aux_bus.h> > #include <drm/drm_atomic.h> > #include <drm/drm_atomic_helper.h> > #include <drm/drm_bridge.h> > #include <drm/drm_crtc.h> > #include <drm/drm_device.h> > #include <drm/drm_edid.h> > +#include <drm/drm_of.h> > #include <drm/drm_panel.h> > #include <drm/drm_print.h> > #include <drm/drm_probe_helper.h> > @@ -1733,6 +1735,23 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) > goto err_disable_pm_runtime; > } > > + if (!dp->plat_data->panel) { > + /* > + * If the edp-panel module has not yet been initialized, the > + * devm_of_dp_aux_populate_bus() function will return 0 and > + * the done_probing() callback will not be called either. > + * Consequently, the panel will never be found. > + * > + * This is the reason why we do not use the done_probing() > + * callback and do not check the reture value here. NAK. It is there for exactly this reason, to account for the panel driver being not present yet. Please make a use of the done_probing() callback. > + */ > + devm_of_dp_aux_populate_bus(&dp->aux, NULL); > + ret = drm_of_find_panel_or_bridge(dp->dev->of_node, 1, 0, > + &dp->plat_data->panel, NULL); > + if (ret) > + goto err_unregister_aux; > + } > + > ret = analogix_dp_create_bridge(drm_dev, dp); > if (ret) { > DRM_ERROR("failed to create bridge (%d)\n", ret); > -- > 2.34.1 >
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 9429c50cc1bc..eae02819e3bb 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -19,12 +19,14 @@ #include <linux/platform_device.h> #include <drm/bridge/analogix_dp.h> +#include <drm/display/drm_dp_aux_bus.h> #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_bridge.h> #include <drm/drm_crtc.h> #include <drm/drm_device.h> #include <drm/drm_edid.h> +#include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_print.h> #include <drm/drm_probe_helper.h> @@ -1733,6 +1735,23 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) goto err_disable_pm_runtime; } + if (!dp->plat_data->panel) { + /* + * If the edp-panel module has not yet been initialized, the + * devm_of_dp_aux_populate_bus() function will return 0 and + * the done_probing() callback will not be called either. + * Consequently, the panel will never be found. + * + * This is the reason why we do not use the done_probing() + * callback and do not check the reture value here. + */ + devm_of_dp_aux_populate_bus(&dp->aux, NULL); + ret = drm_of_find_panel_or_bridge(dp->dev->of_node, 1, 0, + &dp->plat_data->panel, NULL); + if (ret) + goto err_unregister_aux; + } + ret = analogix_dp_create_bridge(drm_dev, dp); if (ret) { DRM_ERROR("failed to create bridge (%d)\n", ret);
If the panel can not be found in the beginning of rockchip_dp_probe() using the platform bus, we can still try to find it in analogix_dp_bind() through the DP AUX bus after the &analogix_dp_device.aux has been initialized. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> --- .../drm/bridge/analogix/analogix_dp_core.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)