drm/sun4i: Add support for A20 display pipeline components
authorJonathan Liu <net147@gmail.com>
Tue, 17 Oct 2017 12:18:02 +0000 (20:18 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 17 Oct 2017 17:49:17 +0000 (19:49 +0200)
The A20 display pipeline has 2 frontends, 2 backends, and 2 TCONs.
This patch adds support (or a compatible string in the frontend's
case) for these components.

The TCONs support directly outputting to CPU/RGB/LVDS LCD panels,
or it can output to HDMI via an on-chip HDMI controller, or
CVBS/YPbPr/VGA signals via on-chip TV encoders. These additional
encoders are not covered in this patch.

Signed-off-by: Jonathan Liu <net147@gmail.com>
[wens@csie.org: Expand commit message]
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171017121807.2994-6-wens@csie.org
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_drv.c
drivers/gpu/drm/sun4i/sun4i_tcon.c

index 8f9a58181f89b28545a9f9b15ee2f5d8526af510..013e76b348ba68a595fdd36ad8efdf3aa6ffc5b1 100644 (file)
@@ -91,6 +91,7 @@ Required properties:
    * allwinner,sun5i-a13-tcon
    * allwinner,sun6i-a31-tcon
    * allwinner,sun6i-a31s-tcon
+   * allwinner,sun7i-a20-tcon
    * allwinner,sun8i-a33-tcon
    * allwinner,sun8i-v3s-tcon
  - reg: base address and size of memory-mapped region
@@ -158,6 +159,7 @@ Required properties:
     * allwinner,sun4i-a10-display-backend
     * allwinner,sun5i-a13-display-backend
     * allwinner,sun6i-a31-display-backend
+    * allwinner,sun7i-a20-display-backend
     * allwinner,sun8i-a33-display-backend
   - reg: base address and size of the memory-mapped region.
   - interrupts: interrupt associated to this IP
@@ -191,6 +193,7 @@ Required properties:
     * allwinner,sun4i-a10-display-frontend
     * allwinner,sun5i-a13-display-frontend
     * allwinner,sun6i-a31-display-frontend
+    * allwinner,sun7i-a20-display-frontend
     * allwinner,sun8i-a33-display-frontend
   - reg: base address and size of the memory-mapped region.
   - interrupts: interrupt associated to this IP
@@ -240,6 +243,7 @@ Required properties:
     * allwinner,sun5i-a13-display-engine
     * allwinner,sun6i-a31-display-engine
     * allwinner,sun6i-a31s-display-engine
+    * allwinner,sun7i-a20-display-engine
     * allwinner,sun8i-a33-display-engine
     * allwinner,sun8i-v3s-display-engine
 
index 77f9e183df00d892f28b813310c3b4cba46cdac0..847eecbe4d141fdebaa6bad67b9346ee37255094 100644 (file)
@@ -524,6 +524,10 @@ static const struct sun4i_backend_quirks sun5i_backend_quirks = {
 static const struct sun4i_backend_quirks sun6i_backend_quirks = {
 };
 
+static const struct sun4i_backend_quirks sun7i_backend_quirks = {
+       .needs_output_muxing = true,
+};
+
 static const struct sun4i_backend_quirks sun8i_a33_backend_quirks = {
 };
 
@@ -540,6 +544,10 @@ static const struct of_device_id sun4i_backend_of_table[] = {
                .compatible = "allwinner,sun6i-a31-display-backend",
                .data = &sun6i_backend_quirks,
        },
+       {
+               .compatible = "allwinner,sun7i-a20-display-backend",
+               .data = &sun7i_backend_quirks,
+       },
        {
                .compatible = "allwinner,sun8i-a33-display-backend",
                .data = &sun8i_a33_backend_quirks,
index 51ad1fb6843c60c902f6d1e572d8b9e308907451..75c76cdd82bc6e15fcae27aa33fe165f420c381b 100644 (file)
@@ -181,6 +181,7 @@ static bool sun4i_drv_node_is_frontend(struct device_node *node)
        return of_device_is_compatible(node, "allwinner,sun4i-a10-display-frontend") ||
                of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") ||
                of_device_is_compatible(node, "allwinner,sun6i-a31-display-frontend") ||
+               of_device_is_compatible(node, "allwinner,sun7i-a20-display-frontend") ||
                of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend");
 }
 
@@ -190,6 +191,7 @@ static bool sun4i_drv_node_is_tcon(struct device_node *node)
                of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") ||
                of_device_is_compatible(node, "allwinner,sun6i-a31-tcon") ||
                of_device_is_compatible(node, "allwinner,sun6i-a31s-tcon") ||
+               of_device_is_compatible(node, "allwinner,sun7i-a20-tcon") ||
                of_device_is_compatible(node, "allwinner,sun8i-a33-tcon") ||
                of_device_is_compatible(node, "allwinner,sun8i-v3s-tcon");
 }
@@ -349,6 +351,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
        { .compatible = "allwinner,sun5i-a13-display-engine" },
        { .compatible = "allwinner,sun6i-a31-display-engine" },
        { .compatible = "allwinner,sun6i-a31s-display-engine" },
+       { .compatible = "allwinner,sun7i-a20-display-engine" },
        { .compatible = "allwinner,sun8i-a33-display-engine" },
        { .compatible = "allwinner,sun8i-v3s-display-engine" },
        { }
index 7beac80c406e6f9c9150732094d9da1ce5318cf4..e122f5b2a395583cc14302a9bc4166fbba671071 100644 (file)
@@ -886,6 +886,12 @@ static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
        .needs_de_be_mux        = true,
 };
 
+static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
+       .has_channel_1          = true,
+       /* Same display pipeline structure as A10 */
+       .set_mux                = sun4i_a10_tcon_set_mux,
+};
+
 static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
        /* nothing is supported */
 };
@@ -899,6 +905,7 @@ static const struct of_device_id sun4i_tcon_of_table[] = {
        { .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks },
        { .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
        { .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks },
+       { .compatible = "allwinner,sun7i-a20-tcon", .data = &sun7i_a20_quirks },
        { .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks },
        { .compatible = "allwinner,sun8i-v3s-tcon", .data = &sun8i_v3s_quirks },
        { }