fa6a399daed7081af7453cd04eeeea07872e4882
[openwrt/staging/blocktrron.git] /
1 From cdbebb3a92aca7327c88c6dc6ef5d4cd470d49fc Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 23 Feb 2023 19:44:32 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Warn if writing to an unknown HDMI register
5
6 The VC4 HDMI driver has a bunch of accessors to read from a register.
7 The read accessor was warning when accessing an unknown register, but
8 the write one was just returning silently.
9
10 Let's make sure we warn also when writing to an unknown register.
11
12 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
13 ---
14 drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h
19 @@ -498,8 +498,11 @@ static inline void vc4_hdmi_write(struct
20
21 field = &variant->registers[reg];
22 base = __vc4_hdmi_get_field_base(hdmi, field->reg);
23 - if (!base)
24 + if (!base) {
25 + dev_warn(&hdmi->pdev->dev,
26 + "Unknown register ID %u\n", reg);
27 return;
28 + }
29
30 writel(value, base + field->offset);
31 }