Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/rockchip: dw_hdmi_qp: Use bit macros for RK3576 regs

For consistency and improved readability, redefine a few RK3576 specific
register configurations by relying on GENMASK() and unshifted values for
color depth and output format. Those are not used at the moment, but
will be needed soon to support the related features.

While at it, drop a few other defines which are unlikely to be ever
required.

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20251021-rk3588-10bpc-v3-4-3d3eed00a6db@collabora.com

authored by

Cristian Ciocaltea and committed by
Heiko Stuebner
97ffefaa ba9c2fe1

+8 -13
+8 -13
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c
··· 39 39 #define RK3576_HDMI_HDCP14_MEM_EN BIT(15) 40 40 41 41 #define RK3576_VO0_GRF_SOC_CON8 0x0020 42 - #define RK3576_COLOR_FORMAT_MASK (0xf << 4) 43 - #define RK3576_COLOR_DEPTH_MASK (0xf << 8) 44 - #define RK3576_RGB (0 << 4) 45 - #define RK3576_YUV422 (0x1 << 4) 46 - #define RK3576_YUV444 (0x2 << 4) 47 - #define RK3576_YUV420 (0x3 << 4) 48 - #define RK3576_8BPC (0x0 << 8) 49 - #define RK3576_10BPC (0x6 << 8) 42 + #define RK3576_COLOR_DEPTH_MASK GENMASK(11, 8) 43 + #define RK3576_8BPC 0x0 44 + #define RK3576_10BPC 0x6 45 + #define RK3576_COLOR_FORMAT_MASK GENMASK(7, 4) 46 + #define RK3576_RGB 0x9 47 + #define RK3576_YUV422 0x1 48 + #define RK3576_YUV444 0x2 49 + #define RK3576_YUV420 0x3 50 50 #define RK3576_CECIN_MASK BIT(3) 51 - 52 - #define RK3576_VO0_GRF_SOC_CON12 0x0030 53 - #define RK3576_GRF_OSDA_DLYN (0xf << 12) 54 - #define RK3576_GRF_OSDA_DIV (0x7f << 1) 55 - #define RK3576_GRF_OSDA_DLY_EN BIT(0) 56 51 57 52 #define RK3576_VO0_GRF_SOC_CON14 0x0038 58 53 #define RK3576_I2S_SEL_MASK BIT(0)