OSDN Git Service

drm/sun4i: support A33 tcon
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 7 Jan 2016 11:32:25 +0000 (12:32 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 8 Sep 2016 07:28:51 +0000 (09:28 +0200)
The A33 has a significantly different pipeline, with components that differ
too.

Make sure we had compatible for them.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Chen-Yu Tsai <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 df8f4ae..46d8c57 100644 (file)
@@ -26,13 +26,14 @@ TCON
 The TCON acts as a timing controller for RGB, LVDS and TV interfaces.
 
 Required properties:
- - compatible: value should be "allwinner,sun5i-a13-tcon".
+ - compatible: value must be either:
+   * allwinner,sun5i-a13-tcon
+   * allwinner,sun8i-a33-tcon
  - reg: base address and size of memory-mapped region
  - interrupts: interrupt associated to this IP
  - clocks: phandles to the clocks feeding the TCON. Three are needed:
    - 'ahb': the interface clocks
    - 'tcon-ch0': The clock driving the TCON channel 0
-   - 'tcon-ch1': The clock driving the TCON channel 1
  - resets: phandles to the reset controllers driving the encoder
    - "lcd": the reset line for the TCON channel 0
 
@@ -49,6 +50,9 @@ Required properties:
   second the block connected to the TCON channel 1 (usually the TV
   encoder)
 
+On the A13, there is one more clock required:
+   - 'tcon-ch1': The clock driving the TCON channel 1
+
 
 Display Engine Backend
 ----------------------
@@ -59,6 +63,7 @@ system.
 Required properties:
   - compatible: value must be one of:
     * allwinner,sun5i-a13-display-backend
+    * allwinner,sun8i-a33-display-backend
   - reg: base address and size of the memory-mapped region.
   - clocks: phandles to the clocks feeding the frontend and backend
     * ahb: the backend interface clock
@@ -80,6 +85,7 @@ deinterlacing and color space conversion.
 Required properties:
   - compatible: value must be one of:
     * allwinner,sun5i-a13-display-frontend
+    * allwinner,sun8i-a33-display-frontend
   - reg: base address and size of the memory-mapped region.
   - interrupts: interrupt associated to this IP
   - clocks: phandles to the clocks feeding the frontend and backend
@@ -104,6 +110,7 @@ extra node.
 Required properties:
   - compatible: value must be one of:
     * allwinner,sun5i-a13-display-engine
+    * allwinner,sun8i-a33-display-engine
 
   - allwinner,pipelines: list of phandle to the display engine
     frontends available.
index 3ab5604..9bfd2e4 100644 (file)
@@ -345,6 +345,7 @@ static int sun4i_backend_remove(struct platform_device *pdev)
 
 static const struct of_device_id sun4i_backend_of_table[] = {
        { .compatible = "allwinner,sun5i-a13-display-backend" },
+       { .compatible = "allwinner,sun8i-a33-display-backend" },
        { }
 };
 MODULE_DEVICE_TABLE(of, sun4i_backend_of_table);
index 942f62e..c4d03c1 100644 (file)
@@ -199,13 +199,14 @@ static const struct component_master_ops sun4i_drv_master_ops = {
 
 static bool sun4i_drv_node_is_frontend(struct device_node *node)
 {
-       return of_device_is_compatible(node,
-                                      "allwinner,sun5i-a13-display-frontend");
+       return of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") ||
+               of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend");
 }
 
 static bool sun4i_drv_node_is_tcon(struct device_node *node)
 {
-       return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon");
+       return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") ||
+               of_device_is_compatible(node, "allwinner,sun8i-a33-tcon");
 }
 
 static int compare_of(struct device *dev, void *data)
@@ -320,6 +321,7 @@ static int sun4i_drv_remove(struct platform_device *pdev)
 
 static const struct of_device_id sun4i_drv_of_table[] = {
        { .compatible = "allwinner,sun5i-a13-display-engine" },
+       { .compatible = "allwinner,sun8i-a33-display-engine" },
        { }
 };
 MODULE_DEVICE_TABLE(of, sun4i_drv_of_table);
index fde6af1..cadacb5 100644 (file)
@@ -488,8 +488,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
        tcon->drm = drm;
        tcon->dev = dev;
 
-       if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon"))
+       if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) {
                tcon->has_mux = true;
+               tcon->has_channel_1 = true;
+       } else {
+               tcon->has_mux = false;
+               tcon->has_channel_1 = false;
+       }
 
        tcon->lcd_rst = devm_reset_control_get(dev, "lcd");
        if (IS_ERR(tcon->lcd_rst)) {
@@ -585,6 +590,7 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
 
 static const struct of_device_id sun4i_tcon_of_table[] = {
        { .compatible = "allwinner,sun5i-a13-tcon" },
+       { .compatible = "allwinner,sun8i-a33-tcon" },
        { }
 };
 MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table);