diff options
author | Dave Airlie <airlied@redhat.com> | 2015-10-21 20:31:43 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-10-21 20:31:43 -0400 |
commit | 2b5f900e4fb18d85fc62d4efcf4e7016fc384806 (patch) | |
tree | e2fe7eb5a494146260a2f8f39f7578942107832b | |
parent | 1f43710a8e3d0de5dcbf14d3d8a0b5f31126396f (diff) | |
parent | 090425c45db3ec438c161f6a5dd05d1824e65dcd (diff) |
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
rcar-du support for r8a7793/4
* 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev:
drm: rcar-du: Add support for the R8A7794 DU
drm: rcar-du: Add support for the R8A7793 DU
-rw-r--r-- | Documentation/devicetree/bindings/video/renesas,du.txt | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_drv.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_group.c | 5 |
3 files changed, 38 insertions, 8 deletions
diff --git a/Documentation/devicetree/bindings/video/renesas,du.txt b/Documentation/devicetree/bindings/video/renesas,du.txt index c902323928f7..eccd4f4867b2 100644 --- a/Documentation/devicetree/bindings/video/renesas,du.txt +++ b/Documentation/devicetree/bindings/video/renesas,du.txt | |||
@@ -5,7 +5,9 @@ Required Properties: | |||
5 | - compatible: must be one of the following. | 5 | - compatible: must be one of the following. |
6 | - "renesas,du-r8a7779" for R8A7779 (R-Car H1) compatible DU | 6 | - "renesas,du-r8a7779" for R8A7779 (R-Car H1) compatible DU |
7 | - "renesas,du-r8a7790" for R8A7790 (R-Car H2) compatible DU | 7 | - "renesas,du-r8a7790" for R8A7790 (R-Car H2) compatible DU |
8 | - "renesas,du-r8a7791" for R8A7791 (R-Car M2) compatible DU | 8 | - "renesas,du-r8a7791" for R8A7791 (R-Car M2-W) compatible DU |
9 | - "renesas,du-r8a7793" for R8A7793 (R-Car M2-N) compatible DU | ||
10 | - "renesas,du-r8a7794" for R8A7794 (R-Car E2) compatible DU | ||
9 | 11 | ||
10 | - reg: A list of base address and length of each memory resource, one for | 12 | - reg: A list of base address and length of each memory resource, one for |
11 | each entry in the reg-names property. | 13 | each entry in the reg-names property. |
@@ -22,9 +24,9 @@ Required Properties: | |||
22 | - clock-names: Name of the clocks. This property is model-dependent. | 24 | - clock-names: Name of the clocks. This property is model-dependent. |
23 | - R8A7779 uses a single functional clock. The clock doesn't need to be | 25 | - R8A7779 uses a single functional clock. The clock doesn't need to be |
24 | named. | 26 | named. |
25 | - R8A7790 and R8A7791 use one functional clock per channel and one clock | 27 | - R8A779[0134] use one functional clock per channel and one clock per LVDS |
26 | per LVDS encoder. The functional clocks must be named "du.x" with "x" | 28 | encoder (if available). The functional clocks must be named "du.x" with |
27 | being the channel numerical index. The LVDS clocks must be named | 29 | "x" being the channel numerical index. The LVDS clocks must be named |
28 | "lvds.x" with "x" being the LVDS encoder numerical index. | 30 | "lvds.x" with "x" being the LVDS encoder numerical index. |
29 | - In addition to the functional and encoder clocks, all DU versions also | 31 | - In addition to the functional and encoder clocks, all DU versions also |
30 | support externally supplied pixel clocks. Those clocks are optional. | 32 | support externally supplied pixel clocks. Those clocks are optional. |
@@ -43,7 +45,9 @@ corresponding to each DU output. | |||
43 | ----------------------------------------------------------------------------- | 45 | ----------------------------------------------------------------------------- |
44 | R8A7779 (H1) DPAD 0 DPAD 1 - | 46 | R8A7779 (H1) DPAD 0 DPAD 1 - |
45 | R8A7790 (H2) DPAD LVDS 0 LVDS 1 | 47 | R8A7790 (H2) DPAD LVDS 0 LVDS 1 |
46 | R8A7791 (M2) DPAD LVDS 0 - | 48 | R8A7791 (M2-W) DPAD LVDS 0 - |
49 | R8A7793 (M2-N) DPAD LVDS 0 - | ||
50 | R8A7794 (E2) DPAD 0 DPAD 1 - | ||
47 | 51 | ||
48 | 52 | ||
49 | Example: R8A7790 (R-Car H2) DU | 53 | Example: R8A7790 (R-Car H2) DU |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index bebcc97db5e5..40422f6b645e 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c | |||
@@ -84,12 +84,13 @@ static const struct rcar_du_device_info rcar_du_r8a7790_info = { | |||
84 | .num_lvds = 2, | 84 | .num_lvds = 2, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | /* M2-W (r8a7791) and M2-N (r8a7793) are identical */ | ||
87 | static const struct rcar_du_device_info rcar_du_r8a7791_info = { | 88 | static const struct rcar_du_device_info rcar_du_r8a7791_info = { |
88 | .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | 89 | .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK |
89 | | RCAR_DU_FEATURE_EXT_CTRL_REGS, | 90 | | RCAR_DU_FEATURE_EXT_CTRL_REGS, |
90 | .num_crtcs = 2, | 91 | .num_crtcs = 2, |
91 | .routes = { | 92 | .routes = { |
92 | /* R8A7791 has one RGB output, one LVDS output and one | 93 | /* R8A779[13] has one RGB output, one LVDS output and one |
93 | * (currently unsupported) TCON output. | 94 | * (currently unsupported) TCON output. |
94 | */ | 95 | */ |
95 | [RCAR_DU_OUTPUT_DPAD0] = { | 96 | [RCAR_DU_OUTPUT_DPAD0] = { |
@@ -106,10 +107,34 @@ static const struct rcar_du_device_info rcar_du_r8a7791_info = { | |||
106 | .num_lvds = 1, | 107 | .num_lvds = 1, |
107 | }; | 108 | }; |
108 | 109 | ||
110 | static const struct rcar_du_device_info rcar_du_r8a7794_info = { | ||
111 | .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | ||
112 | | RCAR_DU_FEATURE_EXT_CTRL_REGS, | ||
113 | .num_crtcs = 2, | ||
114 | .routes = { | ||
115 | /* R8A7794 has two RGB outputs and one (currently unsupported) | ||
116 | * TCON output. | ||
117 | */ | ||
118 | [RCAR_DU_OUTPUT_DPAD0] = { | ||
119 | .possible_crtcs = BIT(0), | ||
120 | .encoder_type = DRM_MODE_ENCODER_NONE, | ||
121 | .port = 0, | ||
122 | }, | ||
123 | [RCAR_DU_OUTPUT_DPAD1] = { | ||
124 | .possible_crtcs = BIT(1), | ||
125 | .encoder_type = DRM_MODE_ENCODER_NONE, | ||
126 | .port = 1, | ||
127 | }, | ||
128 | }, | ||
129 | .num_lvds = 0, | ||
130 | }; | ||
131 | |||
109 | static const struct of_device_id rcar_du_of_table[] = { | 132 | static const struct of_device_id rcar_du_of_table[] = { |
110 | { .compatible = "renesas,du-r8a7779", .data = &rcar_du_r8a7779_info }, | 133 | { .compatible = "renesas,du-r8a7779", .data = &rcar_du_r8a7779_info }, |
111 | { .compatible = "renesas,du-r8a7790", .data = &rcar_du_r8a7790_info }, | 134 | { .compatible = "renesas,du-r8a7790", .data = &rcar_du_r8a7790_info }, |
112 | { .compatible = "renesas,du-r8a7791", .data = &rcar_du_r8a7791_info }, | 135 | { .compatible = "renesas,du-r8a7791", .data = &rcar_du_r8a7791_info }, |
136 | { .compatible = "renesas,du-r8a7793", .data = &rcar_du_r8a7791_info }, | ||
137 | { .compatible = "renesas,du-r8a7794", .data = &rcar_du_r8a7794_info }, | ||
113 | { } | 138 | { } |
114 | }; | 139 | }; |
115 | 140 | ||
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c index 7fd39a7d91c8..8e2ffe025153 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_group.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c | |||
@@ -49,9 +49,10 @@ static void rcar_du_group_setup_defr8(struct rcar_du_group *rgrp) | |||
49 | u32 defr8 = DEFR8_CODE | DEFR8_DEFE8; | 49 | u32 defr8 = DEFR8_CODE | DEFR8_DEFE8; |
50 | 50 | ||
51 | /* The DEFR8 register for the first group also controls RGB output | 51 | /* The DEFR8 register for the first group also controls RGB output |
52 | * routing to DPAD0 | 52 | * routing to DPAD0 for DU instances that support it. |
53 | */ | 53 | */ |
54 | if (rgrp->index == 0) | 54 | if (rgrp->dev->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs > 1 && |
55 | rgrp->index == 0) | ||
55 | defr8 |= DEFR8_DRGBS_DU(rgrp->dev->dpad0_source); | 56 | defr8 |= DEFR8_DRGBS_DU(rgrp->dev->dpad0_source); |
56 | 57 | ||
57 | rcar_du_group_write(rgrp, DEFR8, defr8); | 58 | rcar_du_group_write(rgrp, DEFR8, defr8); |