fdc2139c5e2cde4ea395e290e659513df93e1664
[openwrt/staging/svanheule.git] /
1 From b6d1141860db42137660a44a8c1713a33e6e5833 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 | 39 ++++++++++++++++++++++++++++++++++
14 drivers/gpu/drm/vc4/vc4_hdmi.h | 8 +++++++
15 2 files changed, 47 insertions(+)
16
17 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
18 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
19 @@ -113,6 +113,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 @@ -2362,6 +2368,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 @@ -2458,6 +2465,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 @@ -216,6 +216,14 @@ struct vc4_hdmi {
82 * the scrambler on? Protected by @mutex.
83 */
84 bool scdc_enabled;
85 +
86 + /* VC5 debugfs regset */
87 + struct debugfs_regset32 cec_regset;
88 + struct debugfs_regset32 csc_regset;
89 + struct debugfs_regset32 dvp_regset;
90 + struct debugfs_regset32 phy_regset;
91 + struct debugfs_regset32 ram_regset;
92 + struct debugfs_regset32 rm_regset;
93 };
94
95 static inline struct vc4_hdmi *