d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0007-drm-sun4i-Add-support-for-D1-HDMI.patch
1 From 75dc74ecc1bf5e270659c6c78877053b50e6ae19 Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Wed, 30 Mar 2022 21:24:21 -0500
4 Subject: [PATCH 007/117] drm/sun4i: Add support for D1 HDMI
5
6 D1's HDMI controller contains some platform integration changes.
7 It now has no external TMDS clock. The controller also supports HDCP
8 without an external clock or reset.
9
10 While the maximum HDMI frequency is not explicity stated, the BSP PHY
11 driver provides PLL configurations only up to 297 MHz, so use that as
12 the max frequency.
13
14 Signed-off-by: Samuel Holland <samuel@sholland.org>
15 ---
16 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 11 ++++++++++-
17 1 file changed, 10 insertions(+), 1 deletion(-)
18
19 --- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
20 +++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
21 @@ -133,7 +133,7 @@ static int sun8i_dw_hdmi_bind(struct dev
22 return dev_err_probe(dev, PTR_ERR(hdmi->rst_ctrl),
23 "Could not get ctrl reset control\n");
24
25 - hdmi->clk_tmds = devm_clk_get(dev, "tmds");
26 + hdmi->clk_tmds = devm_clk_get_optional(dev, "tmds");
27 if (IS_ERR(hdmi->clk_tmds))
28 return dev_err_probe(dev, PTR_ERR(hdmi->clk_tmds),
29 "Couldn't get the tmds clock\n");
30 @@ -246,6 +246,11 @@ static const struct sun8i_dw_hdmi_quirks
31 .mode_valid = sun8i_dw_hdmi_mode_valid_a83t,
32 };
33
34 +static const struct sun8i_dw_hdmi_quirks sun20i_d1_quirks = {
35 + .mode_valid = sun8i_dw_hdmi_mode_valid_a83t,
36 + .use_drm_infoframe = true,
37 +};
38 +
39 static const struct sun8i_dw_hdmi_quirks sun50i_h6_quirks = {
40 .mode_valid = sun8i_dw_hdmi_mode_valid_h6,
41 .use_drm_infoframe = true,
42 @@ -257,6 +262,10 @@ static const struct of_device_id sun8i_d
43 .data = &sun8i_a83t_quirks,
44 },
45 {
46 + .compatible = "allwinner,sun20i-d1-dw-hdmi",
47 + .data = &sun20i_d1_quirks,
48 + },
49 + {
50 .compatible = "allwinner,sun50i-h6-dw-hdmi",
51 .data = &sun50i_h6_quirks,
52 },