On Wed, Jan 22, 2025 at 05:37:53PM +0800, Damon Ding wrote: > Hi Dmitry, > > On 2025/1/22 16:17, Damon Ding wrote: > > Hi Dmitry, > > > > On 2025/1/9 20:48, Dmitry Baryshkov wrote: > > > On Thu, Jan 09, 2025 at 11:27:17AM +0800, Damon Ding wrote: > > > > Move drm_of_find_panel_or_bridge() a little later and combine it with > > > > component_add() into a new function rockchip_dp_link_panel(). > > > > The function > > > > will serve as done_probing() callback of devm_of_dp_aux_populate_bus(), > > > > aiding to support for obtaining the eDP panel via the DP AUX bus. > > > > > > > > If failed to get the panel from the DP AUX bus, it will then try > > > > the other > > > > way to get panel information through the platform bus. > > > > > > > > In addition, use dev_err() instead of drm_err() in rockchip_dp_poweron() > > > > , which will be called before rockchip_dp_bind(). > > > > > > > > Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx> > > > > > > > > --- > > > > > > > > Changes in v4: > > > > - Use done_probing() to call drm_of_find_panel_or_bridge() and > > > > component_add() when getting panel from the DP AUX bus > > > > > > > > Changes in v5: > > > > - Use the functions exported by the Analogix side to get the pointers of > > > > struct analogix_dp_plat_data and struct drm_dp_aux. > > > > - Use dev_err() instead of drm_err() in rockchip_dp_poweron(). > > > > > > > > --- > > > > .../gpu/drm/rockchip/analogix_dp-rockchip.c | 41 ++++++++++++++----- > > > > 1 file changed, 30 insertions(+), 11 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/ > > > > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > > > > index 0957d3c5d31d..3ae01b870f49 100644 > > > > --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > > > > +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c > > > > @@ -124,13 +124,13 @@ static int rockchip_dp_poweron(struct > > > > analogix_dp_plat_data *plat_data) > > > > ret = clk_prepare_enable(dp->pclk); > > > > if (ret < 0) { > > > > - drm_err(dp->drm_dev, "failed to enable pclk %d\n", ret); > > > > + dev_err(dp->dev, "failed to enable pclk %d\n", ret); > > > > > > > > > why? > > > > > > > The &rockchip_dp_device.drm_dev will be assigned in rockchip_dp_bind(), > > which is called after probing process. The PM operations have been > > advanced to the probing for the AUX transmission, so the dev_err() may > > be better than drm_err(). > > > > Using drm_...() uniformly may be better [0]. Yes > > > > > return ret; > > > > } > > > > ret = rockchip_dp_pre_init(dp); > > > > if (ret < 0) { > > > > - drm_err(dp->drm_dev, "failed to dp pre init %d\n", ret); > > > > + dev_err(dp->dev, "failed to dp pre init %d\n", ret); > > > > clk_disable_unprepare(dp->pclk); > > > > return ret; > > > > } > > > > > Best regards, > Damon > > [0]https://patchwork.kernel.org/project/linux-rockchip/patch/20250109032725.1102465-6-damon.ding@xxxxxxxxxxxxxx/#26209891 > -- With best wishes Dmitry