d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0097-drm-sun4i-dsi-Add-the-A100-variant.patch
1 From 713029c6a33df9218d11593bc5be79420715633f Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Sun, 7 Aug 2022 11:06:22 -0500
4 Subject: [PATCH 097/117] drm/sun4i: dsi: Add the A100 variant
5
6 The A100 variant of the MIPI DSI controller now gets its module clock
7 from the TCON via the TCON TOP, so the clock rate cannot be set to a
8 fixed value. Otherwise, it appears to be the same as the A31 variant.
9
10 Cover-letter:
11 drm/sun4i: dsi: Support the A100/D1 controller variant
12 This series adds support for the digital part of the DSI controller
13 found in the A100 and D1 SoCs (plus T7, which is not supported by
14 mainline Linux). There are two changes to the hardware integration:
15 1) the module clock routes through the TCON TOP, and
16 2) the separate I/O domain is removed.
17
18 The actual register interface appears to be the same as before. The
19 register definitions in the D1 BSP exactly match the A64 BSP.
20
21 The BSP describes this as the "40nm" DSI controller variant. There is
22 also a "28nm" variant with a different register interface; that one is
23 found in a different subset of SoCs (V5 and A50).
24
25 A100/D1 also come with an updated DPHY, described by the BSP as a
26 "combo" PHY, which is now also used for LVDS channel 0. (LVDS and DSI
27 share the same pins on Port D.) Since that is a different subsystem,
28 I am sending that as a separate series.
29 END
30
31 Series-to: Chen-Yu Tsai <wens@csie.org>
32 Series-to: Jernej Skrabec <jernej.skrabec@gmail.com>
33 Series-to: Maxime Ripard <mripard@kernel.org>
34
35 Series-version: 2
36
37 Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
38 Signed-off-by: Samuel Holland <samuel@sholland.org>
39 ---
40 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 8 ++++++++
41 1 file changed, 8 insertions(+)
42
43 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
44 +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
45 @@ -1223,6 +1223,10 @@ static const struct sun6i_dsi_variant su
46 static const struct sun6i_dsi_variant sun50i_a64_mipi_dsi_variant = {
47 };
48
49 +static const struct sun6i_dsi_variant sun50i_a100_mipi_dsi_variant = {
50 + .has_mod_clk = true,
51 +};
52 +
53 static const struct of_device_id sun6i_dsi_of_table[] = {
54 {
55 .compatible = "allwinner,sun6i-a31-mipi-dsi",
56 @@ -1232,6 +1236,10 @@ static const struct of_device_id sun6i_d
57 .compatible = "allwinner,sun50i-a64-mipi-dsi",
58 .data = &sun50i_a64_mipi_dsi_variant,
59 },
60 + {
61 + .compatible = "allwinner,sun50i-a100-mipi-dsi",
62 + .data = &sun50i_a100_mipi_dsi_variant,
63 + },
64 { }
65 };
66 MODULE_DEVICE_TABLE(of, sun6i_dsi_of_table);