[PATCH] drm/rockchip: rk3288-lvds: honor DCLK edge via GRF CON15

Heiko Stübner heiko at sntech.de
Tue Oct 14 02:39:57 PDT 2025


Hi Christoph,

Am Montag, 15. September 2025, 19:35:22 Mitteleuropäische Sommerzeit schrieb Christoph Fritz:
> Set the DCLK edge (normal or invert) via GRF_SOC_CON15 when the specific
> drm_bus_flag is enabled. Keep track of the vop source in use so that the
> right DCLK (BIG: dclk0 or LIT: dclk1) gets set.
> 
> This change is especially necessary for RGB output configurations to
> actually propagate the DCLK inversion.
> 
> Signed-off-by: Christoph Fritz <chf.fritz at googlemail.com>
> ---
>  drivers/gpu/drm/rockchip/rockchip_lvds.c | 17 +++++++++++++++++
>  drivers/gpu/drm/rockchip/rockchip_lvds.h |  4 ++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c
> index 2411260db51d7..08784c3ecf703 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c
> @@ -235,8 +236,11 @@ static int rk3288_lvds_grf_config(struct drm_encoder *encoder,
>  				  struct drm_display_mode *mode)
>  {
>  	struct rockchip_lvds *lvds = encoder_to_lvds(encoder);
> +	u32 bus_flgs = lvds->connector.display_info.bus_flags;
> +	u8 con15_dclk = (bus_flgs & DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE) ? 1 : 0;
>  	u8 pin_hsync = (mode->flags & DRM_MODE_FLAG_PHSYNC) ? 1 : 0;
>  	u8 pin_dclk = (mode->flags & DRM_MODE_FLAG_PCSYNC) ? 1 : 0;
> +	unsigned int con15_dclk_mask;

I think the variables might be nicer named as dclk_inv and dclk_inv_mask
instead of referencing the that con15 thing.

But on the more important side

  CC [M]  drivers/gpu/drm/rockchip/rockchip_lvds.o
../drivers/gpu/drm/rockchip/rockchip_lvds.c: In function ‘rk3288_lvds_grf_config’:
../drivers/gpu/drm/rockchip/rockchip_lvds.c:239:28: error: ‘struct rockchip_lvds’ has no member named ‘connector’
  239 |         u32 bus_flgs = lvds->connector.display_info.bus_flags;
      |                            ^~

because of commit 40a382aae1d4 ("drm/rockchip: lvds: Convert to drm bridge").

So you'll need to adapt to that change.


Heiko





More information about the Linux-rockchip mailing list