edc5be80ab8680cf2306be653edfd38698f2b0fe
[openwrt/staging/linusw.git] /
1 From ef65a6f064b3bd497d83b0f40908182ba2a2b863 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 21 Oct 2020 18:34:56 +0100
4 Subject: [PATCH] drm/vc4: Add all the HDMI registers into the debugfs
5 dumps
6
7 The vc5 HDMI registers hadn't been added into the debugfs
8 register sets, therefore weren't dumped on request.
9 Add them in.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/gpu/drm/vc4/vc4_hdmi.c | 44 ++++++++++++++++++++++++++++++++++
14 drivers/gpu/drm/vc4/vc4_hdmi.h | 9 +++++++
15 2 files changed, 53 insertions(+)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -92,6 +92,12 @@ static int vc4_hdmi_debugfs_regs(struct
20
21 drm_print_regset32(&p, &vc4_hdmi->hdmi_regset);
22 drm_print_regset32(&p, &vc4_hdmi->hd_regset);
23 + drm_print_regset32(&p, &vc4_hdmi->cec_regset);
24 + drm_print_regset32(&p, &vc4_hdmi->csc_regset);
25 + drm_print_regset32(&p, &vc4_hdmi->dvp_regset);
26 + drm_print_regset32(&p, &vc4_hdmi->phy_regset);
27 + drm_print_regset32(&p, &vc4_hdmi->ram_regset);
28 + drm_print_regset32(&p, &vc4_hdmi->rm_regset);
29
30 return 0;
31 }
32 @@ -1732,6 +1738,7 @@ static int vc5_hdmi_init_resources(struc
33 struct platform_device *pdev = vc4_hdmi->pdev;
34 struct device *dev = &pdev->dev;
35 struct resource *res;
36 + int ret;
37
38 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi");
39 if (!res)
40 @@ -1822,6 +1829,38 @@ static int vc5_hdmi_init_resources(struc
41 return PTR_ERR(vc4_hdmi->reset);
42 }
43
44 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hdmi_regset, VC4_HDMI);
45 + if (ret)
46 + return ret;
47 +
48 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->hd_regset, VC4_HD);
49 + if (ret)
50 + return ret;
51 +
52 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->cec_regset, VC5_CEC);
53 + if (ret)
54 + return ret;
55 +
56 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->csc_regset, VC5_CSC);
57 + if (ret)
58 + return ret;
59 +
60 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->dvp_regset, VC5_DVP);
61 + if (ret)
62 + return ret;
63 +
64 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->phy_regset, VC5_PHY);
65 + if (ret)
66 + return ret;
67 +
68 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->ram_regset, VC5_RAM);
69 + if (ret)
70 + return ret;
71 +
72 + ret = vc4_hdmi_build_regset(vc4_hdmi, &vc4_hdmi->rm_regset, VC5_RM);
73 + if (ret)
74 + return ret;
75 +
76 return 0;
77 }
78
79 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h
80 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
81 @@ -161,8 +161,16 @@ struct vc4_hdmi {
82
83 struct reset_control *reset;
84
85 + /* Common debugfs regset */
86 struct debugfs_regset32 hdmi_regset;
87 struct debugfs_regset32 hd_regset;
88 + /* VC5 debugfs regset */
89 + struct debugfs_regset32 cec_regset;
90 + struct debugfs_regset32 csc_regset;
91 + struct debugfs_regset32 dvp_regset;
92 + struct debugfs_regset32 phy_regset;
93 + struct debugfs_regset32 ram_regset;
94 + struct debugfs_regset32 rm_regset;
95 };
96
97 static inline struct vc4_hdmi *