[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eb46b2d8-a170-4813-963d-8509089f72fa@rock-chips.com>
Date: Sat, 22 Feb 2025 19:57:15 +0800
From: Damon Ding <damon.ding@...k-chips.com>
To: Lucas Stach <l.stach@...gutronix.de>, heiko@...ech.de
Cc: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
rfoss@...nel.org, vkoul@...nel.org, sebastian.reichel@...labora.com,
cristian.ciocaltea@...labora.com, dmitry.baryshkov@...aro.org,
andy.yan@...k-chips.com, hjc@...k-chips.com, algea.cao@...k-chips.com,
kever.yang@...k-chips.com, dri-devel@...ts.freedesktop.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-phy@...ts.infradead.org
Subject: Re: [PATCH v6 08/14] drm/rockchip: analogix_dp: Add support to get
panel from the DP AUX bus
Hi Lucas,
On 2025/2/8 3:42, Lucas Stach wrote:
> Hi Damon,
>
> Am Donnerstag, dem 23.01.2025 um 18:07 +0800 schrieb Damon Ding:
>> 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.
>>
> The changes in this patch effectively revert 86caee745e45
> ("drm/rockchip: analogix_dp: allow to work without panel"). Please
> correct this in the next revision of this patchset.
>
> Regards,
> Lucas
>
Oh, I see. I will fix it in the next version.
>> Signed-off-by: Damon Ding <damon.ding@...k-chips.com>
>>
>> ---
>>
>> 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().
>>
>> Changes in v6:
>> - Keep drm_err() in rockchip_dp_poweron()
>> - Pass 'dp' in drm_...() rather than 'dp->drm_dev'
>> ---
>> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 37 ++++++++++++++-----
>> 1 file changed, 28 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index 13f32aeea7ca..004b1b68d1cf 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -393,11 +393,27 @@ static const struct component_ops rockchip_dp_component_ops = {
>> .unbind = rockchip_dp_unbind,
>> };
>>
>> +static int rockchip_dp_link_panel(struct drm_dp_aux *aux)
>> +{
>> + struct analogix_dp_plat_data *plat_data = analogix_dp_aux_to_plat_data(aux);
>> + struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
>> + int ret;
>> +
>> + ret = drm_of_find_panel_or_bridge(dp->dev->of_node, 1, 0, &plat_data->panel, NULL);
>> + if (ret)
>> + return ret;
>> +
>> + ret = component_add(dp->dev, &rockchip_dp_component_ops);
>> + if (ret)
>> + return ret;
>> +
>> + return ret;
>> +}
>> +
>> static int rockchip_dp_probe(struct platform_device *pdev)
>> {
>> struct device *dev = &pdev->dev;
>> const struct rockchip_dp_chip_data *dp_data;
>> - struct drm_panel *panel = NULL;
>> struct rockchip_dp_device *dp;
>> struct resource *res;
>> int i;
>> @@ -407,10 +423,6 @@ static int rockchip_dp_probe(struct platform_device *pdev)
>> if (!dp_data)
>> return -ENODEV;
>>
>> - ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
>> - if (ret < 0 && ret != -ENODEV)
>> - return ret;
>> -
>> dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
>> if (!dp)
>> return -ENOMEM;
>> @@ -434,7 +446,6 @@ static int rockchip_dp_probe(struct platform_device *pdev)
>>
>> dp->dev = dev;
>> dp->adp = ERR_PTR(-ENODEV);
>> - dp->plat_data.panel = panel;
>> dp->plat_data.dev_type = dp->data->chip_type;
>> dp->plat_data.power_on = rockchip_dp_poweron;
>> dp->plat_data.power_off = rockchip_dp_powerdown;
>> @@ -450,9 +461,17 @@ static int rockchip_dp_probe(struct platform_device *pdev)
>> if (IS_ERR(dp->adp))
>> return PTR_ERR(dp->adp);
>>
>> - ret = component_add(dev, &rockchip_dp_component_ops);
>> - if (ret)
>> - return ret;
>> + ret = devm_of_dp_aux_populate_bus(analogix_dp_get_aux(dp->adp), rockchip_dp_link_panel);
>> + if (ret) {
>> + if (ret != -ENODEV) {
>> + drm_err(dp, "failed to populate aux bus : %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = rockchip_dp_link_panel(analogix_dp_get_aux(dp->adp));
>> + if (ret)
>> + return ret;
>> + }
>>
>> return 0;
>> }
>
>
>
Best regards
Damon
Powered by blists - more mailing lists