diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2016-01-07 06:32:25 -0500 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2016-09-08 03:28:51 -0400 |
commit | 4a408f1f639bd702cc2699d33161f3590c942c2c (patch) | |
tree | 0c77d9e8b6359533053142b3fbacea26bdd15c12 | |
parent | 8e9240472522bd53d9372a03357b9f0ca8faef59 (diff) |
drm/sun4i: support A33 tcon
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>
-rw-r--r-- | Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_backend.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_drv.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_tcon.c | 8 |
4 files changed, 22 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index df8f4aeefe4c..46d8c570aa11 100644 --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | |||
@@ -26,13 +26,14 @@ TCON | |||
26 | The TCON acts as a timing controller for RGB, LVDS and TV interfaces. | 26 | The TCON acts as a timing controller for RGB, LVDS and TV interfaces. |
27 | 27 | ||
28 | Required properties: | 28 | Required properties: |
29 | - compatible: value should be "allwinner,sun5i-a13-tcon". | 29 | - compatible: value must be either: |
30 | * allwinner,sun5i-a13-tcon | ||
31 | * allwinner,sun8i-a33-tcon | ||
30 | - reg: base address and size of memory-mapped region | 32 | - reg: base address and size of memory-mapped region |
31 | - interrupts: interrupt associated to this IP | 33 | - interrupts: interrupt associated to this IP |
32 | - clocks: phandles to the clocks feeding the TCON. Three are needed: | 34 | - clocks: phandles to the clocks feeding the TCON. Three are needed: |
33 | - 'ahb': the interface clocks | 35 | - 'ahb': the interface clocks |
34 | - 'tcon-ch0': The clock driving the TCON channel 0 | 36 | - 'tcon-ch0': The clock driving the TCON channel 0 |
35 | - 'tcon-ch1': The clock driving the TCON channel 1 | ||
36 | - resets: phandles to the reset controllers driving the encoder | 37 | - resets: phandles to the reset controllers driving the encoder |
37 | - "lcd": the reset line for the TCON channel 0 | 38 | - "lcd": the reset line for the TCON channel 0 |
38 | 39 | ||
@@ -49,6 +50,9 @@ Required properties: | |||
49 | second the block connected to the TCON channel 1 (usually the TV | 50 | second the block connected to the TCON channel 1 (usually the TV |
50 | encoder) | 51 | encoder) |
51 | 52 | ||
53 | On the A13, there is one more clock required: | ||
54 | - 'tcon-ch1': The clock driving the TCON channel 1 | ||
55 | |||
52 | 56 | ||
53 | Display Engine Backend | 57 | Display Engine Backend |
54 | ---------------------- | 58 | ---------------------- |
@@ -59,6 +63,7 @@ system. | |||
59 | Required properties: | 63 | Required properties: |
60 | - compatible: value must be one of: | 64 | - compatible: value must be one of: |
61 | * allwinner,sun5i-a13-display-backend | 65 | * allwinner,sun5i-a13-display-backend |
66 | * allwinner,sun8i-a33-display-backend | ||
62 | - reg: base address and size of the memory-mapped region. | 67 | - reg: base address and size of the memory-mapped region. |
63 | - clocks: phandles to the clocks feeding the frontend and backend | 68 | - clocks: phandles to the clocks feeding the frontend and backend |
64 | * ahb: the backend interface clock | 69 | * ahb: the backend interface clock |
@@ -80,6 +85,7 @@ deinterlacing and color space conversion. | |||
80 | Required properties: | 85 | Required properties: |
81 | - compatible: value must be one of: | 86 | - compatible: value must be one of: |
82 | * allwinner,sun5i-a13-display-frontend | 87 | * allwinner,sun5i-a13-display-frontend |
88 | * allwinner,sun8i-a33-display-frontend | ||
83 | - reg: base address and size of the memory-mapped region. | 89 | - reg: base address and size of the memory-mapped region. |
84 | - interrupts: interrupt associated to this IP | 90 | - interrupts: interrupt associated to this IP |
85 | - clocks: phandles to the clocks feeding the frontend and backend | 91 | - clocks: phandles to the clocks feeding the frontend and backend |
@@ -104,6 +110,7 @@ extra node. | |||
104 | Required properties: | 110 | Required properties: |
105 | - compatible: value must be one of: | 111 | - compatible: value must be one of: |
106 | * allwinner,sun5i-a13-display-engine | 112 | * allwinner,sun5i-a13-display-engine |
113 | * allwinner,sun8i-a33-display-engine | ||
107 | 114 | ||
108 | - allwinner,pipelines: list of phandle to the display engine | 115 | - allwinner,pipelines: list of phandle to the display engine |
109 | frontends available. | 116 | frontends available. |
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 3ab560450a82..9bfd2e45fceb 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c | |||
@@ -345,6 +345,7 @@ static int sun4i_backend_remove(struct platform_device *pdev) | |||
345 | 345 | ||
346 | static const struct of_device_id sun4i_backend_of_table[] = { | 346 | static const struct of_device_id sun4i_backend_of_table[] = { |
347 | { .compatible = "allwinner,sun5i-a13-display-backend" }, | 347 | { .compatible = "allwinner,sun5i-a13-display-backend" }, |
348 | { .compatible = "allwinner,sun8i-a33-display-backend" }, | ||
348 | { } | 349 | { } |
349 | }; | 350 | }; |
350 | MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); | 351 | MODULE_DEVICE_TABLE(of, sun4i_backend_of_table); |
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 942f62e2441c..c4d03c1b6db8 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c | |||
@@ -199,13 +199,14 @@ static const struct component_master_ops sun4i_drv_master_ops = { | |||
199 | 199 | ||
200 | static bool sun4i_drv_node_is_frontend(struct device_node *node) | 200 | static bool sun4i_drv_node_is_frontend(struct device_node *node) |
201 | { | 201 | { |
202 | return of_device_is_compatible(node, | 202 | return of_device_is_compatible(node, "allwinner,sun5i-a13-display-frontend") || |
203 | "allwinner,sun5i-a13-display-frontend"); | 203 | of_device_is_compatible(node, "allwinner,sun8i-a33-display-frontend"); |
204 | } | 204 | } |
205 | 205 | ||
206 | static bool sun4i_drv_node_is_tcon(struct device_node *node) | 206 | static bool sun4i_drv_node_is_tcon(struct device_node *node) |
207 | { | 207 | { |
208 | return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon"); | 208 | return of_device_is_compatible(node, "allwinner,sun5i-a13-tcon") || |
209 | of_device_is_compatible(node, "allwinner,sun8i-a33-tcon"); | ||
209 | } | 210 | } |
210 | 211 | ||
211 | static int compare_of(struct device *dev, void *data) | 212 | static int compare_of(struct device *dev, void *data) |
@@ -320,6 +321,7 @@ static int sun4i_drv_remove(struct platform_device *pdev) | |||
320 | 321 | ||
321 | static const struct of_device_id sun4i_drv_of_table[] = { | 322 | static const struct of_device_id sun4i_drv_of_table[] = { |
322 | { .compatible = "allwinner,sun5i-a13-display-engine" }, | 323 | { .compatible = "allwinner,sun5i-a13-display-engine" }, |
324 | { .compatible = "allwinner,sun8i-a33-display-engine" }, | ||
323 | { } | 325 | { } |
324 | }; | 326 | }; |
325 | MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); | 327 | MODULE_DEVICE_TABLE(of, sun4i_drv_of_table); |
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index fde6af1230d2..cadacb517f95 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c | |||
@@ -488,8 +488,13 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, | |||
488 | tcon->drm = drm; | 488 | tcon->drm = drm; |
489 | tcon->dev = dev; | 489 | tcon->dev = dev; |
490 | 490 | ||
491 | if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) | 491 | if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) { |
492 | tcon->has_mux = true; | 492 | tcon->has_mux = true; |
493 | tcon->has_channel_1 = true; | ||
494 | } else { | ||
495 | tcon->has_mux = false; | ||
496 | tcon->has_channel_1 = false; | ||
497 | } | ||
493 | 498 | ||
494 | tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); | 499 | tcon->lcd_rst = devm_reset_control_get(dev, "lcd"); |
495 | if (IS_ERR(tcon->lcd_rst)) { | 500 | if (IS_ERR(tcon->lcd_rst)) { |
@@ -585,6 +590,7 @@ static int sun4i_tcon_remove(struct platform_device *pdev) | |||
585 | 590 | ||
586 | static const struct of_device_id sun4i_tcon_of_table[] = { | 591 | static const struct of_device_id sun4i_tcon_of_table[] = { |
587 | { .compatible = "allwinner,sun5i-a13-tcon" }, | 592 | { .compatible = "allwinner,sun5i-a13-tcon" }, |
593 | { .compatible = "allwinner,sun8i-a33-tcon" }, | ||
588 | { } | 594 | { } |
589 | }; | 595 | }; |
590 | MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table); | 596 | MODULE_DEVICE_TABLE(of, sun4i_tcon_of_table); |