[PATCH v5 13/17] drm/rockchip: analogix_dp: Apply &analogix_dp_plat_data.attach() to attach next bridge
Damon Ding
damon.ding at rock-chips.com
Wed Sep 24 19:11:53 PDT 2025
Hi Dmitry,
On 9/12/2025 7:05 PM, Dmitry Baryshkov wrote:
> On Fri, Sep 12, 2025 at 04:58:42PM +0800, Damon Ding wrote:
>> There may be the panel or bridge after &analogix_dp_device.bridge.
>> Add rockchip_dp_attach() to support the next bridge attachment for
>> the Rockchip side.
>>
>> Signed-off-by: Damon Ding <damon.ding at rock-chips.com>
>> ---
>> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> index 0784f19a2ed9..39f1ed293c75 100644
>> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
>> @@ -164,6 +164,24 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
>> return 0;
>> }
>>
>> +static int rockchip_dp_attach(struct analogix_dp_plat_data *plat_data,
>> + struct drm_bridge *bridge)
>> +{
>> + struct rockchip_dp_device *dp = pdata_encoder_to_dp(plat_data);
>> + int ret;
>> +
>> + if (plat_data->next_bridge) {
>> + ret = drm_bridge_attach(&dp->encoder.encoder, plat_data->next_bridge, bridge,
>> + DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>
> Can this be handled inside analogix_dp_bridge's attach callback?
I found that the &analogix_dp_plat_data.attach() callbacks of Rockchip
and Exynos sides are the same. It should be nice to handle the next
bridge attachment in analogix_dp_bridge_attach(), which would allow us
to remove the &analogix_dp_bridge_attach().
>
>> + if (ret) {
>> + dev_err(dp->dev, "failed to attach following panel or bridge (%d)\n", ret);
>> + return ret;
>> + }
>> + }
>> +
>> + return 0;
>> +}
>> +
>> static bool
>> rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
>> const struct drm_display_mode *mode,
>> @@ -452,6 +470,7 @@ static int rockchip_dp_probe(struct platform_device *pdev)
>> 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;
>> + dp->plat_data.attach = rockchip_dp_attach;
>> dp->plat_data.ops = &rockchip_dp_component_ops;
>>
>> ret = rockchip_dp_of_probe(dp);
>> --
>> 2.34.1
>>
>
Best regards,
Damon
More information about the linux-arm-kernel
mailing list