Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-misc-next-2020-01-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for v5.6:

UAPI Changes:

Cross-subsystem Changes:
- Convert simple panel bindings to a template.

Core Changes:
- Revert drm-bridge-state changes, it causes a dependency error
between drm and drm_kms_helper.
- Fix when disabling crc's.
- Assorted Kconfig fixes.

Driver Changes:
- Add ddc symlinks to more drivers.
- Fix chained bridge handling in exynos and vc4.
- More clock rate fixes in sun4i.
- Add support for AUO B116XAK01, GiantPlus GPM940B0, Sony ACX424AKP,
BOE NV140FHM-N49, Satoz SAT050AT40H12R2 and Sharp LS020B1DD01D panels.
- Assorted small bugfixes.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1e8d4944-68d7-0df3-f39b-31f6fba22a2a@linux.intel.com

+3531 -1660
+291
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-display-backend.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-display-backend.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 Display Engine Backend Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The display engine backend exposes layers and sprites to the system. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - allwinner,sun4i-a10-display-backend 20 + - allwinner,sun5i-a13-display-backend 21 + - allwinner,sun6i-a31-display-backend 22 + - allwinner,sun7i-a20-display-backend 23 + - allwinner,sun8i-a23-display-backend 24 + - allwinner,sun8i-a33-display-backend 25 + - allwinner,sun9i-a80-display-backend 26 + 27 + reg: 28 + minItems: 1 29 + maxItems: 2 30 + items: 31 + - description: Display Backend registers 32 + - description: SAT registers 33 + 34 + reg-names: 35 + minItems: 1 36 + maxItems: 2 37 + items: 38 + - const: be 39 + - const: sat 40 + 41 + interrupts: 42 + maxItems: 1 43 + 44 + clocks: 45 + minItems: 3 46 + maxItems: 4 47 + items: 48 + - description: The backend interface clock 49 + - description: The backend module clock 50 + - description: The backend DRAM clock 51 + - description: The SAT clock 52 + 53 + clock-names: 54 + minItems: 3 55 + maxItems: 4 56 + items: 57 + - const: ahb 58 + - const: mod 59 + - const: ram 60 + - const: sat 61 + 62 + resets: 63 + minItems: 1 64 + maxItems: 2 65 + items: 66 + - description: The Backend reset line 67 + - description: The SAT reset line 68 + 69 + reset-names: 70 + minItems: 1 71 + maxItems: 2 72 + items: 73 + - const: be 74 + - const: sat 75 + 76 + # FIXME: This should be made required eventually once every SoC will 77 + # have the MBUS declared. 78 + interconnects: 79 + maxItems: 1 80 + 81 + # FIXME: This should be made required eventually once every SoC will 82 + # have the MBUS declared. 83 + interconnect-names: 84 + const: dma-mem 85 + 86 + ports: 87 + type: object 88 + description: | 89 + A ports node with endpoint definitions as defined in 90 + Documentation/devicetree/bindings/media/video-interfaces.txt. 91 + 92 + properties: 93 + "#address-cells": 94 + const: 1 95 + 96 + "#size-cells": 97 + const: 0 98 + 99 + port@0: 100 + type: object 101 + description: | 102 + Input endpoints of the controller. 103 + 104 + port@1: 105 + type: object 106 + description: | 107 + Output endpoints of the controller. 108 + 109 + required: 110 + - "#address-cells" 111 + - "#size-cells" 112 + - port@0 113 + - port@1 114 + 115 + additionalProperties: false 116 + 117 + required: 118 + - compatible 119 + - reg 120 + - interrupts 121 + - clocks 122 + - clock-names 123 + - resets 124 + - ports 125 + 126 + additionalProperties: false 127 + 128 + if: 129 + properties: 130 + compatible: 131 + contains: 132 + const: allwinner,sun8i-a33-display-backend 133 + 134 + then: 135 + properties: 136 + reg: 137 + minItems: 2 138 + 139 + reg-names: 140 + minItems: 2 141 + 142 + clocks: 143 + minItems: 4 144 + 145 + clock-names: 146 + minItems: 4 147 + 148 + resets: 149 + minItems: 2 150 + 151 + reset-names: 152 + minItems: 2 153 + 154 + required: 155 + - reg-names 156 + - reset-names 157 + 158 + else: 159 + properties: 160 + reg: 161 + maxItems: 1 162 + 163 + reg-names: 164 + maxItems: 1 165 + 166 + clocks: 167 + maxItems: 3 168 + 169 + clock-names: 170 + maxItems: 3 171 + 172 + resets: 173 + maxItems: 1 174 + 175 + reset-names: 176 + maxItems: 1 177 + 178 + examples: 179 + - | 180 + /* 181 + * This comes from the clock/sun4i-a10-ccu.h and 182 + * reset/sun4i-a10-ccu.h headers, but we can't include them since 183 + * it would trigger a bunch of warnings for redefinitions of 184 + * symbols with the other example. 185 + */ 186 + 187 + #define CLK_AHB_DE_BE0 42 188 + #define CLK_DRAM_DE_BE0 140 189 + #define CLK_DE_BE0 144 190 + #define RST_DE_BE0 5 191 + 192 + display-backend@1e60000 { 193 + compatible = "allwinner,sun4i-a10-display-backend"; 194 + reg = <0x01e60000 0x10000>; 195 + interrupts = <47>; 196 + clocks = <&ccu CLK_AHB_DE_BE0>, <&ccu CLK_DE_BE0>, 197 + <&ccu CLK_DRAM_DE_BE0>; 198 + clock-names = "ahb", "mod", 199 + "ram"; 200 + resets = <&ccu RST_DE_BE0>; 201 + 202 + ports { 203 + #address-cells = <1>; 204 + #size-cells = <0>; 205 + 206 + port@0 { 207 + #address-cells = <1>; 208 + #size-cells = <0>; 209 + reg = <0>; 210 + 211 + endpoint@0 { 212 + reg = <0>; 213 + remote-endpoint = <&fe0_out_be0>; 214 + }; 215 + 216 + endpoint@1 { 217 + reg = <1>; 218 + remote-endpoint = <&fe1_out_be0>; 219 + }; 220 + }; 221 + 222 + port@1 { 223 + #address-cells = <1>; 224 + #size-cells = <0>; 225 + reg = <1>; 226 + 227 + endpoint@0 { 228 + reg = <0>; 229 + remote-endpoint = <&tcon0_in_be0>; 230 + }; 231 + 232 + endpoint@1 { 233 + reg = <1>; 234 + remote-endpoint = <&tcon1_in_be0>; 235 + }; 236 + }; 237 + }; 238 + }; 239 + 240 + - | 241 + #include <dt-bindings/interrupt-controller/arm-gic.h> 242 + 243 + /* 244 + * This comes from the clock/sun8i-a23-a33-ccu.h and 245 + * reset/sun8i-a23-a33-ccu.h headers, but we can't include them 246 + * since it would trigger a bunch of warnings for redefinitions of 247 + * symbols with the other example. 248 + */ 249 + 250 + #define CLK_BUS_DE_BE 40 251 + #define CLK_BUS_SAT 46 252 + #define CLK_DRAM_DE_BE 84 253 + #define CLK_DE_BE 85 254 + #define RST_BUS_DE_BE 21 255 + #define RST_BUS_SAT 27 256 + 257 + display-backend@1e60000 { 258 + compatible = "allwinner,sun8i-a33-display-backend"; 259 + reg = <0x01e60000 0x10000>, <0x01e80000 0x1000>; 260 + reg-names = "be", "sat"; 261 + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; 262 + clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>, 263 + <&ccu CLK_DRAM_DE_BE>, <&ccu CLK_BUS_SAT>; 264 + clock-names = "ahb", "mod", 265 + "ram", "sat"; 266 + resets = <&ccu RST_BUS_DE_BE>, <&ccu RST_BUS_SAT>; 267 + reset-names = "be", "sat"; 268 + 269 + ports { 270 + #address-cells = <1>; 271 + #size-cells = <0>; 272 + 273 + port@0 { 274 + reg = <0>; 275 + 276 + endpoint { 277 + remote-endpoint = <&fe0_out_be0>; 278 + }; 279 + }; 280 + 281 + port@1 { 282 + reg = <1>; 283 + 284 + endpoint { 285 + remote-endpoint = <&drc0_in_be0>; 286 + }; 287 + }; 288 + }; 289 + }; 290 + 291 + ...
+114
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-display-engine.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-display-engine.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 Display Engine Pipeline Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The display engine pipeline (and its entry point, since it can be 15 + either directly the backend or the frontend) is represented as an 16 + extra node. 17 + 18 + The Allwinner A10 Display pipeline is composed of several components 19 + that are going to be documented below: 20 + 21 + For all connections between components up to the TCONs in the 22 + display pipeline, when there are multiple components of the same 23 + type at the same depth, the local endpoint ID must be the same as 24 + the remote component's index. For example, if the remote endpoint is 25 + Frontend 1, then the local endpoint ID must be 1. 26 + 27 + Frontend 0 [0] ------- [0] Backend 0 [0] ------- [0] TCON 0 28 + [1] -- -- [1] [1] -- -- [1] 29 + \ / \ / 30 + X X 31 + / \ / \ 32 + [0] -- -- [0] [0] -- -- [0] 33 + Frontend 1 [1] ------- [1] Backend 1 [1] ------- [1] TCON 1 34 + 35 + For a two pipeline system such as the one depicted above, the lines 36 + represent the connections between the components, while the numbers 37 + within the square brackets corresponds to the ID of the local endpoint. 38 + 39 + The same rule also applies to DE 2.0 mixer-TCON connections: 40 + 41 + Mixer 0 [0] ----------- [0] TCON 0 42 + [1] ---- ---- [1] 43 + \ / 44 + X 45 + / \ 46 + [0] ---- ---- [0] 47 + Mixer 1 [1] ----------- [1] TCON 1 48 + 49 + properties: 50 + compatible: 51 + enum: 52 + - allwinner,sun4i-a10-display-engine 53 + - allwinner,sun5i-a10s-display-engine 54 + - allwinner,sun5i-a13-display-engine 55 + - allwinner,sun6i-a31-display-engine 56 + - allwinner,sun6i-a31s-display-engine 57 + - allwinner,sun7i-a20-display-engine 58 + - allwinner,sun8i-a23-display-engine 59 + - allwinner,sun8i-a33-display-engine 60 + - allwinner,sun8i-a83t-display-engine 61 + - allwinner,sun8i-h3-display-engine 62 + - allwinner,sun8i-r40-display-engine 63 + - allwinner,sun8i-v3s-display-engine 64 + - allwinner,sun9i-a80-display-engine 65 + - allwinner,sun50i-a64-display-engine 66 + - allwinner,sun50i-h6-display-engine 67 + 68 + allwinner,pipelines: 69 + allOf: 70 + - $ref: /schemas/types.yaml#/definitions/phandle-array 71 + - minItems: 1 72 + maxItems: 2 73 + description: | 74 + Available display engine frontends (DE 1.0) or mixers (DE 75 + 2.0/3.0) available. 76 + 77 + required: 78 + - compatible 79 + - allwinner,pipelines 80 + 81 + additionalProperties: false 82 + 83 + if: 84 + properties: 85 + compatible: 86 + contains: 87 + enum: 88 + - allwinner,sun4i-a10-display-engine 89 + - allwinner,sun6i-a31-display-engine 90 + - allwinner,sun6i-a31s-display-engine 91 + - allwinner,sun7i-a20-display-engine 92 + - allwinner,sun8i-a83t-display-engine 93 + - allwinner,sun8i-r40-display-engine 94 + - allwinner,sun9i-a80-display-engine 95 + - allwinner,sun50i-a64-display-engine 96 + 97 + then: 98 + properties: 99 + allwinner,pipelines: 100 + minItems: 2 101 + 102 + else: 103 + properties: 104 + allwinner,pipelines: 105 + maxItems: 1 106 + 107 + examples: 108 + - | 109 + de: display-engine { 110 + compatible = "allwinner,sun4i-a10-display-engine"; 111 + allwinner,pipelines = <&fe0>, <&fe1>; 112 + }; 113 + 114 + ...
+138
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-display-frontend.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-display-frontend.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 Display Engine Frontend Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The display engine frontend does formats conversion, scaling, 15 + deinterlacing and color space conversion. 16 + 17 + properties: 18 + compatible: 19 + enum: 20 + - allwinner,sun4i-a10-display-frontend 21 + - allwinner,sun5i-a13-display-frontend 22 + - allwinner,sun6i-a31-display-frontend 23 + - allwinner,sun7i-a20-display-frontend 24 + - allwinner,sun8i-a23-display-frontend 25 + - allwinner,sun8i-a33-display-frontend 26 + - allwinner,sun9i-a80-display-frontend 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + clocks: 35 + items: 36 + - description: The frontend interface clock 37 + - description: The frontend module clock 38 + - description: The frontend DRAM clock 39 + 40 + clock-names: 41 + items: 42 + - const: ahb 43 + - const: mod 44 + - const: ram 45 + 46 + # FIXME: This should be made required eventually once every SoC will 47 + # have the MBUS declared. 48 + interconnects: 49 + maxItems: 1 50 + 51 + # FIXME: This should be made required eventually once every SoC will 52 + # have the MBUS declared. 53 + interconnect-names: 54 + const: dma-mem 55 + 56 + resets: 57 + maxItems: 1 58 + 59 + ports: 60 + type: object 61 + description: | 62 + A ports node with endpoint definitions as defined in 63 + Documentation/devicetree/bindings/media/video-interfaces.txt. 64 + 65 + properties: 66 + "#address-cells": 67 + const: 1 68 + 69 + "#size-cells": 70 + const: 0 71 + 72 + port@0: 73 + type: object 74 + description: | 75 + Input endpoints of the controller. 76 + 77 + port@1: 78 + type: object 79 + description: | 80 + Output endpoints of the controller. 81 + 82 + required: 83 + - "#address-cells" 84 + - "#size-cells" 85 + - port@1 86 + 87 + additionalProperties: false 88 + 89 + required: 90 + - compatible 91 + - reg 92 + - interrupts 93 + - clocks 94 + - clock-names 95 + - resets 96 + - ports 97 + 98 + additionalProperties: false 99 + 100 + examples: 101 + - | 102 + #include <dt-bindings/clock/sun4i-a10-ccu.h> 103 + #include <dt-bindings/reset/sun4i-a10-ccu.h> 104 + 105 + fe0: display-frontend@1e00000 { 106 + compatible = "allwinner,sun4i-a10-display-frontend"; 107 + reg = <0x01e00000 0x20000>; 108 + interrupts = <47>; 109 + clocks = <&ccu CLK_AHB_DE_FE0>, <&ccu CLK_DE_FE0>, 110 + <&ccu CLK_DRAM_DE_FE0>; 111 + clock-names = "ahb", "mod", 112 + "ram"; 113 + resets = <&ccu RST_DE_FE0>; 114 + 115 + ports { 116 + #address-cells = <1>; 117 + #size-cells = <0>; 118 + 119 + fe0_out: port@1 { 120 + #address-cells = <1>; 121 + #size-cells = <0>; 122 + reg = <1>; 123 + 124 + fe0_out_be0: endpoint@0 { 125 + reg = <0>; 126 + remote-endpoint = <&be0_in_fe0>; 127 + }; 128 + 129 + fe0_out_be1: endpoint@1 { 130 + reg = <1>; 131 + remote-endpoint = <&be1_in_fe0>; 132 + }; 133 + }; 134 + }; 135 + }; 136 + 137 + 138 + ...
+183
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-hdmi.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-hdmi.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 HDMI Controller Device Tree Bindings 8 + 9 + description: | 10 + The HDMI Encoder supports the HDMI video and audio outputs, and does 11 + CEC. It is one end of the pipeline. 12 + 13 + maintainers: 14 + - Chen-Yu Tsai <wens@csie.org> 15 + - Maxime Ripard <mripard@kernel.org> 16 + 17 + properties: 18 + compatible: 19 + oneOf: 20 + - const: allwinner,sun4i-a10-hdmi 21 + - const: allwinner,sun5i-a10s-hdmi 22 + - const: allwinner,sun6i-a31-hdmi 23 + - items: 24 + - const: allwinner,sun7i-a20-hdmi 25 + - const: allwinner,sun5i-a10s-hdmi 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + interrupts: 31 + maxItems: 1 32 + 33 + clocks: 34 + oneOf: 35 + - items: 36 + - description: The HDMI interface clock 37 + - description: The HDMI module clock 38 + - description: The first video PLL 39 + - description: The second video PLL 40 + 41 + - items: 42 + - description: The HDMI interface clock 43 + - description: The HDMI module clock 44 + - description: The HDMI DDC clock 45 + - description: The first video PLL 46 + - description: The second video PLL 47 + 48 + clock-names: 49 + oneOf: 50 + - items: 51 + - const: ahb 52 + - const: mod 53 + - const: pll-0 54 + - const: pll-1 55 + 56 + - items: 57 + - const: ahb 58 + - const: mod 59 + - const: ddc 60 + - const: pll-0 61 + - const: pll-1 62 + 63 + resets: 64 + maxItems: 1 65 + 66 + dmas: 67 + items: 68 + - description: DDC Transmission DMA Channel 69 + - description: DDC Reception DMA Channel 70 + - description: Audio Transmission DMA Channel 71 + 72 + dma-names: 73 + items: 74 + - const: ddc-tx 75 + - const: ddc-rx 76 + - const: audio-tx 77 + 78 + ports: 79 + type: object 80 + description: | 81 + A ports node with endpoint definitions as defined in 82 + Documentation/devicetree/bindings/media/video-interfaces.txt. 83 + 84 + properties: 85 + "#address-cells": 86 + const: 1 87 + 88 + "#size-cells": 89 + const: 0 90 + 91 + port@0: 92 + type: object 93 + description: | 94 + Input endpoints of the controller. 95 + 96 + port@1: 97 + type: object 98 + description: | 99 + Output endpoints of the controller. Usually an HDMI 100 + connector. 101 + 102 + required: 103 + - "#address-cells" 104 + - "#size-cells" 105 + - port@0 106 + - port@1 107 + 108 + additionalProperties: false 109 + 110 + required: 111 + - compatible 112 + - reg 113 + - interrupts 114 + - clocks 115 + - clock-names 116 + - dmas 117 + - dma-names 118 + 119 + if: 120 + properties: 121 + compatible: 122 + contains: 123 + const: allwinner,sun6i-a31-hdmi 124 + 125 + then: 126 + properties: 127 + clocks: 128 + minItems: 5 129 + 130 + clock-names: 131 + minItems: 5 132 + 133 + required: 134 + - resets 135 + 136 + additionalProperties: false 137 + 138 + examples: 139 + - | 140 + #include <dt-bindings/clock/sun4i-a10-ccu.h> 141 + #include <dt-bindings/dma/sun4i-a10.h> 142 + #include <dt-bindings/reset/sun4i-a10-ccu.h> 143 + 144 + hdmi: hdmi@1c16000 { 145 + compatible = "allwinner,sun4i-a10-hdmi"; 146 + reg = <0x01c16000 0x1000>; 147 + interrupts = <58>; 148 + clocks = <&ccu CLK_AHB_HDMI0>, <&ccu CLK_HDMI>, 149 + <&ccu CLK_PLL_VIDEO0_2X>, 150 + <&ccu CLK_PLL_VIDEO1_2X>; 151 + clock-names = "ahb", "mod", "pll-0", "pll-1"; 152 + dmas = <&dma SUN4I_DMA_NORMAL 16>, 153 + <&dma SUN4I_DMA_NORMAL 16>, 154 + <&dma SUN4I_DMA_DEDICATED 24>; 155 + dma-names = "ddc-tx", "ddc-rx", "audio-tx"; 156 + 157 + ports { 158 + #address-cells = <1>; 159 + #size-cells = <0>; 160 + 161 + hdmi_in: port@0 { 162 + #address-cells = <1>; 163 + #size-cells = <0>; 164 + reg = <0>; 165 + 166 + hdmi_in_tcon0: endpoint@0 { 167 + reg = <0>; 168 + remote-endpoint = <&tcon0_out_hdmi>; 169 + }; 170 + 171 + hdmi_in_tcon1: endpoint@1 { 172 + reg = <1>; 173 + remote-endpoint = <&tcon1_out_hdmi>; 174 + }; 175 + }; 176 + 177 + hdmi_out: port@1 { 178 + reg = <1>; 179 + }; 180 + }; 181 + }; 182 + 183 + ...
+676
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-tcon.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 Timings Controller (TCON) Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The TCON acts as a timing controller for RGB, LVDS and TV 15 + interfaces. 16 + 17 + properties: 18 + "#clock-cells": 19 + const: 0 20 + 21 + compatible: 22 + oneOf: 23 + - const: allwinner,sun4i-a10-tcon 24 + - const: allwinner,sun5i-a13-tcon 25 + - const: allwinner,sun6i-a31-tcon 26 + - const: allwinner,sun6i-a31s-tcon 27 + - const: allwinner,sun7i-a20-tcon 28 + - const: allwinner,sun8i-a23-tcon 29 + - const: allwinner,sun8i-a33-tcon 30 + - const: allwinner,sun8i-a83t-tcon-lcd 31 + - const: allwinner,sun8i-a83t-tcon-tv 32 + - const: allwinner,sun8i-r40-tcon-tv 33 + - const: allwinner,sun8i-v3s-tcon 34 + - const: allwinner,sun9i-a80-tcon-lcd 35 + - const: allwinner,sun9i-a80-tcon-tv 36 + 37 + - items: 38 + - enum: 39 + - allwinner,sun50i-a64-tcon-lcd 40 + - const: allwinner,sun8i-a83t-tcon-lcd 41 + 42 + - items: 43 + - enum: 44 + - allwinner,sun8i-h3-tcon-tv 45 + - allwinner,sun50i-a64-tcon-tv 46 + - allwinner,sun50i-h6-tcon-tv 47 + - const: allwinner,sun8i-a83t-tcon-tv 48 + 49 + reg: 50 + maxItems: 1 51 + 52 + interrupts: 53 + maxItems: 1 54 + 55 + clocks: 56 + minItems: 1 57 + maxItems: 4 58 + 59 + clock-names: 60 + minItems: 1 61 + maxItems: 4 62 + 63 + clock-output-names: 64 + allOf: 65 + - $ref: /schemas/types.yaml#/definitions/string-array 66 + - maxItems: 1 67 + description: 68 + Name of the LCD pixel clock created. 69 + 70 + dmas: 71 + maxItems: 1 72 + 73 + resets: 74 + anyOf: 75 + - items: 76 + - description: TCON Reset Line 77 + 78 + - items: 79 + - description: TCON Reset Line 80 + - description: TCON LVDS Reset Line 81 + 82 + - items: 83 + - description: TCON Reset Line 84 + - description: TCON eDP Reset Line 85 + 86 + - items: 87 + - description: TCON Reset Line 88 + - description: TCON eDP Reset Line 89 + - description: TCON LVDS Reset Line 90 + 91 + reset-names: 92 + oneOf: 93 + - const: lcd 94 + 95 + - items: 96 + - const: lcd 97 + - const: lvds 98 + 99 + - items: 100 + - const: lcd 101 + - const: edp 102 + 103 + - items: 104 + - const: lcd 105 + - const: edp 106 + - const: lvds 107 + 108 + ports: 109 + type: object 110 + description: | 111 + A ports node with endpoint definitions as defined in 112 + Documentation/devicetree/bindings/media/video-interfaces.txt. 113 + 114 + properties: 115 + "#address-cells": 116 + const: 1 117 + 118 + "#size-cells": 119 + const: 0 120 + 121 + port@0: 122 + type: object 123 + description: | 124 + Input endpoints of the controller. 125 + 126 + port@1: 127 + type: object 128 + description: | 129 + Output endpoints of the controller. 130 + 131 + patternProperties: 132 + "^endpoint(@[0-9])$": 133 + type: object 134 + 135 + properties: 136 + allwinner,tcon-channel: 137 + $ref: /schemas/types.yaml#/definitions/uint32 138 + description: | 139 + TCON can have 1 or 2 channels, usually with the 140 + first channel being used for the panels interfaces 141 + (RGB, LVDS, etc.), and the second being used for the 142 + outputs that require another controller (TV Encoder, 143 + HDMI, etc.). 144 + 145 + If that property is present, specifies the TCON 146 + channel the endpoint is associated to. If that 147 + property is not present, the endpoint number will be 148 + used as the channel number. 149 + 150 + unevaluatedProperties: true 151 + 152 + required: 153 + - "#address-cells" 154 + - "#size-cells" 155 + - port@0 156 + - port@1 157 + 158 + additionalProperties: false 159 + 160 + required: 161 + - compatible 162 + - reg 163 + - interrupts 164 + - clocks 165 + - clock-names 166 + - resets 167 + - ports 168 + 169 + additionalProperties: false 170 + 171 + allOf: 172 + - if: 173 + properties: 174 + compatible: 175 + contains: 176 + enum: 177 + - allwinner,sun4i-a10-tcon 178 + - allwinner,sun5i-a13-tcon 179 + - allwinner,sun7i-a20-tcon 180 + 181 + then: 182 + properties: 183 + clocks: 184 + minItems: 3 185 + 186 + clock-names: 187 + items: 188 + - const: ahb 189 + - const: tcon-ch0 190 + - const: tcon-ch1 191 + 192 + - if: 193 + properties: 194 + compatible: 195 + contains: 196 + enum: 197 + - allwinner,sun6i-a31-tcon 198 + - allwinner,sun6i-a31s-tcon 199 + 200 + then: 201 + properties: 202 + clocks: 203 + minItems: 4 204 + 205 + clock-names: 206 + items: 207 + - const: ahb 208 + - const: tcon-ch0 209 + - const: tcon-ch1 210 + - const: lvds-alt 211 + 212 + - if: 213 + properties: 214 + compatible: 215 + contains: 216 + enum: 217 + - allwinner,sun8i-a23-tcon 218 + - allwinner,sun8i-a33-tcon 219 + 220 + then: 221 + properties: 222 + clocks: 223 + minItems: 3 224 + 225 + clock-names: 226 + items: 227 + - const: ahb 228 + - const: tcon-ch0 229 + - const: lvds-alt 230 + 231 + - if: 232 + properties: 233 + compatible: 234 + contains: 235 + enum: 236 + - allwinner,sun8i-a83t-tcon-lcd 237 + - allwinner,sun8i-v3s-tcon 238 + - allwinner,sun9i-a80-tcon-lcd 239 + 240 + then: 241 + properties: 242 + clocks: 243 + minItems: 2 244 + 245 + clock-names: 246 + items: 247 + - const: ahb 248 + - const: tcon-ch0 249 + 250 + - if: 251 + properties: 252 + compatible: 253 + contains: 254 + enum: 255 + - allwinner,sun8i-a83t-tcon-tv 256 + - allwinner,sun8i-r40-tcon-tv 257 + - allwinner,sun9i-a80-tcon-tv 258 + 259 + then: 260 + properties: 261 + clocks: 262 + minItems: 2 263 + 264 + clock-names: 265 + items: 266 + - const: ahb 267 + - const: tcon-ch1 268 + 269 + - if: 270 + properties: 271 + compatible: 272 + contains: 273 + enum: 274 + - allwinner,sun5i-a13-tcon 275 + - allwinner,sun6i-a31-tcon 276 + - allwinner,sun6i-a31s-tcon 277 + - allwinner,sun7i-a20-tcon 278 + - allwinner,sun8i-a23-tcon 279 + - allwinner,sun8i-a33-tcon 280 + - allwinner,sun8i-v3s-tcon 281 + - allwinner,sun9i-a80-tcon-lcd 282 + - allwinner,sun4i-a10-tcon 283 + - allwinner,sun8i-a83t-tcon-lcd 284 + 285 + then: 286 + required: 287 + - "#clock-cells" 288 + - clock-output-names 289 + 290 + - if: 291 + properties: 292 + compatible: 293 + contains: 294 + enum: 295 + - allwinner,sun6i-a31-tcon 296 + - allwinner,sun6i-a31s-tcon 297 + - allwinner,sun8i-a23-tcon 298 + - allwinner,sun8i-a33-tcon 299 + - allwinner,sun8i-a83t-tcon-lcd 300 + 301 + then: 302 + properties: 303 + resets: 304 + minItems: 2 305 + 306 + reset-names: 307 + items: 308 + - const: lcd 309 + - const: lvds 310 + 311 + - if: 312 + properties: 313 + compatible: 314 + contains: 315 + enum: 316 + - allwinner,sun9i-a80-tcon-lcd 317 + 318 + then: 319 + properties: 320 + resets: 321 + minItems: 3 322 + 323 + reset-names: 324 + items: 325 + - const: lcd 326 + - const: edp 327 + - const: lvds 328 + 329 + - if: 330 + properties: 331 + compatible: 332 + contains: 333 + enum: 334 + - allwinner,sun9i-a80-tcon-tv 335 + 336 + then: 337 + properties: 338 + resets: 339 + minItems: 2 340 + 341 + reset-names: 342 + items: 343 + - const: lcd 344 + - const: edp 345 + 346 + - if: 347 + properties: 348 + compatible: 349 + contains: 350 + enum: 351 + - allwinner,sun4i-a10-tcon 352 + - allwinner,sun5i-a13-tcon 353 + - allwinner,sun6i-a31-tcon 354 + - allwinner,sun6i-a31s-tcon 355 + - allwinner,sun7i-a20-tcon 356 + - allwinner,sun8i-a23-tcon 357 + - allwinner,sun8i-a33-tcon 358 + 359 + then: 360 + required: 361 + - dmas 362 + 363 + examples: 364 + - | 365 + #include <dt-bindings/dma/sun4i-a10.h> 366 + 367 + /* 368 + * This comes from the clock/sun4i-a10-ccu.h and 369 + * reset/sun4i-a10-ccu.h headers, but we can't include them since 370 + * it would trigger a bunch of warnings for redefinitions of 371 + * symbols with the other example. 372 + */ 373 + 374 + #define CLK_AHB_LCD0 56 375 + #define CLK_TCON0_CH0 149 376 + #define CLK_TCON0_CH1 155 377 + #define RST_TCON0 11 378 + 379 + lcd-controller@1c0c000 { 380 + compatible = "allwinner,sun4i-a10-tcon"; 381 + reg = <0x01c0c000 0x1000>; 382 + interrupts = <44>; 383 + resets = <&ccu RST_TCON0>; 384 + reset-names = "lcd"; 385 + clocks = <&ccu CLK_AHB_LCD0>, 386 + <&ccu CLK_TCON0_CH0>, 387 + <&ccu CLK_TCON0_CH1>; 388 + clock-names = "ahb", 389 + "tcon-ch0", 390 + "tcon-ch1"; 391 + clock-output-names = "tcon0-pixel-clock"; 392 + #clock-cells = <0>; 393 + dmas = <&dma SUN4I_DMA_DEDICATED 14>; 394 + 395 + ports { 396 + #address-cells = <1>; 397 + #size-cells = <0>; 398 + 399 + port@0 { 400 + #address-cells = <1>; 401 + #size-cells = <0>; 402 + reg = <0>; 403 + 404 + endpoint@0 { 405 + reg = <0>; 406 + remote-endpoint = <&be0_out_tcon0>; 407 + }; 408 + 409 + endpoint@1 { 410 + reg = <1>; 411 + remote-endpoint = <&be1_out_tcon0>; 412 + }; 413 + }; 414 + 415 + port@1 { 416 + #address-cells = <1>; 417 + #size-cells = <0>; 418 + reg = <1>; 419 + 420 + endpoint@1 { 421 + reg = <1>; 422 + remote-endpoint = <&hdmi_in_tcon0>; 423 + allwinner,tcon-channel = <1>; 424 + }; 425 + }; 426 + }; 427 + }; 428 + 429 + #undef CLK_AHB_LCD0 430 + #undef CLK_TCON0_CH0 431 + #undef CLK_TCON0_CH1 432 + #undef RST_TCON0 433 + 434 + - | 435 + #include <dt-bindings/interrupt-controller/arm-gic.h> 436 + 437 + /* 438 + * This comes from the clock/sun6i-a31-ccu.h and 439 + * reset/sun6i-a31-ccu.h headers, but we can't include them since 440 + * it would trigger a bunch of warnings for redefinitions of 441 + * symbols with the other example. 442 + */ 443 + 444 + #define CLK_PLL_MIPI 15 445 + #define CLK_AHB1_LCD0 47 446 + #define CLK_LCD0_CH0 127 447 + #define CLK_LCD0_CH1 129 448 + #define RST_AHB1_LCD0 27 449 + #define RST_AHB1_LVDS 41 450 + 451 + lcd-controller@1c0c000 { 452 + compatible = "allwinner,sun6i-a31-tcon"; 453 + reg = <0x01c0c000 0x1000>; 454 + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; 455 + dmas = <&dma 11>; 456 + resets = <&ccu RST_AHB1_LCD0>, <&ccu RST_AHB1_LVDS>; 457 + reset-names = "lcd", "lvds"; 458 + clocks = <&ccu CLK_AHB1_LCD0>, 459 + <&ccu CLK_LCD0_CH0>, 460 + <&ccu CLK_LCD0_CH1>, 461 + <&ccu CLK_PLL_MIPI>; 462 + clock-names = "ahb", 463 + "tcon-ch0", 464 + "tcon-ch1", 465 + "lvds-alt"; 466 + clock-output-names = "tcon0-pixel-clock"; 467 + #clock-cells = <0>; 468 + 469 + ports { 470 + #address-cells = <1>; 471 + #size-cells = <0>; 472 + 473 + port@0 { 474 + #address-cells = <1>; 475 + #size-cells = <0>; 476 + reg = <0>; 477 + 478 + endpoint@0 { 479 + reg = <0>; 480 + remote-endpoint = <&drc0_out_tcon0>; 481 + }; 482 + 483 + endpoint@1 { 484 + reg = <1>; 485 + remote-endpoint = <&drc1_out_tcon0>; 486 + }; 487 + }; 488 + 489 + port@1 { 490 + #address-cells = <1>; 491 + #size-cells = <0>; 492 + reg = <1>; 493 + 494 + endpoint@1 { 495 + reg = <1>; 496 + remote-endpoint = <&hdmi_in_tcon0>; 497 + allwinner,tcon-channel = <1>; 498 + }; 499 + }; 500 + }; 501 + }; 502 + 503 + #undef CLK_PLL_MIPI 504 + #undef CLK_AHB1_LCD0 505 + #undef CLK_LCD0_CH0 506 + #undef CLK_LCD0_CH1 507 + #undef RST_AHB1_LCD0 508 + #undef RST_AHB1_LVDS 509 + 510 + - | 511 + #include <dt-bindings/interrupt-controller/arm-gic.h> 512 + 513 + /* 514 + * This comes from the clock/sun9i-a80-ccu.h and 515 + * reset/sun9i-a80-ccu.h headers, but we can't include them since 516 + * it would trigger a bunch of warnings for redefinitions of 517 + * symbols with the other example. 518 + */ 519 + 520 + #define CLK_BUS_LCD0 102 521 + #define CLK_LCD0 58 522 + #define RST_BUS_LCD0 22 523 + #define RST_BUS_EDP 24 524 + #define RST_BUS_LVDS 25 525 + 526 + lcd-controller@3c00000 { 527 + compatible = "allwinner,sun9i-a80-tcon-lcd"; 528 + reg = <0x03c00000 0x10000>; 529 + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; 530 + clocks = <&ccu CLK_BUS_LCD0>, <&ccu CLK_LCD0>; 531 + clock-names = "ahb", "tcon-ch0"; 532 + resets = <&ccu RST_BUS_LCD0>, <&ccu RST_BUS_EDP>, <&ccu RST_BUS_LVDS>; 533 + reset-names = "lcd", "edp", "lvds"; 534 + clock-output-names = "tcon0-pixel-clock"; 535 + #clock-cells = <0>; 536 + 537 + ports { 538 + #address-cells = <1>; 539 + #size-cells = <0>; 540 + 541 + port@0 { 542 + reg = <0>; 543 + 544 + endpoint { 545 + remote-endpoint = <&drc0_out_tcon0>; 546 + }; 547 + }; 548 + 549 + port@1 { 550 + reg = <1>; 551 + }; 552 + }; 553 + }; 554 + 555 + #undef CLK_BUS_TCON0 556 + #undef CLK_TCON0 557 + #undef RST_BUS_TCON0 558 + #undef RST_BUS_EDP 559 + #undef RST_BUS_LVDS 560 + 561 + - | 562 + #include <dt-bindings/interrupt-controller/arm-gic.h> 563 + 564 + /* 565 + * This comes from the clock/sun8i-a83t-ccu.h and 566 + * reset/sun8i-a83t-ccu.h headers, but we can't include them since 567 + * it would trigger a bunch of warnings for redefinitions of 568 + * symbols with the other example. 569 + */ 570 + 571 + #define CLK_BUS_TCON0 36 572 + #define CLK_TCON0 85 573 + #define RST_BUS_TCON0 22 574 + #define RST_BUS_LVDS 31 575 + 576 + lcd-controller@1c0c000 { 577 + compatible = "allwinner,sun8i-a83t-tcon-lcd"; 578 + reg = <0x01c0c000 0x1000>; 579 + interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; 580 + clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>; 581 + clock-names = "ahb", "tcon-ch0"; 582 + clock-output-names = "tcon-pixel-clock"; 583 + #clock-cells = <0>; 584 + resets = <&ccu RST_BUS_TCON0>, <&ccu RST_BUS_LVDS>; 585 + reset-names = "lcd", "lvds"; 586 + 587 + ports { 588 + #address-cells = <1>; 589 + #size-cells = <0>; 590 + 591 + port@0 { 592 + #address-cells = <1>; 593 + #size-cells = <0>; 594 + reg = <0>; 595 + 596 + endpoint@0 { 597 + reg = <0>; 598 + remote-endpoint = <&mixer0_out_tcon0>; 599 + }; 600 + 601 + endpoint@1 { 602 + reg = <1>; 603 + remote-endpoint = <&mixer1_out_tcon0>; 604 + }; 605 + }; 606 + 607 + port@1 { 608 + reg = <1>; 609 + }; 610 + }; 611 + }; 612 + 613 + #undef CLK_BUS_TCON0 614 + #undef CLK_TCON0 615 + #undef RST_BUS_TCON0 616 + #undef RST_BUS_LVDS 617 + 618 + - | 619 + #include <dt-bindings/interrupt-controller/arm-gic.h> 620 + 621 + /* 622 + * This comes from the clock/sun8i-r40-ccu.h and 623 + * reset/sun8i-r40-ccu.h headers, but we can't include them since 624 + * it would trigger a bunch of warnings for redefinitions of 625 + * symbols with the other example. 626 + */ 627 + 628 + #define CLK_BUS_TCON_TV0 73 629 + #define RST_BUS_TCON_TV0 49 630 + 631 + tcon_tv0: lcd-controller@1c73000 { 632 + compatible = "allwinner,sun8i-r40-tcon-tv"; 633 + reg = <0x01c73000 0x1000>; 634 + interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>; 635 + clocks = <&ccu CLK_BUS_TCON_TV0>, <&tcon_top 0>; 636 + clock-names = "ahb", "tcon-ch1"; 637 + resets = <&ccu RST_BUS_TCON_TV0>; 638 + reset-names = "lcd"; 639 + 640 + ports { 641 + #address-cells = <1>; 642 + #size-cells = <0>; 643 + 644 + port@0 { 645 + #address-cells = <1>; 646 + #size-cells = <0>; 647 + reg = <0>; 648 + 649 + endpoint@0 { 650 + reg = <0>; 651 + remote-endpoint = <&tcon_top_mixer0_out_tcon_tv0>; 652 + }; 653 + 654 + endpoint@1 { 655 + reg = <1>; 656 + remote-endpoint = <&tcon_top_mixer1_out_tcon_tv0>; 657 + }; 658 + }; 659 + 660 + tcon_tv0_out: port@1 { 661 + #address-cells = <1>; 662 + #size-cells = <0>; 663 + reg = <1>; 664 + 665 + endpoint@1 { 666 + reg = <1>; 667 + remote-endpoint = <&tcon_top_hdmi_in_tcon_tv0>; 668 + }; 669 + }; 670 + }; 671 + }; 672 + 673 + #undef CLK_BUS_TCON_TV0 674 + #undef RST_BUS_TCON_TV0 675 + 676 + ...
+62
Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tv-encoder.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun4i-a10-tv-encoder.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A10 TV Encoder Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + properties: 14 + compatible: 15 + const: allwinner,sun4i-a10-tv-encoder 16 + 17 + reg: 18 + maxItems: 1 19 + 20 + clocks: 21 + maxItems: 1 22 + 23 + resets: 24 + maxItems: 1 25 + 26 + port: 27 + type: object 28 + description: 29 + A port node with endpoint definitions as defined in 30 + Documentation/devicetree/bindings/media/video-interfaces.txt. The 31 + first port should be the input endpoint, usually coming from the 32 + associated TCON. 33 + 34 + required: 35 + - compatible 36 + - reg 37 + - clocks 38 + - resets 39 + - port 40 + 41 + additionalProperties: false 42 + 43 + examples: 44 + - | 45 + tve0: tv-encoder@1c0a000 { 46 + compatible = "allwinner,sun4i-a10-tv-encoder"; 47 + reg = <0x01c0a000 0x1000>; 48 + clocks = <&ahb_gates 34>; 49 + resets = <&tcon_ch0_clk 0>; 50 + 51 + port { 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 + 55 + tve0_in_tcon0: endpoint@0 { 56 + reg = <0>; 57 + remote-endpoint = <&tcon0_out_tve0>; 58 + }; 59 + }; 60 + }; 61 + 62 + ...
+138
Documentation/devicetree/bindings/display/allwinner,sun6i-a31-drc.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun6i-a31-drc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A31 Dynamic Range Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The DRC (Dynamic Range Controller) allows to dynamically adjust 15 + pixel brightness/contrast based on histogram measurements for LCD 16 + content adaptive backlight control. 17 + 18 + properties: 19 + compatible: 20 + enum: 21 + - allwinner,sun6i-a31-drc 22 + - allwinner,sun6i-a31s-drc 23 + - allwinner,sun8i-a23-drc 24 + - allwinner,sun8i-a33-drc 25 + - allwinner,sun9i-a80-drc 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + interrupts: 31 + maxItems: 1 32 + 33 + clocks: 34 + items: 35 + - description: The DRC interface clock 36 + - description: The DRC module clock 37 + - description: The DRC DRAM clock 38 + 39 + clock-names: 40 + items: 41 + - const: ahb 42 + - const: mod 43 + - const: ram 44 + 45 + resets: 46 + maxItems: 1 47 + 48 + ports: 49 + type: object 50 + description: | 51 + A ports node with endpoint definitions as defined in 52 + Documentation/devicetree/bindings/media/video-interfaces.txt. 53 + 54 + properties: 55 + "#address-cells": 56 + const: 1 57 + 58 + "#size-cells": 59 + const: 0 60 + 61 + port@0: 62 + type: object 63 + description: | 64 + Input endpoints of the controller. 65 + 66 + port@1: 67 + type: object 68 + description: | 69 + Output endpoints of the controller. 70 + 71 + required: 72 + - "#address-cells" 73 + - "#size-cells" 74 + - port@0 75 + - port@1 76 + 77 + additionalProperties: false 78 + 79 + required: 80 + - compatible 81 + - reg 82 + - interrupts 83 + - clocks 84 + - clock-names 85 + - resets 86 + - ports 87 + 88 + additionalProperties: false 89 + 90 + examples: 91 + - | 92 + #include <dt-bindings/interrupt-controller/arm-gic.h> 93 + 94 + #include <dt-bindings/clock/sun6i-a31-ccu.h> 95 + #include <dt-bindings/reset/sun6i-a31-ccu.h> 96 + 97 + drc0: drc@1e70000 { 98 + compatible = "allwinner,sun6i-a31-drc"; 99 + reg = <0x01e70000 0x10000>; 100 + interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; 101 + clocks = <&ccu CLK_AHB1_DRC0>, <&ccu CLK_IEP_DRC0>, 102 + <&ccu CLK_DRAM_DRC0>; 103 + clock-names = "ahb", "mod", 104 + "ram"; 105 + resets = <&ccu RST_AHB1_DRC0>; 106 + 107 + ports { 108 + #address-cells = <1>; 109 + #size-cells = <0>; 110 + 111 + drc0_in: port@0 { 112 + reg = <0>; 113 + 114 + drc0_in_be0: endpoint { 115 + remote-endpoint = <&be0_out_drc0>; 116 + }; 117 + }; 118 + 119 + drc0_out: port@1 { 120 + #address-cells = <1>; 121 + #size-cells = <0>; 122 + reg = <1>; 123 + 124 + drc0_out_tcon0: endpoint@0 { 125 + reg = <0>; 126 + remote-endpoint = <&tcon0_in_drc0>; 127 + }; 128 + 129 + drc0_out_tcon1: endpoint@1 { 130 + reg = <1>; 131 + remote-endpoint = <&tcon1_in_drc0>; 132 + }; 133 + }; 134 + }; 135 + }; 136 + 137 + 138 + ...
+118
Documentation/devicetree/bindings/display/allwinner,sun8i-a83t-de2-mixer.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun8i-a83t-de2-mixer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner Display Engine 2.0 Mixer Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - allwinner,sun8i-a83t-de2-mixer-0 17 + - allwinner,sun8i-a83t-de2-mixer-1 18 + - allwinner,sun8i-h3-de2-mixer-0 19 + - allwinner,sun8i-r40-de2-mixer-0 20 + - allwinner,sun8i-r40-de2-mixer-1 21 + - allwinner,sun8i-v3s-de2-mixer 22 + - allwinner,sun50i-a64-de2-mixer-0 23 + - allwinner,sun50i-a64-de2-mixer-1 24 + - allwinner,sun50i-h6-de3-mixer-0 25 + 26 + reg: 27 + maxItems: 1 28 + 29 + clocks: 30 + items: 31 + - description: The mixer interface clock 32 + - description: The mixer module clock 33 + 34 + clock-names: 35 + items: 36 + - const: bus 37 + - const: mod 38 + 39 + resets: 40 + maxItems: 1 41 + 42 + ports: 43 + type: object 44 + description: | 45 + A ports node with endpoint definitions as defined in 46 + Documentation/devicetree/bindings/media/video-interfaces.txt. 47 + 48 + properties: 49 + "#address-cells": 50 + const: 1 51 + 52 + "#size-cells": 53 + const: 0 54 + 55 + port@0: 56 + type: object 57 + description: | 58 + Input endpoints of the controller. 59 + 60 + port@1: 61 + type: object 62 + description: | 63 + Output endpoints of the controller. 64 + 65 + required: 66 + - "#address-cells" 67 + - "#size-cells" 68 + - port@1 69 + 70 + additionalProperties: false 71 + 72 + required: 73 + - compatible 74 + - reg 75 + - clocks 76 + - clock-names 77 + - resets 78 + - ports 79 + 80 + additionalProperties: false 81 + 82 + examples: 83 + - | 84 + #include <dt-bindings/clock/sun8i-de2.h> 85 + #include <dt-bindings/reset/sun8i-de2.h> 86 + 87 + mixer0: mixer@1100000 { 88 + compatible = "allwinner,sun8i-a83t-de2-mixer-0"; 89 + reg = <0x01100000 0x100000>; 90 + clocks = <&display_clocks CLK_BUS_MIXER0>, 91 + <&display_clocks CLK_MIXER0>; 92 + clock-names = "bus", 93 + "mod"; 94 + resets = <&display_clocks RST_MIXER0>; 95 + 96 + ports { 97 + #address-cells = <1>; 98 + #size-cells = <0>; 99 + 100 + mixer0_out: port@1 { 101 + #address-cells = <1>; 102 + #size-cells = <0>; 103 + reg = <1>; 104 + 105 + mixer0_out_tcon0: endpoint@0 { 106 + reg = <0>; 107 + remote-endpoint = <&tcon0_in_mixer0>; 108 + }; 109 + 110 + mixer0_out_tcon1: endpoint@1 { 111 + reg = <1>; 112 + remote-endpoint = <&tcon1_in_mixer0>; 113 + }; 114 + }; 115 + }; 116 + }; 117 + 118 + ...
+273
Documentation/devicetree/bindings/display/allwinner,sun8i-a83t-dw-hdmi.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun8i-a83t-dw-hdmi.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A83t DWC HDMI TX Encoder Device Tree Bindings 8 + 9 + description: | 10 + The HDMI transmitter is a Synopsys DesignWare HDMI 1.4 TX controller 11 + IP with Allwinner\'s own PHY IP. It supports audio and video outputs 12 + and CEC. 13 + 14 + These DT bindings follow the Synopsys DWC HDMI TX bindings defined 15 + in Documentation/devicetree/bindings/display/bridge/dw_hdmi.txt with 16 + the following device-specific properties. 17 + 18 + maintainers: 19 + - Chen-Yu Tsai <wens@csie.org> 20 + - Maxime Ripard <mripard@kernel.org> 21 + 22 + properties: 23 + "#phy-cells": 24 + const: 0 25 + 26 + compatible: 27 + oneOf: 28 + - const: allwinner,sun8i-a83t-dw-hdmi 29 + - const: allwinner,sun50i-h6-dw-hdmi 30 + 31 + - items: 32 + - enum: 33 + - allwinner,sun8i-h3-dw-hdmi 34 + - allwinner,sun8i-r40-dw-hdmi 35 + - allwinner,sun50i-a64-dw-hdmi 36 + - const: allwinner,sun8i-a83t-dw-hdmi 37 + 38 + reg: 39 + maxItems: 1 40 + 41 + reg-io-width: 42 + const: 1 43 + 44 + interrupts: 45 + maxItems: 1 46 + 47 + clocks: 48 + minItems: 3 49 + maxItems: 6 50 + items: 51 + - description: Bus Clock 52 + - description: Register Clock 53 + - description: TMDS Clock 54 + - description: HDMI CEC Clock 55 + - description: HDCP Clock 56 + - description: HDCP Bus Clock 57 + 58 + clock-names: 59 + minItems: 3 60 + maxItems: 6 61 + items: 62 + - const: iahb 63 + - const: isfr 64 + - const: tmds 65 + - const: cec 66 + - const: hdcp 67 + - const: hdcp-bus 68 + 69 + resets: 70 + minItems: 1 71 + maxItems: 2 72 + items: 73 + - description: HDMI Controller Reset 74 + - description: HDCP Reset 75 + 76 + reset-names: 77 + minItems: 1 78 + maxItems: 2 79 + items: 80 + - const: ctrl 81 + - const: hdcp 82 + 83 + phys: 84 + maxItems: 1 85 + description: 86 + Phandle to the DWC HDMI PHY. 87 + 88 + phy-names: 89 + const: phy 90 + 91 + hvcc-supply: 92 + description: 93 + The VCC power supply of the controller 94 + 95 + ports: 96 + type: object 97 + description: | 98 + A ports node with endpoint definitions as defined in 99 + Documentation/devicetree/bindings/media/video-interfaces.txt. 100 + 101 + properties: 102 + "#address-cells": 103 + const: 1 104 + 105 + "#size-cells": 106 + const: 0 107 + 108 + port@0: 109 + type: object 110 + description: | 111 + Input endpoints of the controller. Usually the associated 112 + TCON. 113 + 114 + port@1: 115 + type: object 116 + description: | 117 + Output endpoints of the controller. Usually an HDMI 118 + connector. 119 + 120 + required: 121 + - "#address-cells" 122 + - "#size-cells" 123 + - port@0 124 + - port@1 125 + 126 + additionalProperties: false 127 + 128 + required: 129 + - compatible 130 + - reg 131 + - reg-io-width 132 + - interrupts 133 + - clocks 134 + - clock-names 135 + - resets 136 + - reset-names 137 + - phys 138 + - phy-names 139 + - ports 140 + 141 + if: 142 + properties: 143 + compatible: 144 + contains: 145 + enum: 146 + - allwinner,sun50i-h6-dw-hdmi 147 + 148 + then: 149 + properties: 150 + clocks: 151 + minItems: 6 152 + 153 + clock-names: 154 + minItems: 6 155 + 156 + resets: 157 + minItems: 2 158 + 159 + reset-names: 160 + minItems: 2 161 + 162 + 163 + additionalProperties: false 164 + 165 + examples: 166 + - | 167 + #include <dt-bindings/interrupt-controller/arm-gic.h> 168 + 169 + /* 170 + * This comes from the clock/sun8i-a83t-ccu.h and 171 + * reset/sun8i-a83t-ccu.h headers, but we can't include them since 172 + * it would trigger a bunch of warnings for redefinitions of 173 + * symbols with the other example. 174 + */ 175 + #define CLK_BUS_HDMI 39 176 + #define CLK_HDMI 93 177 + #define CLK_HDMI_SLOW 94 178 + #define RST_BUS_HDMI1 26 179 + 180 + hdmi@1ee0000 { 181 + compatible = "allwinner,sun8i-a83t-dw-hdmi"; 182 + reg = <0x01ee0000 0x10000>; 183 + reg-io-width = <1>; 184 + interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>; 185 + clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>, 186 + <&ccu CLK_HDMI>; 187 + clock-names = "iahb", "isfr", "tmds"; 188 + resets = <&ccu RST_BUS_HDMI1>; 189 + reset-names = "ctrl"; 190 + phys = <&hdmi_phy>; 191 + phy-names = "phy"; 192 + pinctrl-names = "default"; 193 + pinctrl-0 = <&hdmi_pins>; 194 + status = "disabled"; 195 + 196 + ports { 197 + #address-cells = <1>; 198 + #size-cells = <0>; 199 + 200 + port@0 { 201 + reg = <0>; 202 + 203 + endpoint { 204 + remote-endpoint = <&tcon1_out_hdmi>; 205 + }; 206 + }; 207 + 208 + port@1 { 209 + reg = <1>; 210 + }; 211 + }; 212 + }; 213 + 214 + /* Cleanup after ourselves */ 215 + #undef CLK_BUS_HDMI 216 + #undef CLK_HDMI 217 + #undef CLK_HDMI_SLOW 218 + 219 + - | 220 + #include <dt-bindings/interrupt-controller/arm-gic.h> 221 + 222 + /* 223 + * This comes from the clock/sun50i-h6-ccu.h and 224 + * reset/sun50i-h6-ccu.h headers, but we can't include them since 225 + * it would trigger a bunch of warnings for redefinitions of 226 + * symbols with the other example. 227 + */ 228 + #define CLK_BUS_HDMI 126 229 + #define CLK_BUS_HDCP 137 230 + #define CLK_HDMI 123 231 + #define CLK_HDMI_SLOW 124 232 + #define CLK_HDMI_CEC 125 233 + #define CLK_HDCP 136 234 + #define RST_BUS_HDMI_SUB 57 235 + #define RST_BUS_HDCP 62 236 + 237 + hdmi@6000000 { 238 + compatible = "allwinner,sun50i-h6-dw-hdmi"; 239 + reg = <0x06000000 0x10000>; 240 + reg-io-width = <1>; 241 + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; 242 + clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>, 243 + <&ccu CLK_HDMI>, <&ccu CLK_HDMI_CEC>, 244 + <&ccu CLK_HDCP>, <&ccu CLK_BUS_HDCP>; 245 + clock-names = "iahb", "isfr", "tmds", "cec", "hdcp", 246 + "hdcp-bus"; 247 + resets = <&ccu RST_BUS_HDMI_SUB>, <&ccu RST_BUS_HDCP>; 248 + reset-names = "ctrl", "hdcp"; 249 + phys = <&hdmi_phy>; 250 + phy-names = "phy"; 251 + pinctrl-names = "default"; 252 + pinctrl-0 = <&hdmi_pins>; 253 + status = "disabled"; 254 + 255 + ports { 256 + #address-cells = <1>; 257 + #size-cells = <0>; 258 + 259 + port@0 { 260 + reg = <0>; 261 + 262 + endpoint { 263 + remote-endpoint = <&tcon_top_hdmi_out_hdmi>; 264 + }; 265 + }; 266 + 267 + port@1 { 268 + reg = <1>; 269 + }; 270 + }; 271 + }; 272 + 273 + ...
+117
Documentation/devicetree/bindings/display/allwinner,sun8i-a83t-hdmi-phy.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun8i-a83t-hdmi-phy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A83t HDMI PHY Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + properties: 14 + "#phy-cells": 15 + const: 0 16 + 17 + compatible: 18 + enum: 19 + - allwinner,sun8i-a83t-hdmi-phy 20 + - allwinner,sun8i-h3-hdmi-phy 21 + - allwinner,sun8i-r40-hdmi-phy 22 + - allwinner,sun50i-a64-hdmi-phy 23 + - allwinner,sun50i-h6-hdmi-phy 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + clocks: 29 + minItems: 2 30 + maxItems: 4 31 + items: 32 + - description: Bus Clock 33 + - description: Module Clock 34 + - description: Parent of the PHY clock 35 + - description: Second possible parent of the PHY clock 36 + 37 + clock-names: 38 + minItems: 2 39 + maxItems: 4 40 + items: 41 + - const: bus 42 + - const: mod 43 + - const: pll-0 44 + - const: pll-1 45 + 46 + resets: 47 + maxItems: 1 48 + 49 + reset-names: 50 + const: phy 51 + 52 + required: 53 + - compatible 54 + - reg 55 + - clocks 56 + - clock-names 57 + - resets 58 + - reset-names 59 + 60 + if: 61 + properties: 62 + compatible: 63 + contains: 64 + enum: 65 + - allwinner,sun8i-r40-hdmi-phy 66 + 67 + then: 68 + properties: 69 + clocks: 70 + minItems: 4 71 + 72 + clock-names: 73 + minItems: 4 74 + 75 + else: 76 + if: 77 + properties: 78 + compatible: 79 + contains: 80 + enum: 81 + - allwinner,sun8i-h3-hdmi-phy 82 + - allwinner,sun50i-a64-hdmi-phy 83 + 84 + then: 85 + properties: 86 + clocks: 87 + minItems: 3 88 + 89 + clock-names: 90 + minItems: 3 91 + 92 + else: 93 + properties: 94 + clocks: 95 + maxItems: 2 96 + 97 + clock-names: 98 + maxItems: 2 99 + 100 + additionalProperties: false 101 + 102 + examples: 103 + - | 104 + #include <dt-bindings/clock/sun8i-a83t-ccu.h> 105 + #include <dt-bindings/reset/sun8i-a83t-ccu.h> 106 + 107 + hdmi_phy: hdmi-phy@1ef0000 { 108 + compatible = "allwinner,sun8i-a83t-hdmi-phy"; 109 + reg = <0x01ef0000 0x10000>; 110 + clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_SLOW>; 111 + clock-names = "bus", "mod"; 112 + resets = <&ccu RST_BUS_HDMI0>; 113 + reset-names = "phy"; 114 + #phy-cells = <0>; 115 + }; 116 + 117 + ...
+382
Documentation/devicetree/bindings/display/allwinner,sun8i-r40-tcon-top.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun8i-r40-tcon-top.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner R40 TCON TOP Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + TCON TOPs main purpose is to configure whole display pipeline. It 15 + determines relationships between mixers and TCONs, selects source 16 + TCON for HDMI, muxes LCD and TV encoder GPIO output, selects TV 17 + encoder clock source and contains additional TV TCON and DSI gates. 18 + 19 + It allows display pipeline to be configured in very different ways: 20 + 21 + / LCD0/LVDS0 22 + / [0] TCON-LCD0 23 + | \ MIPI DSI 24 + mixer0 | 25 + \ / [1] TCON-LCD1 - LCD1/LVDS1 26 + TCON-TOP 27 + / \ [2] TCON-TV0 [0] - TVE0/RGB 28 + mixer1 | \ 29 + | TCON-TOP - HDMI 30 + | / 31 + \ [3] TCON-TV1 [1] - TVE1/RGB 32 + 33 + Note that both TCON TOP references same physical unit. Both mixers 34 + can be connected to any TCON. Not all TCON TOP variants support all 35 + features. 36 + 37 + properties: 38 + "#clock-cells": 39 + const: 1 40 + 41 + compatible: 42 + enum: 43 + - allwinner,sun8i-r40-tcon-top 44 + - allwinner,sun50i-h6-tcon-top 45 + 46 + reg: 47 + maxItems: 1 48 + 49 + clocks: 50 + minItems: 2 51 + maxItems: 6 52 + items: 53 + - description: The TCON TOP interface clock 54 + - description: The TCON TOP TV0 clock 55 + - description: The TCON TOP TVE0 clock 56 + - description: The TCON TOP TV1 clock 57 + - description: The TCON TOP TVE1 clock 58 + - description: The TCON TOP MIPI DSI clock 59 + 60 + clock-names: 61 + minItems: 2 62 + maxItems: 6 63 + items: 64 + - const: bus 65 + - const: tcon-tv0 66 + - const: tve0 67 + - const: tcon-tv1 68 + - const: tve1 69 + - const: dsi 70 + 71 + clock-output-names: 72 + minItems: 1 73 + maxItems: 3 74 + description: > 75 + The first item is the name of the clock created for the TV0 76 + channel, the second item is the name of the TCON TV1 channel 77 + clock and the third one is the name of the DSI channel clock. 78 + 79 + resets: 80 + maxItems: 1 81 + 82 + ports: 83 + type: object 84 + description: | 85 + A ports node with endpoint definitions as defined in 86 + Documentation/devicetree/bindings/media/video-interfaces.txt. 87 + All ports should have only one endpoint connected to 88 + remote endpoint. 89 + 90 + properties: 91 + "#address-cells": 92 + const: 1 93 + 94 + "#size-cells": 95 + const: 0 96 + 97 + port@0: 98 + type: object 99 + description: | 100 + Input endpoint for Mixer 0 mux. 101 + 102 + port@1: 103 + type: object 104 + description: | 105 + Output endpoint for Mixer 0 mux 106 + 107 + properties: 108 + "#address-cells": 109 + const: 1 110 + 111 + "#size-cells": 112 + const: 0 113 + 114 + reg: true 115 + 116 + patternProperties: 117 + "^endpoint@[0-9]$": 118 + type: object 119 + 120 + properties: 121 + reg: 122 + description: | 123 + ID of the target TCON 124 + 125 + required: 126 + - reg 127 + 128 + required: 129 + - "#address-cells" 130 + - "#size-cells" 131 + 132 + additionalProperties: false 133 + 134 + port@2: 135 + type: object 136 + description: | 137 + Input endpoint for Mixer 1 mux. 138 + 139 + port@3: 140 + type: object 141 + description: | 142 + Output endpoint for Mixer 1 mux 143 + 144 + properties: 145 + "#address-cells": 146 + const: 1 147 + 148 + "#size-cells": 149 + const: 0 150 + 151 + reg: true 152 + 153 + patternProperties: 154 + "^endpoint@[0-9]$": 155 + type: object 156 + 157 + properties: 158 + reg: 159 + description: | 160 + ID of the target TCON 161 + 162 + required: 163 + - reg 164 + 165 + required: 166 + - "#address-cells" 167 + - "#size-cells" 168 + 169 + additionalProperties: false 170 + 171 + port@4: 172 + type: object 173 + description: | 174 + Input endpoint for HDMI mux. 175 + 176 + properties: 177 + "#address-cells": 178 + const: 1 179 + 180 + "#size-cells": 181 + const: 0 182 + 183 + reg: true 184 + 185 + patternProperties: 186 + "^endpoint@[0-9]$": 187 + type: object 188 + 189 + properties: 190 + reg: 191 + description: | 192 + ID of the target TCON 193 + 194 + required: 195 + - reg 196 + 197 + required: 198 + - "#address-cells" 199 + - "#size-cells" 200 + 201 + additionalProperties: false 202 + 203 + port@5: 204 + type: object 205 + description: | 206 + Output endpoint for HDMI mux 207 + 208 + required: 209 + - "#address-cells" 210 + - "#size-cells" 211 + - port@0 212 + - port@1 213 + - port@4 214 + - port@5 215 + 216 + additionalProperties: false 217 + 218 + required: 219 + - "#clock-cells" 220 + - compatible 221 + - reg 222 + - clocks 223 + - clock-names 224 + - clock-output-names 225 + - resets 226 + - ports 227 + 228 + additionalProperties: false 229 + 230 + if: 231 + properties: 232 + compatible: 233 + contains: 234 + const: allwinner,sun50i-h6-tcon-top 235 + 236 + then: 237 + properties: 238 + clocks: 239 + maxItems: 2 240 + 241 + clock-output-names: 242 + maxItems: 1 243 + 244 + else: 245 + properties: 246 + clocks: 247 + minItems: 6 248 + 249 + clock-output-names: 250 + minItems: 3 251 + 252 + ports: 253 + required: 254 + - port@2 255 + - port@3 256 + 257 + examples: 258 + - | 259 + #include <dt-bindings/interrupt-controller/arm-gic.h> 260 + 261 + #include <dt-bindings/clock/sun8i-r40-ccu.h> 262 + #include <dt-bindings/reset/sun8i-r40-ccu.h> 263 + 264 + tcon_top: tcon-top@1c70000 { 265 + compatible = "allwinner,sun8i-r40-tcon-top"; 266 + reg = <0x01c70000 0x1000>; 267 + clocks = <&ccu CLK_BUS_TCON_TOP>, 268 + <&ccu CLK_TCON_TV0>, 269 + <&ccu CLK_TVE0>, 270 + <&ccu CLK_TCON_TV1>, 271 + <&ccu CLK_TVE1>, 272 + <&ccu CLK_DSI_DPHY>; 273 + clock-names = "bus", 274 + "tcon-tv0", 275 + "tve0", 276 + "tcon-tv1", 277 + "tve1", 278 + "dsi"; 279 + clock-output-names = "tcon-top-tv0", 280 + "tcon-top-tv1", 281 + "tcon-top-dsi"; 282 + resets = <&ccu RST_BUS_TCON_TOP>; 283 + #clock-cells = <1>; 284 + 285 + ports { 286 + #address-cells = <1>; 287 + #size-cells = <0>; 288 + 289 + tcon_top_mixer0_in: port@0 { 290 + reg = <0>; 291 + 292 + tcon_top_mixer0_in_mixer0: endpoint { 293 + remote-endpoint = <&mixer0_out_tcon_top>; 294 + }; 295 + }; 296 + 297 + tcon_top_mixer0_out: port@1 { 298 + #address-cells = <1>; 299 + #size-cells = <0>; 300 + reg = <1>; 301 + 302 + tcon_top_mixer0_out_tcon_lcd0: endpoint@0 { 303 + reg = <0>; 304 + }; 305 + 306 + tcon_top_mixer0_out_tcon_lcd1: endpoint@1 { 307 + reg = <1>; 308 + }; 309 + 310 + tcon_top_mixer0_out_tcon_tv0: endpoint@2 { 311 + reg = <2>; 312 + remote-endpoint = <&tcon_tv0_in_tcon_top_mixer0>; 313 + }; 314 + 315 + tcon_top_mixer0_out_tcon_tv1: endpoint@3 { 316 + reg = <3>; 317 + remote-endpoint = <&tcon_tv1_in_tcon_top_mixer0>; 318 + }; 319 + }; 320 + 321 + tcon_top_mixer1_in: port@2 { 322 + #address-cells = <1>; 323 + #size-cells = <0>; 324 + reg = <2>; 325 + 326 + tcon_top_mixer1_in_mixer1: endpoint@1 { 327 + reg = <1>; 328 + remote-endpoint = <&mixer1_out_tcon_top>; 329 + }; 330 + }; 331 + 332 + tcon_top_mixer1_out: port@3 { 333 + #address-cells = <1>; 334 + #size-cells = <0>; 335 + reg = <3>; 336 + 337 + tcon_top_mixer1_out_tcon_lcd0: endpoint@0 { 338 + reg = <0>; 339 + }; 340 + 341 + tcon_top_mixer1_out_tcon_lcd1: endpoint@1 { 342 + reg = <1>; 343 + }; 344 + 345 + tcon_top_mixer1_out_tcon_tv0: endpoint@2 { 346 + reg = <2>; 347 + remote-endpoint = <&tcon_tv0_in_tcon_top_mixer1>; 348 + }; 349 + 350 + tcon_top_mixer1_out_tcon_tv1: endpoint@3 { 351 + reg = <3>; 352 + remote-endpoint = <&tcon_tv1_in_tcon_top_mixer1>; 353 + }; 354 + }; 355 + 356 + tcon_top_hdmi_in: port@4 { 357 + #address-cells = <1>; 358 + #size-cells = <0>; 359 + reg = <4>; 360 + 361 + tcon_top_hdmi_in_tcon_tv0: endpoint@0 { 362 + reg = <0>; 363 + remote-endpoint = <&tcon_tv0_out_tcon_top>; 364 + }; 365 + 366 + tcon_top_hdmi_in_tcon_tv1: endpoint@1 { 367 + reg = <1>; 368 + remote-endpoint = <&tcon_tv1_out_tcon_top>; 369 + }; 370 + }; 371 + 372 + tcon_top_hdmi_out: port@5 { 373 + reg = <5>; 374 + 375 + tcon_top_hdmi_out_hdmi: endpoint { 376 + remote-endpoint = <&hdmi_in_tcon_top>; 377 + }; 378 + }; 379 + }; 380 + }; 381 + 382 + ...
+133
Documentation/devicetree/bindings/display/allwinner,sun9i-a80-deu.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/allwinner,sun9i-a80-deu.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Allwinner A80 Detail Enhancement Unit Device Tree Bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + - Maxime Ripard <mripard@kernel.org> 12 + 13 + description: | 14 + The DEU (Detail Enhancement Unit), found in the Allwinner A80 SoC, 15 + can sharpen the display content in both luma and chroma channels. 16 + 17 + properties: 18 + compatible: 19 + const: allwinner,sun9i-a80-deu 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + clocks: 28 + items: 29 + - description: The DEU interface clock 30 + - description: The DEU module clock 31 + - description: The DEU DRAM clock 32 + 33 + clock-names: 34 + items: 35 + - const: ahb 36 + - const: mod 37 + - const: ram 38 + 39 + resets: 40 + maxItems: 1 41 + 42 + ports: 43 + type: object 44 + description: | 45 + A ports node with endpoint definitions as defined in 46 + Documentation/devicetree/bindings/media/video-interfaces.txt. 47 + 48 + properties: 49 + "#address-cells": 50 + const: 1 51 + 52 + "#size-cells": 53 + const: 0 54 + 55 + port@0: 56 + type: object 57 + description: | 58 + Input endpoints of the controller. 59 + 60 + port@1: 61 + type: object 62 + description: | 63 + Output endpoints of the controller. 64 + 65 + required: 66 + - "#address-cells" 67 + - "#size-cells" 68 + - port@0 69 + - port@1 70 + 71 + additionalProperties: false 72 + 73 + required: 74 + - compatible 75 + - reg 76 + - interrupts 77 + - clocks 78 + - clock-names 79 + - resets 80 + - ports 81 + 82 + additionalProperties: false 83 + 84 + examples: 85 + - | 86 + #include <dt-bindings/interrupt-controller/arm-gic.h> 87 + 88 + #include <dt-bindings/clock/sun9i-a80-de.h> 89 + #include <dt-bindings/reset/sun9i-a80-de.h> 90 + 91 + deu0: deu@3300000 { 92 + compatible = "allwinner,sun9i-a80-deu"; 93 + reg = <0x03300000 0x40000>; 94 + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; 95 + clocks = <&de_clocks CLK_BUS_DEU0>, 96 + <&de_clocks CLK_IEP_DEU0>, 97 + <&de_clocks CLK_DRAM_DEU0>; 98 + clock-names = "ahb", 99 + "mod", 100 + "ram"; 101 + resets = <&de_clocks RST_DEU0>; 102 + 103 + ports { 104 + #address-cells = <1>; 105 + #size-cells = <0>; 106 + 107 + deu0_in: port@0 { 108 + reg = <0>; 109 + 110 + deu0_in_fe0: endpoint { 111 + remote-endpoint = <&fe0_out_deu0>; 112 + }; 113 + }; 114 + 115 + deu0_out: port@1 { 116 + #address-cells = <1>; 117 + #size-cells = <0>; 118 + reg = <1>; 119 + 120 + deu0_out_be0: endpoint@0 { 121 + reg = <0>; 122 + remote-endpoint = <&be0_in_deu0>; 123 + }; 124 + 125 + deu0_out_be1: endpoint@1 { 126 + reg = <1>; 127 + remote-endpoint = <&be1_in_deu0>; 128 + }; 129 + }; 130 + }; 131 + }; 132 + 133 + ...
-42
Documentation/devicetree/bindings/display/panel/ampire,am-480272h3tmqw-t01h.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/display/panel/ampire,am-480272h3tmqw-t01h.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Ampire AM-480272H3TMQW-T01H 4.3" WQVGA TFT LCD panel 8 - 9 - maintainers: 10 - - Yannick Fertre <yannick.fertre@st.com> 11 - - Thierry Reding <treding@nvidia.com> 12 - 13 - allOf: 14 - - $ref: panel-common.yaml# 15 - 16 - properties: 17 - compatible: 18 - const: ampire,am-480272h3tmqw-t01h 19 - 20 - power-supply: true 21 - enable-gpios: true 22 - backlight: true 23 - port: true 24 - 25 - required: 26 - - compatible 27 - 28 - additionalProperties: false 29 - 30 - examples: 31 - - | 32 - panel_rgb: panel { 33 - compatible = "ampire,am-480272h3tmqw-t01h"; 34 - enable-gpios = <&gpioa 8 1>; 35 - port { 36 - panel_in_rgb: endpoint { 37 - remote-endpoint = <&controller_out_rgb>; 38 - }; 39 - }; 40 - }; 41 - 42 - ...
-7
Documentation/devicetree/bindings/display/panel/ampire,am800480r3tmqwa1h.txt
··· 1 - Ampire AM-800480R3TMQW-A1H 7.0" WVGA TFT LCD panel 2 - 3 - Required properties: 4 - - compatible: should be "ampire,am800480r3tmqwa1h" 5 - 6 - This binding is compatible with the simple-panel binding, which is specified 7 - in simple-panel.txt in this directory.
-12
Documentation/devicetree/bindings/display/panel/giantplus,gpm940b0.txt
··· 1 - GiantPlus 3.0" (320x240 pixels) 24-bit TFT LCD panel 2 - 3 - Required properties: 4 - - compatible: should be "giantplus,gpm940b0" 5 - - power-supply: as specified in the base binding 6 - 7 - Optional properties: 8 - - backlight: as specified in the base binding 9 - - enable-gpios: as specified in the base binding 10 - 11 - This binding is compatible with the simple-panel binding, which is specified 12 - in simple-panel.txt in this directory.
+69
Documentation/devicetree/bindings/display/panel/panel-simple.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/panel/panel-simple.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Simple panels with one power supply 8 + 9 + maintainers: 10 + - Thierry Reding <thierry.reding@gmail.com> 11 + - Sam Ravnborg <sam@ravnborg.org> 12 + 13 + description: | 14 + This binding file is a collection of the simple (dumb) panels that 15 + requires only a single power-supply. 16 + There are optionally a backlight and an enable GPIO. 17 + The panel may use an OF graph binding for the association to the display, 18 + or it may be a direct child node of the display. 19 + 20 + If the panel is more advanced a dedicated binding file is required. 21 + 22 + allOf: 23 + - $ref: panel-common.yaml# 24 + 25 + properties: 26 + 27 + compatible: 28 + enum: 29 + # compatible must be listed in alphabetical order, ordered by compatible. 30 + # The description in the comment is mandatory for each compatible. 31 + 32 + # Ampire AM-480272H3TMQW-T01H 4.3" WQVGA TFT LCD panel 33 + - ampire,am-480272h3tmqw-t01h 34 + # Ampire AM-800480R3TMQW-A1H 7.0" WVGA TFT LCD panel 35 + - ampire,am800480r3tmqwa1h 36 + # AUO B116XAK01 eDP TFT LCD panel 37 + - auo,b116xa01 38 + # BOE NV140FHM-N49 14.0" FHD a-Si FT panel 39 + - boe,nv140fhmn49 40 + # GiantPlus GPM940B0 3.0" QVGA TFT LCD panel 41 + - giantplus,gpm940b0 42 + # Satoz SAT050AT40H12R2 5.0" WVGA TFT LCD panel 43 + - satoz,sat050at40h12r2 44 + # Sharp LS020B1DD01D 2.0" HQVGA TFT LCD panel 45 + - sharp,ls020b1dd01d 46 + 47 + backlight: true 48 + enable-gpios: true 49 + port: true 50 + power-supply: true 51 + 52 + additionalProperties: false 53 + 54 + required: 55 + - compatible 56 + - power-supply 57 + 58 + examples: 59 + - | 60 + panel_rgb: panel-rgb { 61 + compatible = "ampire,am-480272h3tmqw-t01h"; 62 + power-supply = <&vcc_lcd_reg>; 63 + 64 + port { 65 + panel_in_rgb: endpoint { 66 + remote-endpoint = <&ltdc_out_rgb>; 67 + }; 68 + }; 69 + };
-12
Documentation/devicetree/bindings/display/panel/sharp,ls020b1dd01d.txt
··· 1 - Sharp 2.0" (240x160 pixels) 16-bit TFT LCD panel 2 - 3 - Required properties: 4 - - compatible: should be "sharp,ls020b1dd01d" 5 - - power-supply: as specified in the base binding 6 - 7 - Optional properties: 8 - - backlight: as specified in the base binding 9 - - enable-gpios: as specified in the base binding 10 - 11 - This binding is compatible with the simple-panel binding, which is specified 12 - in simple-panel.txt in this directory.
-637
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
··· 1 - Allwinner A10 Display Pipeline 2 - ============================== 3 - 4 - The Allwinner A10 Display pipeline is composed of several components 5 - that are going to be documented below: 6 - 7 - For all connections between components up to the TCONs in the display 8 - pipeline, when there are multiple components of the same type at the 9 - same depth, the local endpoint ID must be the same as the remote 10 - component's index. For example, if the remote endpoint is Frontend 1, 11 - then the local endpoint ID must be 1. 12 - 13 - Frontend 0 [0] ------- [0] Backend 0 [0] ------- [0] TCON 0 14 - [1] -- -- [1] [1] -- -- [1] 15 - \ / \ / 16 - X X 17 - / \ / \ 18 - [0] -- -- [0] [0] -- -- [0] 19 - Frontend 1 [1] ------- [1] Backend 1 [1] ------- [1] TCON 1 20 - 21 - For a two pipeline system such as the one depicted above, the lines 22 - represent the connections between the components, while the numbers 23 - within the square brackets corresponds to the ID of the local endpoint. 24 - 25 - The same rule also applies to DE 2.0 mixer-TCON connections: 26 - 27 - Mixer 0 [0] ----------- [0] TCON 0 28 - [1] ---- ---- [1] 29 - \ / 30 - X 31 - / \ 32 - [0] ---- ---- [0] 33 - Mixer 1 [1] ----------- [1] TCON 1 34 - 35 - HDMI Encoder 36 - ------------ 37 - 38 - The HDMI Encoder supports the HDMI video and audio outputs, and does 39 - CEC. It is one end of the pipeline. 40 - 41 - Required properties: 42 - - compatible: value must be one of: 43 - * allwinner,sun4i-a10-hdmi 44 - * allwinner,sun5i-a10s-hdmi 45 - * allwinner,sun6i-a31-hdmi 46 - - reg: base address and size of memory-mapped region 47 - - interrupts: interrupt associated to this IP 48 - - clocks: phandles to the clocks feeding the HDMI encoder 49 - * ahb: the HDMI interface clock 50 - * mod: the HDMI module clock 51 - * ddc: the HDMI ddc clock (A31 only) 52 - * pll-0: the first video PLL 53 - * pll-1: the second video PLL 54 - - clock-names: the clock names mentioned above 55 - - resets: phandle to the reset control for the HDMI encoder (A31 only) 56 - - dmas: phandles to the DMA channels used by the HDMI encoder 57 - * ddc-tx: The channel for DDC transmission 58 - * ddc-rx: The channel for DDC reception 59 - * audio-tx: The channel used for audio transmission 60 - - dma-names: the channel names mentioned above 61 - 62 - - ports: A ports node with endpoint definitions as defined in 63 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 64 - first port should be the input endpoint. The second should be the 65 - output, usually to an HDMI connector. 66 - 67 - DWC HDMI TX Encoder 68 - ------------------- 69 - 70 - The HDMI transmitter is a Synopsys DesignWare HDMI 1.4 TX controller IP 71 - with Allwinner's own PHY IP. It supports audio and video outputs and CEC. 72 - 73 - These DT bindings follow the Synopsys DWC HDMI TX bindings defined in 74 - Documentation/devicetree/bindings/display/bridge/dw_hdmi.txt with the 75 - following device-specific properties. 76 - 77 - Required properties: 78 - 79 - - compatible: value must be one of: 80 - * "allwinner,sun8i-a83t-dw-hdmi" 81 - * "allwinner,sun50i-a64-dw-hdmi", "allwinner,sun8i-a83t-dw-hdmi" 82 - * "allwinner,sun50i-h6-dw-hdmi" 83 - - reg: base address and size of memory-mapped region 84 - - reg-io-width: See dw_hdmi.txt. Shall be 1. 85 - - interrupts: HDMI interrupt number 86 - - clocks: phandles to the clocks feeding the HDMI encoder 87 - * iahb: the HDMI bus clock 88 - * isfr: the HDMI register clock 89 - * tmds: TMDS clock 90 - * cec: HDMI CEC clock (H6 only) 91 - * hdcp: HDCP clock (H6 only) 92 - * hdcp-bus: HDCP bus clock (H6 only) 93 - - clock-names: the clock names mentioned above 94 - - resets: 95 - * ctrl: HDMI controller reset 96 - * hdcp: HDCP reset (H6 only) 97 - - reset-names: reset names mentioned above 98 - - phys: phandle to the DWC HDMI PHY 99 - - phy-names: must be "phy" 100 - 101 - - ports: A ports node with endpoint definitions as defined in 102 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 103 - first port should be the input endpoint. The second should be the 104 - output, usually to an HDMI connector. 105 - 106 - Optional properties: 107 - - hvcc-supply: the VCC power supply of the controller 108 - 109 - DWC HDMI PHY 110 - ------------ 111 - 112 - Required properties: 113 - - compatible: value must be one of: 114 - * allwinner,sun8i-a83t-hdmi-phy 115 - * allwinner,sun8i-h3-hdmi-phy 116 - * allwinner,sun8i-r40-hdmi-phy 117 - * allwinner,sun50i-a64-hdmi-phy 118 - * allwinner,sun50i-h6-hdmi-phy 119 - - reg: base address and size of memory-mapped region 120 - - clocks: phandles to the clocks feeding the HDMI PHY 121 - * bus: the HDMI PHY interface clock 122 - * mod: the HDMI PHY module clock 123 - - clock-names: the clock names mentioned above 124 - - resets: phandle to the reset controller driving the PHY 125 - - reset-names: must be "phy" 126 - 127 - H3, A64 and R40 HDMI PHY require additional clocks: 128 - - pll-0: parent of phy clock 129 - - pll-1: second possible phy clock parent (A64/R40 only) 130 - 131 - TV Encoder 132 - ---------- 133 - 134 - The TV Encoder supports the composite and VGA output. It is one end of 135 - the pipeline. 136 - 137 - Required properties: 138 - - compatible: value should be "allwinner,sun4i-a10-tv-encoder". 139 - - reg: base address and size of memory-mapped region 140 - - clocks: the clocks driving the TV encoder 141 - - resets: phandle to the reset controller driving the encoder 142 - 143 - - ports: A ports node with endpoint definitions as defined in 144 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 145 - first port should be the input endpoint. 146 - 147 - TCON 148 - ---- 149 - 150 - The TCON acts as a timing controller for RGB, LVDS and TV interfaces. 151 - 152 - Required properties: 153 - - compatible: value must be either: 154 - * allwinner,sun4i-a10-tcon 155 - * allwinner,sun5i-a13-tcon 156 - * allwinner,sun6i-a31-tcon 157 - * allwinner,sun6i-a31s-tcon 158 - * allwinner,sun7i-a20-tcon 159 - * allwinner,sun8i-a23-tcon 160 - * allwinner,sun8i-a33-tcon 161 - * allwinner,sun8i-a83t-tcon-lcd 162 - * allwinner,sun8i-a83t-tcon-tv 163 - * allwinner,sun8i-r40-tcon-tv 164 - * allwinner,sun8i-v3s-tcon 165 - * allwinner,sun9i-a80-tcon-lcd 166 - * allwinner,sun9i-a80-tcon-tv 167 - * "allwinner,sun50i-a64-tcon-lcd", "allwinner,sun8i-a83t-tcon-lcd" 168 - * "allwinner,sun50i-a64-tcon-tv", "allwinner,sun8i-a83t-tcon-tv" 169 - * allwinner,sun50i-h6-tcon-tv, allwinner,sun8i-r40-tcon-tv 170 - - reg: base address and size of memory-mapped region 171 - - interrupts: interrupt associated to this IP 172 - - clocks: phandles to the clocks feeding the TCON. 173 - - 'ahb': the interface clocks 174 - - 'tcon-ch0': The clock driving the TCON channel 0, if supported 175 - - resets: phandles to the reset controllers driving the encoder 176 - - "lcd": the reset line for the TCON 177 - - "edp": the reset line for the eDP block (A80 only) 178 - 179 - - clock-names: the clock names mentioned above 180 - - reset-names: the reset names mentioned above 181 - - clock-output-names: Name of the pixel clock created, if TCON supports 182 - channel 0. 183 - 184 - - ports: A ports node with endpoint definitions as defined in 185 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 186 - first port should be the input endpoint, the second one the output 187 - 188 - The output may have multiple endpoints. TCON can have 1 or 2 channels, 189 - usually with the first channel being used for the panels interfaces 190 - (RGB, LVDS, etc.), and the second being used for the outputs that 191 - require another controller (TV Encoder, HDMI, etc.). The endpoints 192 - will take an extra property, allwinner,tcon-channel, to specify the 193 - channel the endpoint is associated to. If that property is not 194 - present, the endpoint number will be used as the channel number. 195 - 196 - For TCONs with channel 0, there is one more clock required: 197 - - 'tcon-ch0': The clock driving the TCON channel 0 198 - For TCONs with channel 1, there is one more clock required: 199 - - 'tcon-ch1': The clock driving the TCON channel 1 200 - 201 - When TCON support LVDS (all TCONs except TV TCONs on A83T, R40 and those found 202 - in A13, H3, H5 and V3s SoCs), you need one more reset line: 203 - - 'lvds': The reset line driving the LVDS logic 204 - 205 - And on the A23, A31, A31s and A33, you need one more clock line: 206 - - 'lvds-alt': An alternative clock source, separate from the TCON channel 0 207 - clock, that can be used to drive the LVDS clock 208 - 209 - TCON TOP 210 - -------- 211 - 212 - TCON TOPs main purpose is to configure whole display pipeline. It determines 213 - relationships between mixers and TCONs, selects source TCON for HDMI, muxes 214 - LCD and TV encoder GPIO output, selects TV encoder clock source and contains 215 - additional TV TCON and DSI gates. 216 - 217 - It allows display pipeline to be configured in very different ways: 218 - 219 - / LCD0/LVDS0 220 - / [0] TCON-LCD0 221 - | \ MIPI DSI 222 - mixer0 | 223 - \ / [1] TCON-LCD1 - LCD1/LVDS1 224 - TCON-TOP 225 - / \ [2] TCON-TV0 [0] - TVE0/RGB 226 - mixer1 | \ 227 - | TCON-TOP - HDMI 228 - | / 229 - \ [3] TCON-TV1 [1] - TVE1/RGB 230 - 231 - Note that both TCON TOP references same physical unit. Both mixers can be 232 - connected to any TCON. Not all TCON TOP variants support all features. 233 - 234 - Required properties: 235 - - compatible: value must be one of: 236 - * allwinner,sun8i-r40-tcon-top 237 - * allwinner,sun50i-h6-tcon-top 238 - - reg: base address and size of the memory-mapped region. 239 - - clocks: phandle to the clocks feeding the TCON TOP 240 - * bus: TCON TOP interface clock 241 - * tcon-tv0: TCON TV0 clock 242 - * tve0: TVE0 clock (R40 only) 243 - * tcon-tv1: TCON TV1 clock (R40 only) 244 - * tve1: TVE0 clock (R40 only) 245 - * dsi: MIPI DSI clock (R40 only) 246 - - clock-names: clock name mentioned above 247 - - resets: phandle to the reset line driving the TCON TOP 248 - - #clock-cells : must contain 1 249 - - clock-output-names: Names of clocks created for TCON TV0 channel clock, 250 - TCON TV1 channel clock (R40 only) and DSI channel clock (R40 only), in 251 - that order. 252 - 253 - - ports: A ports node with endpoint definitions as defined in 254 - Documentation/devicetree/bindings/media/video-interfaces.txt. 6 ports should 255 - be defined: 256 - * port 0 is input for mixer0 mux 257 - * port 1 is output for mixer0 mux 258 - * port 2 is input for mixer1 mux 259 - * port 3 is output for mixer1 mux 260 - * port 4 is input for HDMI mux 261 - * port 5 is output for HDMI mux 262 - All output endpoints for mixer muxes and input endpoints for HDMI mux should 263 - have reg property with the id of the target TCON, as shown in above graph 264 - (0-3 for mixer muxes and 0-1 for HDMI mux). All ports should have only one 265 - endpoint connected to remote endpoint. 266 - 267 - DRC 268 - --- 269 - 270 - The DRC (Dynamic Range Controller), found in the latest Allwinner SoCs 271 - (A31, A23, A33, A80), allows to dynamically adjust pixel 272 - brightness/contrast based on histogram measurements for LCD content 273 - adaptive backlight control. 274 - 275 - 276 - Required properties: 277 - - compatible: value must be one of: 278 - * allwinner,sun6i-a31-drc 279 - * allwinner,sun6i-a31s-drc 280 - * allwinner,sun8i-a23-drc 281 - * allwinner,sun8i-a33-drc 282 - * allwinner,sun9i-a80-drc 283 - - reg: base address and size of the memory-mapped region. 284 - - interrupts: interrupt associated to this IP 285 - - clocks: phandles to the clocks feeding the DRC 286 - * ahb: the DRC interface clock 287 - * mod: the DRC module clock 288 - * ram: the DRC DRAM clock 289 - - clock-names: the clock names mentioned above 290 - - resets: phandles to the reset line driving the DRC 291 - 292 - - ports: A ports node with endpoint definitions as defined in 293 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 294 - first port should be the input endpoints, the second one the outputs 295 - 296 - Display Engine Backend 297 - ---------------------- 298 - 299 - The display engine backend exposes layers and sprites to the 300 - system. 301 - 302 - Required properties: 303 - - compatible: value must be one of: 304 - * allwinner,sun4i-a10-display-backend 305 - * allwinner,sun5i-a13-display-backend 306 - * allwinner,sun6i-a31-display-backend 307 - * allwinner,sun7i-a20-display-backend 308 - * allwinner,sun8i-a23-display-backend 309 - * allwinner,sun8i-a33-display-backend 310 - * allwinner,sun9i-a80-display-backend 311 - - reg: base address and size of the memory-mapped region. 312 - - interrupts: interrupt associated to this IP 313 - - clocks: phandles to the clocks feeding the frontend and backend 314 - * ahb: the backend interface clock 315 - * mod: the backend module clock 316 - * ram: the backend DRAM clock 317 - - clock-names: the clock names mentioned above 318 - - resets: phandles to the reset controllers driving the backend 319 - 320 - - ports: A ports node with endpoint definitions as defined in 321 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 322 - first port should be the input endpoints, the second one the output 323 - 324 - On the A33, some additional properties are required: 325 - - reg needs to have an additional region corresponding to the SAT 326 - - reg-names need to be set, with "be" and "sat" 327 - - clocks and clock-names need to have a phandle to the SAT bus 328 - clocks, whose name will be "sat" 329 - - resets and reset-names need to have a phandle to the SAT bus 330 - resets, whose name will be "sat" 331 - 332 - DEU 333 - --- 334 - 335 - The DEU (Detail Enhancement Unit), found in the Allwinner A80 SoC, 336 - can sharpen the display content in both luma and chroma channels. 337 - 338 - Required properties: 339 - - compatible: value must be one of: 340 - * allwinner,sun9i-a80-deu 341 - - reg: base address and size of the memory-mapped region. 342 - - interrupts: interrupt associated to this IP 343 - - clocks: phandles to the clocks feeding the DEU 344 - * ahb: the DEU interface clock 345 - * mod: the DEU module clock 346 - * ram: the DEU DRAM clock 347 - - clock-names: the clock names mentioned above 348 - - resets: phandles to the reset line driving the DEU 349 - 350 - - ports: A ports node with endpoint definitions as defined in 351 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 352 - first port should be the input endpoints, the second one the outputs 353 - 354 - Display Engine Frontend 355 - ----------------------- 356 - 357 - The display engine frontend does formats conversion, scaling, 358 - deinterlacing and color space conversion. 359 - 360 - Required properties: 361 - - compatible: value must be one of: 362 - * allwinner,sun4i-a10-display-frontend 363 - * allwinner,sun5i-a13-display-frontend 364 - * allwinner,sun6i-a31-display-frontend 365 - * allwinner,sun7i-a20-display-frontend 366 - * allwinner,sun8i-a23-display-frontend 367 - * allwinner,sun8i-a33-display-frontend 368 - * allwinner,sun9i-a80-display-frontend 369 - - reg: base address and size of the memory-mapped region. 370 - - interrupts: interrupt associated to this IP 371 - - clocks: phandles to the clocks feeding the frontend and backend 372 - * ahb: the backend interface clock 373 - * mod: the backend module clock 374 - * ram: the backend DRAM clock 375 - - clock-names: the clock names mentioned above 376 - - resets: phandles to the reset controllers driving the backend 377 - 378 - - ports: A ports node with endpoint definitions as defined in 379 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 380 - first port should be the input endpoints, the second one the outputs 381 - 382 - Display Engine 2.0 Mixer 383 - ------------------------ 384 - 385 - The DE2 mixer have many functionalities, currently only layer blending is 386 - supported. 387 - 388 - Required properties: 389 - - compatible: value must be one of: 390 - * allwinner,sun8i-a83t-de2-mixer-0 391 - * allwinner,sun8i-a83t-de2-mixer-1 392 - * allwinner,sun8i-h3-de2-mixer-0 393 - * allwinner,sun8i-r40-de2-mixer-0 394 - * allwinner,sun8i-r40-de2-mixer-1 395 - * allwinner,sun8i-v3s-de2-mixer 396 - * allwinner,sun50i-a64-de2-mixer-0 397 - * allwinner,sun50i-a64-de2-mixer-1 398 - * allwinner,sun50i-h6-de3-mixer-0 399 - - reg: base address and size of the memory-mapped region. 400 - - clocks: phandles to the clocks feeding the mixer 401 - * bus: the mixer interface clock 402 - * mod: the mixer module clock 403 - - clock-names: the clock names mentioned above 404 - - resets: phandles to the reset controllers driving the mixer 405 - 406 - - ports: A ports node with endpoint definitions as defined in 407 - Documentation/devicetree/bindings/media/video-interfaces.txt. The 408 - first port should be the input endpoints, the second one the output 409 - 410 - 411 - Display Engine Pipeline 412 - ----------------------- 413 - 414 - The display engine pipeline (and its entry point, since it can be 415 - either directly the backend or the frontend) is represented as an 416 - extra node. 417 - 418 - Required properties: 419 - - compatible: value must be one of: 420 - * allwinner,sun4i-a10-display-engine 421 - * allwinner,sun5i-a10s-display-engine 422 - * allwinner,sun5i-a13-display-engine 423 - * allwinner,sun6i-a31-display-engine 424 - * allwinner,sun6i-a31s-display-engine 425 - * allwinner,sun7i-a20-display-engine 426 - * allwinner,sun8i-a23-display-engine 427 - * allwinner,sun8i-a33-display-engine 428 - * allwinner,sun8i-a83t-display-engine 429 - * allwinner,sun8i-h3-display-engine 430 - * allwinner,sun8i-r40-display-engine 431 - * allwinner,sun8i-v3s-display-engine 432 - * allwinner,sun9i-a80-display-engine 433 - * allwinner,sun50i-a64-display-engine 434 - * allwinner,sun50i-h6-display-engine 435 - 436 - - allwinner,pipelines: list of phandle to the display engine 437 - frontends (DE 1.0) or mixers (DE 2.0/3.0) available. 438 - 439 - Example: 440 - 441 - panel: panel { 442 - compatible = "olimex,lcd-olinuxino-43-ts"; 443 - #address-cells = <1>; 444 - #size-cells = <0>; 445 - 446 - port { 447 - #address-cells = <1>; 448 - #size-cells = <0>; 449 - 450 - panel_input: endpoint { 451 - remote-endpoint = <&tcon0_out_panel>; 452 - }; 453 - }; 454 - }; 455 - 456 - connector { 457 - compatible = "hdmi-connector"; 458 - type = "a"; 459 - 460 - port { 461 - hdmi_con_in: endpoint { 462 - remote-endpoint = <&hdmi_out_con>; 463 - }; 464 - }; 465 - }; 466 - 467 - hdmi: hdmi@1c16000 { 468 - compatible = "allwinner,sun5i-a10s-hdmi"; 469 - reg = <0x01c16000 0x1000>; 470 - interrupts = <58>; 471 - clocks = <&ccu CLK_AHB_HDMI>, <&ccu CLK_HDMI>, 472 - <&ccu CLK_PLL_VIDEO0_2X>, 473 - <&ccu CLK_PLL_VIDEO1_2X>; 474 - clock-names = "ahb", "mod", "pll-0", "pll-1"; 475 - dmas = <&dma SUN4I_DMA_NORMAL 16>, 476 - <&dma SUN4I_DMA_NORMAL 16>, 477 - <&dma SUN4I_DMA_DEDICATED 24>; 478 - dma-names = "ddc-tx", "ddc-rx", "audio-tx"; 479 - 480 - ports { 481 - #address-cells = <1>; 482 - #size-cells = <0>; 483 - 484 - port@0 { 485 - #address-cells = <1>; 486 - #size-cells = <0>; 487 - reg = <0>; 488 - 489 - hdmi_in_tcon0: endpoint { 490 - remote-endpoint = <&tcon0_out_hdmi>; 491 - }; 492 - }; 493 - 494 - port@1 { 495 - #address-cells = <1>; 496 - #size-cells = <0>; 497 - reg = <1>; 498 - 499 - hdmi_out_con: endpoint { 500 - remote-endpoint = <&hdmi_con_in>; 501 - }; 502 - }; 503 - }; 504 - }; 505 - 506 - tve0: tv-encoder@1c0a000 { 507 - compatible = "allwinner,sun4i-a10-tv-encoder"; 508 - reg = <0x01c0a000 0x1000>; 509 - clocks = <&ahb_gates 34>; 510 - resets = <&tcon_ch0_clk 0>; 511 - 512 - port { 513 - #address-cells = <1>; 514 - #size-cells = <0>; 515 - 516 - tve0_in_tcon0: endpoint@0 { 517 - reg = <0>; 518 - remote-endpoint = <&tcon0_out_tve0>; 519 - }; 520 - }; 521 - }; 522 - 523 - tcon0: lcd-controller@1c0c000 { 524 - compatible = "allwinner,sun5i-a13-tcon"; 525 - reg = <0x01c0c000 0x1000>; 526 - interrupts = <44>; 527 - resets = <&tcon_ch0_clk 1>; 528 - reset-names = "lcd"; 529 - clocks = <&ahb_gates 36>, 530 - <&tcon_ch0_clk>, 531 - <&tcon_ch1_clk>; 532 - clock-names = "ahb", 533 - "tcon-ch0", 534 - "tcon-ch1"; 535 - clock-output-names = "tcon-pixel-clock"; 536 - 537 - ports { 538 - #address-cells = <1>; 539 - #size-cells = <0>; 540 - 541 - tcon0_in: port@0 { 542 - #address-cells = <1>; 543 - #size-cells = <0>; 544 - reg = <0>; 545 - 546 - tcon0_in_be0: endpoint@0 { 547 - reg = <0>; 548 - remote-endpoint = <&be0_out_tcon0>; 549 - }; 550 - }; 551 - 552 - tcon0_out: port@1 { 553 - #address-cells = <1>; 554 - #size-cells = <0>; 555 - reg = <1>; 556 - 557 - tcon0_out_panel: endpoint@0 { 558 - reg = <0>; 559 - remote-endpoint = <&panel_input>; 560 - }; 561 - 562 - tcon0_out_tve0: endpoint@1 { 563 - reg = <1>; 564 - remote-endpoint = <&tve0_in_tcon0>; 565 - }; 566 - }; 567 - }; 568 - }; 569 - 570 - fe0: display-frontend@1e00000 { 571 - compatible = "allwinner,sun5i-a13-display-frontend"; 572 - reg = <0x01e00000 0x20000>; 573 - interrupts = <47>; 574 - clocks = <&ahb_gates 46>, <&de_fe_clk>, 575 - <&dram_gates 25>; 576 - clock-names = "ahb", "mod", 577 - "ram"; 578 - resets = <&de_fe_clk>; 579 - 580 - ports { 581 - #address-cells = <1>; 582 - #size-cells = <0>; 583 - 584 - fe0_out: port@1 { 585 - #address-cells = <1>; 586 - #size-cells = <0>; 587 - reg = <1>; 588 - 589 - fe0_out_be0: endpoint { 590 - remote-endpoint = <&be0_in_fe0>; 591 - }; 592 - }; 593 - }; 594 - }; 595 - 596 - be0: display-backend@1e60000 { 597 - compatible = "allwinner,sun5i-a13-display-backend"; 598 - reg = <0x01e60000 0x10000>; 599 - interrupts = <47>; 600 - clocks = <&ahb_gates 44>, <&de_be_clk>, 601 - <&dram_gates 26>; 602 - clock-names = "ahb", "mod", 603 - "ram"; 604 - resets = <&de_be_clk>; 605 - 606 - ports { 607 - #address-cells = <1>; 608 - #size-cells = <0>; 609 - 610 - be0_in: port@0 { 611 - #address-cells = <1>; 612 - #size-cells = <0>; 613 - reg = <0>; 614 - 615 - be0_in_fe0: endpoint@0 { 616 - reg = <0>; 617 - remote-endpoint = <&fe0_out_be0>; 618 - }; 619 - }; 620 - 621 - be0_out: port@1 { 622 - #address-cells = <1>; 623 - #size-cells = <0>; 624 - reg = <1>; 625 - 626 - be0_out_tcon0: endpoint@0 { 627 - reg = <0>; 628 - remote-endpoint = <&tcon0_in_be0>; 629 - }; 630 - }; 631 - }; 632 - }; 633 - 634 - display-engine { 635 - compatible = "allwinner,sun5i-a13-display-engine"; 636 - allwinner,pipelines = <&fe0>; 637 - };
+2
Documentation/devicetree/bindings/vendor-prefixes.yaml
··· 825 825 description: Sancloud Ltd 826 826 "^sandisk,.*": 827 827 description: Sandisk Corporation 828 + "^satoz,.*": 829 + description: Satoz International Co., Ltd 828 830 "^sbs,.*": 829 831 description: Smart Battery System 830 832 "^schindler,.*":
+6
MAINTAINERS
··· 5357 5357 F: drivers/gpu/drm/tiny/st7735r.c 5358 5358 F: Documentation/devicetree/bindings/display/sitronix,st7735r.txt 5359 5359 5360 + DRM DRIVER FOR SONY ACX424AKP PANELS 5361 + M: Linus Walleij <linus.walleij@linaro.org> 5362 + T: git git://anongit.freedesktop.org/drm/drm-misc 5363 + S: Maintained 5364 + F: drivers/gpu/drm/panel/panel-sony-acx424akp.c 5365 + 5360 5366 DRM DRIVER FOR ST-ERICSSON MCDE 5361 5367 M: Linus Walleij <linus.walleij@linaro.org> 5362 5368 T: git git://anongit.freedesktop.org/drm/drm-misc
+1
drivers/gpu/drm/Kconfig
··· 168 168 169 169 config DRM_DP_CEC 170 170 bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support" 171 + depends on DRM 171 172 select CEC_CORE 172 173 help 173 174 Choose this option if you want to enable HDMI CEC support for
+17 -24
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
··· 1289 1289 return conn_state->crtc; 1290 1290 } 1291 1291 1292 - static void 1293 - analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, 1294 - struct drm_bridge_state *old_bridge_state) 1292 + static void analogix_dp_bridge_atomic_pre_enable(struct drm_bridge *bridge, 1293 + struct drm_atomic_state *state) 1295 1294 { 1296 - struct drm_atomic_state *old_state = old_bridge_state->base.state; 1297 1295 struct analogix_dp_device *dp = bridge->driver_private; 1298 1296 struct drm_crtc *crtc; 1299 1297 struct drm_crtc_state *old_crtc_state; 1300 1298 int ret; 1301 1299 1302 - crtc = analogix_dp_get_new_crtc(dp, old_state); 1300 + crtc = analogix_dp_get_new_crtc(dp, state); 1303 1301 if (!crtc) 1304 1302 return; 1305 1303 1306 - old_crtc_state = drm_atomic_get_old_crtc_state(old_state, crtc); 1304 + old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); 1307 1305 /* Don't touch the panel if we're coming back from PSR */ 1308 1306 if (old_crtc_state && old_crtc_state->self_refresh_active) 1309 1307 return; ··· 1366 1368 return ret; 1367 1369 } 1368 1370 1369 - static void 1370 - analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, 1371 - struct drm_bridge_state *old_bridge_state) 1371 + static void analogix_dp_bridge_atomic_enable(struct drm_bridge *bridge, 1372 + struct drm_atomic_state *state) 1372 1373 { 1373 - struct drm_atomic_state *old_state = old_bridge_state->base.state; 1374 1374 struct analogix_dp_device *dp = bridge->driver_private; 1375 1375 struct drm_crtc *crtc; 1376 1376 struct drm_crtc_state *old_crtc_state; 1377 1377 int timeout_loop = 0; 1378 1378 int ret; 1379 1379 1380 - crtc = analogix_dp_get_new_crtc(dp, old_state); 1380 + crtc = analogix_dp_get_new_crtc(dp, state); 1381 1381 if (!crtc) 1382 1382 return; 1383 1383 1384 - old_crtc_state = drm_atomic_get_old_crtc_state(old_state, crtc); 1384 + old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); 1385 1385 /* Not a full enable, just disable PSR and continue */ 1386 1386 if (old_crtc_state && old_crtc_state->self_refresh_active) { 1387 1387 ret = analogix_dp_disable_psr(dp); ··· 1440 1444 dp->dpms_mode = DRM_MODE_DPMS_OFF; 1441 1445 } 1442 1446 1443 - static void 1444 - analogix_dp_bridge_atomic_disable(struct drm_bridge *bridge, 1445 - struct drm_bridge_state *old_bridge_state) 1447 + static void analogix_dp_bridge_atomic_disable(struct drm_bridge *bridge, 1448 + struct drm_atomic_state *state) 1446 1449 { 1447 - struct drm_atomic_state *old_state = old_bridge_state->base.state; 1448 1450 struct analogix_dp_device *dp = bridge->driver_private; 1449 1451 struct drm_crtc *crtc; 1450 1452 struct drm_crtc_state *new_crtc_state = NULL; 1451 1453 1452 - crtc = analogix_dp_get_new_crtc(dp, old_state); 1454 + crtc = analogix_dp_get_new_crtc(dp, state); 1453 1455 if (!crtc) 1454 1456 goto out; 1455 1457 1456 - new_crtc_state = drm_atomic_get_new_crtc_state(old_state, crtc); 1458 + new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); 1457 1459 if (!new_crtc_state) 1458 1460 goto out; 1459 1461 ··· 1463 1469 analogix_dp_bridge_disable(bridge); 1464 1470 } 1465 1471 1466 - static void 1467 - analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, 1468 - struct drm_bridge_state *old_bridge_state) 1472 + static 1473 + void analogix_dp_bridge_atomic_post_disable(struct drm_bridge *bridge, 1474 + struct drm_atomic_state *state) 1469 1475 { 1470 - struct drm_atomic_state *old_state = old_bridge_state->base.state; 1471 1476 struct analogix_dp_device *dp = bridge->driver_private; 1472 1477 struct drm_crtc *crtc; 1473 1478 struct drm_crtc_state *new_crtc_state; 1474 1479 int ret; 1475 1480 1476 - crtc = analogix_dp_get_new_crtc(dp, old_state); 1481 + crtc = analogix_dp_get_new_crtc(dp, state); 1477 1482 if (!crtc) 1478 1483 return; 1479 1484 1480 - new_crtc_state = drm_atomic_get_new_crtc_state(old_state, crtc); 1485 + new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); 1481 1486 if (!new_crtc_state || !new_crtc_state->self_refresh_active) 1482 1487 return; 1483 1488
-39
drivers/gpu/drm/drm_atomic.c
··· 30 30 31 31 #include <drm/drm_atomic.h> 32 32 #include <drm/drm_atomic_uapi.h> 33 - #include <drm/drm_bridge.h> 34 33 #include <drm/drm_debugfs.h> 35 34 #include <drm/drm_device.h> 36 35 #include <drm/drm_drv.h> ··· 1016 1017 if (connector->funcs->atomic_print_state) 1017 1018 connector->funcs->atomic_print_state(p, state); 1018 1019 } 1019 - 1020 - /** 1021 - * drm_atomic_add_encoder_bridges - add bridges attached to an encoder 1022 - * @state: atomic state 1023 - * @encoder: DRM encoder 1024 - * 1025 - * This function adds all bridges attached to @encoder. This is needed to add 1026 - * bridge states to @state and make them available when 1027 - * &bridge_funcs.atomic_{check,pre_enable,enable,disable_post_disable}() are 1028 - * called 1029 - * 1030 - * Returns: 1031 - * 0 on success or can fail with -EDEADLK or -ENOMEM. When the error is EDEADLK 1032 - * then the w/w mutex code has detected a deadlock and the entire atomic 1033 - * sequence must be restarted. All other errors are fatal. 1034 - */ 1035 - int 1036 - drm_atomic_add_encoder_bridges(struct drm_atomic_state *state, 1037 - struct drm_encoder *encoder) 1038 - { 1039 - struct drm_bridge_state *bridge_state; 1040 - struct drm_bridge *bridge; 1041 - 1042 - if (!encoder) 1043 - return 0; 1044 - 1045 - DRM_DEBUG_ATOMIC("Adding all bridges for [encoder:%d:%s] to %p\n", 1046 - encoder->base.id, encoder->name, state); 1047 - 1048 - drm_for_each_bridge_in_chain(encoder, bridge) { 1049 - bridge_state = drm_atomic_get_bridge_state(state, bridge); 1050 - if (IS_ERR(bridge_state)) 1051 - return PTR_ERR(bridge_state); 1052 - } 1053 - 1054 - return 0; 1055 - } 1056 - EXPORT_SYMBOL(drm_atomic_add_encoder_bridges); 1057 1020 1058 1021 /** 1059 1022 * drm_atomic_add_affected_connectors - add connectors for CRTC
+6 -26
drivers/gpu/drm/drm_atomic_helper.c
··· 437 437 funcs = encoder->helper_private; 438 438 439 439 bridge = drm_bridge_chain_get_first_bridge(encoder); 440 - ret = drm_atomic_bridge_chain_check(bridge, 441 - new_crtc_state, 442 - new_conn_state); 443 - if (ret) { 444 - DRM_DEBUG_ATOMIC("Bridge atomic check failed\n"); 445 - return ret; 440 + ret = drm_bridge_chain_mode_fixup(bridge, 441 + &new_crtc_state->mode, 442 + &new_crtc_state->adjusted_mode); 443 + if (!ret) { 444 + DRM_DEBUG_ATOMIC("Bridge fixup failed\n"); 445 + return -EINVAL; 446 446 } 447 447 448 448 if (funcs && funcs->atomic_check) { ··· 726 726 727 727 if (funcs->atomic_check) 728 728 ret = funcs->atomic_check(connector, state); 729 - if (ret) 730 - return ret; 731 - } 732 - 733 - /* 734 - * Iterate over all connectors again, and add all affected bridges to 735 - * the state. 736 - */ 737 - for_each_oldnew_connector_in_state(state, connector, 738 - old_connector_state, 739 - new_connector_state, i) { 740 - struct drm_encoder *encoder; 741 - 742 - encoder = old_connector_state->best_encoder; 743 - ret = drm_atomic_add_encoder_bridges(state, encoder); 744 - if (ret) 745 - return ret; 746 - 747 - encoder = new_connector_state->best_encoder; 748 - ret = drm_atomic_add_encoder_bridges(state, encoder); 749 729 if (ret) 750 730 return ret; 751 731 }
+18 -509
drivers/gpu/drm/drm_bridge.c
··· 25 25 #include <linux/module.h> 26 26 #include <linux/mutex.h> 27 27 28 - #include <drm/drm_atomic_state_helper.h> 29 28 #include <drm/drm_bridge.h> 30 29 #include <drm/drm_encoder.h> 31 30 ··· 89 90 } 90 91 EXPORT_SYMBOL(drm_bridge_remove); 91 92 92 - static struct drm_bridge_state * 93 - drm_atomic_default_bridge_duplicate_state(struct drm_bridge *bridge) 94 - { 95 - struct drm_bridge_state *new; 96 - 97 - if (WARN_ON(!bridge->base.state)) 98 - return NULL; 99 - 100 - new = kzalloc(sizeof(*new), GFP_KERNEL); 101 - if (new) 102 - __drm_atomic_helper_bridge_duplicate_state(bridge, new); 103 - 104 - return new; 105 - } 106 - 107 - static struct drm_private_state * 108 - drm_bridge_atomic_duplicate_priv_state(struct drm_private_obj *obj) 109 - { 110 - struct drm_bridge *bridge = drm_priv_to_bridge(obj); 111 - struct drm_bridge_state *state; 112 - 113 - if (bridge->funcs->atomic_duplicate_state) 114 - state = bridge->funcs->atomic_duplicate_state(bridge); 115 - else 116 - state = drm_atomic_default_bridge_duplicate_state(bridge); 117 - 118 - return state ? &state->base : NULL; 119 - } 120 - 121 - static void 122 - drm_atomic_default_bridge_destroy_state(struct drm_bridge *bridge, 123 - struct drm_bridge_state *state) 124 - { 125 - /* Just a simple kfree() for now */ 126 - kfree(state); 127 - } 128 - 129 - static void 130 - drm_bridge_atomic_destroy_priv_state(struct drm_private_obj *obj, 131 - struct drm_private_state *s) 132 - { 133 - struct drm_bridge_state *state = drm_priv_to_bridge_state(s); 134 - struct drm_bridge *bridge = drm_priv_to_bridge(obj); 135 - 136 - if (bridge->funcs->atomic_destroy_state) 137 - bridge->funcs->atomic_destroy_state(bridge, state); 138 - else 139 - drm_atomic_default_bridge_destroy_state(bridge, state); 140 - } 141 - 142 - static const struct drm_private_state_funcs drm_bridge_priv_state_funcs = { 143 - .atomic_duplicate_state = drm_bridge_atomic_duplicate_priv_state, 144 - .atomic_destroy_state = drm_bridge_atomic_destroy_priv_state, 145 - }; 146 - 147 - static struct drm_bridge_state * 148 - drm_atomic_default_bridge_reset(struct drm_bridge *bridge) 149 - { 150 - struct drm_bridge_state *bridge_state; 151 - 152 - bridge_state = kzalloc(sizeof(*bridge_state), GFP_KERNEL); 153 - if (!bridge_state) 154 - return ERR_PTR(-ENOMEM); 155 - 156 - __drm_atomic_helper_bridge_reset(bridge, bridge_state); 157 - return bridge_state; 158 - } 159 - 160 93 /** 161 94 * drm_bridge_attach - attach the bridge to an encoder's chain 162 95 * ··· 114 183 int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge, 115 184 struct drm_bridge *previous) 116 185 { 117 - struct drm_bridge_state *state; 118 186 int ret; 119 187 120 188 if (!encoder || !bridge) ··· 135 205 136 206 if (bridge->funcs->attach) { 137 207 ret = bridge->funcs->attach(bridge); 138 - if (ret < 0) 139 - goto err_reset_bridge; 208 + if (ret < 0) { 209 + list_del(&bridge->chain_node); 210 + bridge->dev = NULL; 211 + bridge->encoder = NULL; 212 + return ret; 213 + } 140 214 } 141 - 142 - if (bridge->funcs->atomic_reset) 143 - state = bridge->funcs->atomic_reset(bridge); 144 - else 145 - state = drm_atomic_default_bridge_reset(bridge); 146 - 147 - if (IS_ERR(state)) { 148 - ret = PTR_ERR(state); 149 - goto err_detach_bridge; 150 - } 151 - 152 - drm_atomic_private_obj_init(bridge->dev, &bridge->base, 153 - &state->base, 154 - &drm_bridge_priv_state_funcs); 155 215 156 216 return 0; 157 - 158 - err_detach_bridge: 159 - if (bridge->funcs->detach) 160 - bridge->funcs->detach(bridge); 161 - 162 - err_reset_bridge: 163 - bridge->dev = NULL; 164 - bridge->encoder = NULL; 165 - list_del(&bridge->chain_node); 166 - return ret; 167 217 } 168 218 EXPORT_SYMBOL(drm_bridge_attach); 169 219 ··· 154 244 155 245 if (WARN_ON(!bridge->dev)) 156 246 return; 157 - 158 - drm_atomic_private_obj_fini(&bridge->base); 159 247 160 248 if (bridge->funcs->detach) 161 249 bridge->funcs->detach(bridge); ··· 409 501 410 502 encoder = bridge->encoder; 411 503 list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { 412 - if (iter->funcs->atomic_disable) { 413 - struct drm_bridge_state *old_bridge_state; 414 - 415 - old_bridge_state = 416 - drm_atomic_get_old_bridge_state(old_state, 417 - iter); 418 - if (WARN_ON(!old_bridge_state)) 419 - return; 420 - 421 - iter->funcs->atomic_disable(iter, old_bridge_state); 422 - } else if (iter->funcs->disable) { 504 + if (iter->funcs->atomic_disable) 505 + iter->funcs->atomic_disable(iter, old_state); 506 + else if (iter->funcs->disable) 423 507 iter->funcs->disable(iter); 424 - } 425 508 426 509 if (iter == bridge) 427 510 break; ··· 443 544 444 545 encoder = bridge->encoder; 445 546 list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { 446 - if (bridge->funcs->atomic_post_disable) { 447 - struct drm_bridge_state *old_bridge_state; 448 - 449 - old_bridge_state = 450 - drm_atomic_get_old_bridge_state(old_state, 451 - bridge); 452 - if (WARN_ON(!old_bridge_state)) 453 - return; 454 - 455 - bridge->funcs->atomic_post_disable(bridge, 456 - old_bridge_state); 457 - } else if (bridge->funcs->post_disable) { 547 + if (bridge->funcs->atomic_post_disable) 548 + bridge->funcs->atomic_post_disable(bridge, old_state); 549 + else if (bridge->funcs->post_disable) 458 550 bridge->funcs->post_disable(bridge); 459 - } 460 551 } 461 552 } 462 553 EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable); ··· 475 586 476 587 encoder = bridge->encoder; 477 588 list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { 478 - if (iter->funcs->atomic_pre_enable) { 479 - struct drm_bridge_state *old_bridge_state; 480 - 481 - old_bridge_state = 482 - drm_atomic_get_old_bridge_state(old_state, 483 - iter); 484 - if (WARN_ON(!old_bridge_state)) 485 - return; 486 - 487 - iter->funcs->atomic_pre_enable(iter, old_bridge_state); 488 - } else if (iter->funcs->pre_enable) { 589 + if (iter->funcs->atomic_pre_enable) 590 + iter->funcs->atomic_pre_enable(iter, old_state); 591 + else if (iter->funcs->pre_enable) 489 592 iter->funcs->pre_enable(iter); 490 - } 491 593 492 594 if (iter == bridge) 493 595 break; ··· 508 628 509 629 encoder = bridge->encoder; 510 630 list_for_each_entry_from(bridge, &encoder->bridge_chain, chain_node) { 511 - if (bridge->funcs->atomic_enable) { 512 - struct drm_bridge_state *old_bridge_state; 513 - 514 - old_bridge_state = 515 - drm_atomic_get_old_bridge_state(old_state, 516 - bridge); 517 - if (WARN_ON(!old_bridge_state)) 518 - return; 519 - 520 - bridge->funcs->atomic_enable(bridge, old_bridge_state); 521 - } else if (bridge->funcs->enable) { 631 + if (bridge->funcs->atomic_enable) 632 + bridge->funcs->atomic_enable(bridge, old_state); 633 + else if (bridge->funcs->enable) 522 634 bridge->funcs->enable(bridge); 523 - } 524 635 } 525 636 } 526 637 EXPORT_SYMBOL(drm_atomic_bridge_chain_enable); 527 - 528 - static int drm_atomic_bridge_check(struct drm_bridge *bridge, 529 - struct drm_crtc_state *crtc_state, 530 - struct drm_connector_state *conn_state) 531 - { 532 - if (bridge->funcs->atomic_check) { 533 - struct drm_bridge_state *bridge_state; 534 - int ret; 535 - 536 - bridge_state = drm_atomic_get_new_bridge_state(crtc_state->state, 537 - bridge); 538 - if (WARN_ON(!bridge_state)) 539 - return -EINVAL; 540 - 541 - ret = bridge->funcs->atomic_check(bridge, bridge_state, 542 - crtc_state, conn_state); 543 - if (ret) 544 - return ret; 545 - } else if (bridge->funcs->mode_fixup) { 546 - if (!bridge->funcs->mode_fixup(bridge, &crtc_state->mode, 547 - &crtc_state->adjusted_mode)) 548 - return -EINVAL; 549 - } 550 - 551 - return 0; 552 - } 553 - 554 - /** 555 - * drm_atomic_helper_bridge_propagate_bus_fmt() - Propagate output format to 556 - * the input end of a bridge 557 - * @bridge: bridge control structure 558 - * @bridge_state: new bridge state 559 - * @crtc_state: new CRTC state 560 - * @conn_state: new connector state 561 - * @output_fmt: tested output bus format 562 - * @num_input_fmts: will contain the size of the returned array 563 - * 564 - * This helper is a pluggable implementation of the 565 - * &drm_bridge_funcs.atomic_get_input_bus_fmts operation for bridges that don't 566 - * modify the bus configuration between their input and their output. It 567 - * returns an array of input formats with a single element set to @output_fmt. 568 - * 569 - * RETURNS: 570 - * a valid format array of size @num_input_fmts, or NULL if the allocation 571 - * failed 572 - */ 573 - u32 * 574 - drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge, 575 - struct drm_bridge_state *bridge_state, 576 - struct drm_crtc_state *crtc_state, 577 - struct drm_connector_state *conn_state, 578 - u32 output_fmt, 579 - unsigned int *num_input_fmts) 580 - { 581 - u32 *input_fmts; 582 - 583 - input_fmts = kzalloc(sizeof(*input_fmts), GFP_KERNEL); 584 - if (!input_fmts) { 585 - *num_input_fmts = 0; 586 - return NULL; 587 - } 588 - 589 - *num_input_fmts = 1; 590 - input_fmts[0] = output_fmt; 591 - return input_fmts; 592 - } 593 - EXPORT_SYMBOL(drm_atomic_helper_bridge_propagate_bus_fmt); 594 - 595 - static int select_bus_fmt_recursive(struct drm_bridge *first_bridge, 596 - struct drm_bridge *cur_bridge, 597 - struct drm_crtc_state *crtc_state, 598 - struct drm_connector_state *conn_state, 599 - u32 out_bus_fmt) 600 - { 601 - struct drm_bridge_state *cur_state; 602 - unsigned int num_in_bus_fmts, i; 603 - struct drm_bridge *prev_bridge; 604 - u32 *in_bus_fmts; 605 - int ret; 606 - 607 - prev_bridge = drm_bridge_get_prev_bridge(cur_bridge); 608 - cur_state = drm_atomic_get_new_bridge_state(crtc_state->state, 609 - cur_bridge); 610 - if (WARN_ON(!cur_state)) 611 - return -EINVAL; 612 - 613 - /* 614 - * If bus format negotiation is not supported by this bridge, let's 615 - * pass MEDIA_BUS_FMT_FIXED to the previous bridge in the chain and 616 - * hope that it can handle this situation gracefully (by providing 617 - * appropriate default values). 618 - */ 619 - if (!cur_bridge->funcs->atomic_get_input_bus_fmts) { 620 - if (cur_bridge != first_bridge) { 621 - ret = select_bus_fmt_recursive(first_bridge, 622 - prev_bridge, crtc_state, 623 - conn_state, 624 - MEDIA_BUS_FMT_FIXED); 625 - if (ret) 626 - return ret; 627 - } 628 - 629 - cur_state->input_bus_cfg.format = MEDIA_BUS_FMT_FIXED; 630 - cur_state->output_bus_cfg.format = out_bus_fmt; 631 - return 0; 632 - } 633 - 634 - in_bus_fmts = cur_bridge->funcs->atomic_get_input_bus_fmts(cur_bridge, 635 - cur_state, 636 - crtc_state, 637 - conn_state, 638 - out_bus_fmt, 639 - &num_in_bus_fmts); 640 - if (!num_in_bus_fmts) 641 - return -ENOTSUPP; 642 - else if (!in_bus_fmts) 643 - return -ENOMEM; 644 - 645 - if (first_bridge == cur_bridge) { 646 - cur_state->input_bus_cfg.format = in_bus_fmts[0]; 647 - cur_state->output_bus_cfg.format = out_bus_fmt; 648 - kfree(in_bus_fmts); 649 - return 0; 650 - } 651 - 652 - for (i = 0; i < num_in_bus_fmts; i++) { 653 - ret = select_bus_fmt_recursive(first_bridge, prev_bridge, 654 - crtc_state, conn_state, 655 - in_bus_fmts[i]); 656 - if (ret != -ENOTSUPP) 657 - break; 658 - } 659 - 660 - if (!ret) { 661 - cur_state->input_bus_cfg.format = in_bus_fmts[i]; 662 - cur_state->output_bus_cfg.format = out_bus_fmt; 663 - } 664 - 665 - kfree(in_bus_fmts); 666 - return ret; 667 - } 668 - 669 - /* 670 - * This function is called by &drm_atomic_bridge_chain_check() just before 671 - * calling &drm_bridge_funcs.atomic_check() on all elements of the chain. 672 - * It performs bus format negotiation between bridge elements. The negotiation 673 - * happens in reverse order, starting from the last element in the chain up to 674 - * @bridge. 675 - * 676 - * Negotiation starts by retrieving supported output bus formats on the last 677 - * bridge element and testing them one by one. The test is recursive, meaning 678 - * that for each tested output format, the whole chain will be walked backward, 679 - * and each element will have to choose an input bus format that can be 680 - * transcoded to the requested output format. When a bridge element does not 681 - * support transcoding into a specific output format -ENOTSUPP is returned and 682 - * the next bridge element will have to try a different format. If none of the 683 - * combinations worked, -ENOTSUPP is returned and the atomic modeset will fail. 684 - * 685 - * This implementation is relying on 686 - * &drm_bridge_funcs.atomic_get_output_bus_fmts() and 687 - * &drm_bridge_funcs.atomic_get_input_bus_fmts() to gather supported 688 - * input/output formats. 689 - * 690 - * When &drm_bridge_funcs.atomic_get_output_bus_fmts() is not implemented by 691 - * the last element of the chain, &drm_atomic_bridge_chain_select_bus_fmts() 692 - * tries a single format: &drm_connector.display_info.bus_formats[0] if 693 - * available, MEDIA_BUS_FMT_FIXED otherwise. 694 - * 695 - * When &drm_bridge_funcs.atomic_get_input_bus_fmts() is not implemented, 696 - * &drm_atomic_bridge_chain_select_bus_fmts() skips the negotiation on the 697 - * bridge element that lacks this hook and asks the previous element in the 698 - * chain to try MEDIA_BUS_FMT_FIXED. It's up to bridge drivers to decide what 699 - * to do in that case (fail if they want to enforce bus format negotiation, or 700 - * provide a reasonable default if they need to support pipelines where not 701 - * all elements support bus format negotiation). 702 - */ 703 - static int 704 - drm_atomic_bridge_chain_select_bus_fmts(struct drm_bridge *bridge, 705 - struct drm_crtc_state *crtc_state, 706 - struct drm_connector_state *conn_state) 707 - { 708 - struct drm_connector *conn = conn_state->connector; 709 - struct drm_encoder *encoder = bridge->encoder; 710 - struct drm_bridge_state *last_bridge_state; 711 - unsigned int i, num_out_bus_fmts; 712 - struct drm_bridge *last_bridge; 713 - u32 *out_bus_fmts; 714 - int ret = 0; 715 - 716 - last_bridge = list_last_entry(&encoder->bridge_chain, 717 - struct drm_bridge, chain_node); 718 - last_bridge_state = drm_atomic_get_new_bridge_state(crtc_state->state, 719 - last_bridge); 720 - if (WARN_ON(!last_bridge_state)) 721 - return -EINVAL; 722 - 723 - if (last_bridge->funcs->atomic_get_output_bus_fmts) { 724 - const struct drm_bridge_funcs *funcs = last_bridge->funcs; 725 - 726 - out_bus_fmts = funcs->atomic_get_output_bus_fmts(last_bridge, 727 - last_bridge_state, 728 - crtc_state, 729 - conn_state, 730 - &num_out_bus_fmts); 731 - if (!num_out_bus_fmts) 732 - return -ENOTSUPP; 733 - else if (!out_bus_fmts) 734 - return -ENOMEM; 735 - } else { 736 - num_out_bus_fmts = 1; 737 - out_bus_fmts = kmalloc(sizeof(*out_bus_fmts), GFP_KERNEL); 738 - if (!out_bus_fmts) 739 - return -ENOMEM; 740 - 741 - if (conn->display_info.num_bus_formats && 742 - conn->display_info.bus_formats) 743 - out_bus_fmts[0] = conn->display_info.bus_formats[0]; 744 - else 745 - out_bus_fmts[0] = MEDIA_BUS_FMT_FIXED; 746 - } 747 - 748 - for (i = 0; i < num_out_bus_fmts; i++) { 749 - ret = select_bus_fmt_recursive(bridge, last_bridge, crtc_state, 750 - conn_state, out_bus_fmts[i]); 751 - if (ret != -ENOTSUPP) 752 - break; 753 - } 754 - 755 - kfree(out_bus_fmts); 756 - 757 - return ret; 758 - } 759 - 760 - static void 761 - drm_atomic_bridge_propagate_bus_flags(struct drm_bridge *bridge, 762 - struct drm_connector *conn, 763 - struct drm_atomic_state *state) 764 - { 765 - struct drm_bridge_state *bridge_state, *next_bridge_state; 766 - struct drm_bridge *next_bridge; 767 - u32 output_flags; 768 - 769 - bridge_state = drm_atomic_get_new_bridge_state(state, bridge); 770 - next_bridge = drm_bridge_get_next_bridge(bridge); 771 - 772 - /* 773 - * Let's try to apply the most common case here, that is, propagate 774 - * display_info flags for the last bridge, and propagate the input 775 - * flags of the next bridge element to the output end of the current 776 - * bridge when the bridge is not the last one. 777 - * There are exceptions to this rule, like when signal inversion is 778 - * happening at the board level, but that's something drivers can deal 779 - * with from their &drm_bridge_funcs.atomic_check() implementation by 780 - * simply overriding the flags value we've set here. 781 - */ 782 - if (!next_bridge) { 783 - output_flags = conn->display_info.bus_flags; 784 - } else { 785 - next_bridge_state = drm_atomic_get_new_bridge_state(state, 786 - next_bridge); 787 - output_flags = next_bridge_state->input_bus_cfg.flags; 788 - } 789 - 790 - bridge_state->output_bus_cfg.flags = output_flags; 791 - 792 - /* 793 - * Propage the output flags to the input end of the bridge. Again, it's 794 - * not necessarily what all bridges want, but that's what most of them 795 - * do, and by doing that by default we avoid forcing drivers to 796 - * duplicate the "dummy propagation" logic. 797 - */ 798 - bridge_state->input_bus_cfg.flags = output_flags; 799 - } 800 - 801 - /** 802 - * drm_atomic_bridge_chain_check() - Do an atomic check on the bridge chain 803 - * @bridge: bridge control structure 804 - * @crtc_state: new CRTC state 805 - * @conn_state: new connector state 806 - * 807 - * First trigger a bus format negotiation before calling 808 - * &drm_bridge_funcs.atomic_check() (falls back on 809 - * &drm_bridge_funcs.mode_fixup()) op for all the bridges in the encoder chain, 810 - * starting from the last bridge to the first. These are called before calling 811 - * &drm_encoder_helper_funcs.atomic_check() 812 - * 813 - * RETURNS: 814 - * 0 on success, a negative error code on failure 815 - */ 816 - int drm_atomic_bridge_chain_check(struct drm_bridge *bridge, 817 - struct drm_crtc_state *crtc_state, 818 - struct drm_connector_state *conn_state) 819 - { 820 - struct drm_connector *conn = conn_state->connector; 821 - struct drm_encoder *encoder = bridge->encoder; 822 - struct drm_bridge *iter; 823 - int ret; 824 - 825 - ret = drm_atomic_bridge_chain_select_bus_fmts(bridge, crtc_state, 826 - conn_state); 827 - if (ret) 828 - return ret; 829 - 830 - list_for_each_entry_reverse(iter, &encoder->bridge_chain, chain_node) { 831 - int ret; 832 - 833 - /* 834 - * Bus flags are propagated by default. If a bridge needs to 835 - * tweak the input bus flags for any reason, it should happen 836 - * in its &drm_bridge_funcs.atomic_check() implementation such 837 - * that preceding bridges in the chain can propagate the new 838 - * bus flags. 839 - */ 840 - drm_atomic_bridge_propagate_bus_flags(iter, conn, 841 - crtc_state->state); 842 - 843 - ret = drm_atomic_bridge_check(iter, crtc_state, conn_state); 844 - if (ret) 845 - return ret; 846 - 847 - if (iter == bridge) 848 - break; 849 - } 850 - 851 - return 0; 852 - } 853 - EXPORT_SYMBOL(drm_atomic_bridge_chain_check); 854 - 855 - /** 856 - * __drm_atomic_helper_bridge_reset() - Initialize a bridge state to its 857 - * default 858 - * @bridge: the bridge this state is refers to 859 - * @state: bridge state to initialize 860 - * 861 - * Initialize the bridge state to default values. This is meant to be* called 862 - * by the bridge &drm_plane_funcs.reset hook for bridges that subclass the 863 - * bridge state. 864 - */ 865 - void __drm_atomic_helper_bridge_reset(struct drm_bridge *bridge, 866 - struct drm_bridge_state *state) 867 - { 868 - memset(state, 0, sizeof(*state)); 869 - state->bridge = bridge; 870 - } 871 - EXPORT_SYMBOL(__drm_atomic_helper_bridge_reset); 872 - 873 - /** 874 - * __drm_atomic_helper_bridge_duplicate_state() - Copy atomic bridge state 875 - * @bridge: bridge object 876 - * @state: atomic bridge state 877 - * 878 - * Copies atomic state from a bridge's current state and resets inferred values. 879 - * This is useful for drivers that subclass the bridge state. 880 - */ 881 - void __drm_atomic_helper_bridge_duplicate_state(struct drm_bridge *bridge, 882 - struct drm_bridge_state *state) 883 - { 884 - __drm_atomic_helper_private_obj_duplicate_state(&bridge->base, 885 - &state->base); 886 - state->bridge = bridge; 887 - } 888 - EXPORT_SYMBOL(__drm_atomic_helper_bridge_duplicate_state); 889 638 890 639 #ifdef CONFIG_OF 891 640 /**
+7 -2
drivers/gpu/drm/drm_debugfs_crc.c
··· 140 140 if (IS_ERR(source)) 141 141 return PTR_ERR(source); 142 142 143 - if (source[len] == '\n') 144 - source[len] = '\0'; 143 + if (source[len - 1] == '\n') 144 + source[len - 1] = '\0'; 145 145 146 146 ret = crtc->funcs->verify_crc_source(crtc, source, &values_cnt); 147 147 if (ret) ··· 257 257 { 258 258 struct drm_crtc *crtc = filep->f_inode->i_private; 259 259 struct drm_crtc_crc *crc = &crtc->crc; 260 + 261 + /* terminate the infinite while loop if 'drm_dp_aux_crc_work' running */ 262 + spin_lock_irq(&crc->lock); 263 + crc->opened = false; 264 + spin_unlock_irq(&crc->lock); 260 265 261 266 crtc->funcs->set_crc_source(crtc, NULL); 262 267
+1
drivers/gpu/drm/drm_fb_cma_helper.c
··· 9 9 * Copyright (C) 2012 Red Hat 10 10 */ 11 11 12 + #include <drm/drm_fb_cma_helper.h> 12 13 #include <drm/drm_fourcc.h> 13 14 #include <drm/drm_framebuffer.h> 14 15 #include <drm/drm_gem_cma_helper.h>
+2 -1
drivers/gpu/drm/drm_lock.c
··· 360 360 /* 361 361 * Since the master is disappearing, so is the 362 362 * possibility to lock. 363 - */ mutex_lock(&dev->struct_mutex); 363 + */ 364 + mutex_lock(&dev->struct_mutex); 364 365 if (master->lock.hw_lock) { 365 366 if (dev->sigdata.lock == master->lock.hw_lock) 366 367 dev->sigdata.lock = NULL;
+5 -4
drivers/gpu/drm/drm_modes.c
··· 233 233 /* 3) Nominal HSync width (% of line period) - default 8 */ 234 234 #define CVT_HSYNC_PERCENTAGE 8 235 235 unsigned int hblank_percentage; 236 - int vsyncandback_porch, vback_porch, hblank; 236 + int vsyncandback_porch, __maybe_unused vback_porch, hblank; 237 237 238 238 /* estimated the horizontal period */ 239 239 tmp1 = HV_FACTOR * 1000000 - ··· 386 386 int top_margin, bottom_margin; 387 387 int interlace; 388 388 unsigned int hfreq_est; 389 - int vsync_plus_bp, vback_porch; 390 - unsigned int vtotal_lines, vfieldrate_est, hperiod; 391 - unsigned int vfield_rate, vframe_rate; 389 + int vsync_plus_bp, __maybe_unused vback_porch; 390 + unsigned int vtotal_lines, __maybe_unused vfieldrate_est; 391 + unsigned int __maybe_unused hperiod; 392 + unsigned int vfield_rate, __maybe_unused vframe_rate; 392 393 int left_margin, right_margin; 393 394 unsigned int total_active_pixels, ideal_duty_cycle; 394 395 unsigned int hblank, total_pixels, pixel_freq;
+24 -5
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1378 1378 static void exynos_dsi_enable(struct drm_encoder *encoder) 1379 1379 { 1380 1380 struct exynos_dsi *dsi = encoder_to_dsi(encoder); 1381 + struct drm_bridge *iter; 1381 1382 int ret; 1382 1383 1383 1384 if (dsi->state & DSIM_STATE_ENABLED) ··· 1392 1391 if (ret < 0) 1393 1392 goto err_put_sync; 1394 1393 } else { 1395 - drm_bridge_chain_pre_enable(dsi->out_bridge); 1394 + list_for_each_entry_reverse(iter, &dsi->bridge_chain, 1395 + chain_node) { 1396 + if (iter->funcs->pre_enable) 1397 + iter->funcs->pre_enable(iter); 1398 + } 1396 1399 } 1397 1400 1398 1401 exynos_dsi_set_display_mode(dsi); ··· 1407 1402 if (ret < 0) 1408 1403 goto err_display_disable; 1409 1404 } else { 1410 - drm_bridge_chain_enable(dsi->out_bridge); 1405 + list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { 1406 + if (iter->funcs->enable) 1407 + iter->funcs->enable(iter); 1408 + } 1411 1409 } 1412 1410 1413 1411 dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE; ··· 1428 1420 static void exynos_dsi_disable(struct drm_encoder *encoder) 1429 1421 { 1430 1422 struct exynos_dsi *dsi = encoder_to_dsi(encoder); 1423 + struct drm_bridge *iter; 1431 1424 1432 1425 if (!(dsi->state & DSIM_STATE_ENABLED)) 1433 1426 return; ··· 1436 1427 dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE; 1437 1428 1438 1429 drm_panel_disable(dsi->panel); 1439 - drm_bridge_chain_disable(dsi->out_bridge); 1430 + 1431 + list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { 1432 + if (iter->funcs->disable) 1433 + iter->funcs->disable(iter); 1434 + } 1435 + 1440 1436 exynos_dsi_set_display_enable(dsi, false); 1441 1437 drm_panel_unprepare(dsi->panel); 1442 - drm_bridge_chain_post_disable(dsi->out_bridge); 1438 + 1439 + list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { 1440 + if (iter->funcs->post_disable) 1441 + iter->funcs->post_disable(iter); 1442 + } 1443 + 1443 1444 dsi->state &= ~DSIM_STATE_ENABLED; 1444 1445 pm_runtime_put_sync(dsi->dev); 1445 1446 } ··· 1542 1523 if (out_bridge) { 1543 1524 drm_bridge_attach(encoder, out_bridge, NULL); 1544 1525 dsi->out_bridge = out_bridge; 1545 - list_splice(&encoder->bridge_chain, &dsi->bridge_chain); 1526 + list_splice_init(&encoder->bridge_chain, &dsi->bridge_chain); 1546 1527 } else { 1547 1528 int ret = exynos_dsi_create_connector(encoder); 1548 1529
+1 -2
drivers/gpu/drm/gma500/psb_irq.c
··· 470 470 { 471 471 struct drm_psb_private *dev_priv = 472 472 (struct drm_psb_private *) dev->dev_private; 473 - u32 hist_reg; 474 473 u32 pwm_reg; 475 474 476 475 if (gma_power_begin(dev, false)) { 477 476 PSB_WVDC32(0x00000000, HISTOGRAM_INT_CONTROL); 478 - hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL); 477 + PSB_RVDC32(HISTOGRAM_INT_CONTROL); 479 478 480 479 psb_disable_pipestat(dev_priv, 0, PIPE_DPST_EVENT_ENABLE); 481 480
+9 -26
drivers/gpu/drm/lima/lima_sched.c
··· 255 255 return task->fence; 256 256 } 257 257 258 - static void lima_sched_handle_error_task(struct lima_sched_pipe *pipe, 259 - struct lima_sched_task *task) 258 + static void lima_sched_timedout_job(struct drm_sched_job *job) 260 259 { 260 + struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); 261 + struct lima_sched_task *task = to_lima_task(job); 262 + 263 + if (!pipe->error) 264 + DRM_ERROR("lima job timeout\n"); 265 + 261 266 drm_sched_stop(&pipe->base, &task->base); 262 267 263 - if (task) 264 - drm_sched_increase_karma(&task->base); 268 + drm_sched_increase_karma(&task->base); 265 269 266 270 pipe->task_error(pipe); 267 271 ··· 286 282 287 283 drm_sched_resubmit_jobs(&pipe->base); 288 284 drm_sched_start(&pipe->base, true); 289 - } 290 - 291 - static void lima_sched_timedout_job(struct drm_sched_job *job) 292 - { 293 - struct lima_sched_pipe *pipe = to_lima_pipe(job->sched); 294 - struct lima_sched_task *task = to_lima_task(job); 295 - 296 - DRM_ERROR("lima job timeout\n"); 297 - 298 - lima_sched_handle_error_task(pipe, task); 299 285 } 300 286 301 287 static void lima_sched_free_job(struct drm_sched_job *job) ··· 312 318 .free_job = lima_sched_free_job, 313 319 }; 314 320 315 - static void lima_sched_error_work(struct work_struct *work) 316 - { 317 - struct lima_sched_pipe *pipe = 318 - container_of(work, struct lima_sched_pipe, error_work); 319 - struct lima_sched_task *task = pipe->current_task; 320 - 321 - lima_sched_handle_error_task(pipe, task); 322 - } 323 - 324 321 int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name) 325 322 { 326 323 unsigned int timeout = lima_sched_timeout_ms > 0 ? ··· 319 334 320 335 pipe->fence_context = dma_fence_context_alloc(1); 321 336 spin_lock_init(&pipe->fence_lock); 322 - 323 - INIT_WORK(&pipe->error_work, lima_sched_error_work); 324 337 325 338 return drm_sched_init(&pipe->base, &lima_sched_ops, 1, 0, 326 339 msecs_to_jiffies(timeout), name); ··· 332 349 void lima_sched_pipe_task_done(struct lima_sched_pipe *pipe) 333 350 { 334 351 if (pipe->error) 335 - schedule_work(&pipe->error_work); 352 + drm_sched_fault(&pipe->base); 336 353 else { 337 354 struct lima_sched_task *task = pipe->current_task; 338 355
-2
drivers/gpu/drm/lima/lima_sched.h
··· 68 68 void (*task_fini)(struct lima_sched_pipe *pipe); 69 69 void (*task_error)(struct lima_sched_pipe *pipe); 70 70 void (*task_mmu_error)(struct lima_sched_pipe *pipe); 71 - 72 - struct work_struct error_work; 73 71 }; 74 72 75 73 int lima_sched_task_init(struct lima_sched_task *task,
+1 -1
drivers/gpu/drm/meson/meson_drv.h
··· 135 135 } venc; 136 136 137 137 struct { 138 - dma_addr_t addr_phys; 138 + dma_addr_t addr_dma; 139 139 uint32_t *addr; 140 140 unsigned int offset; 141 141 } rdma;
+6 -6
drivers/gpu/drm/meson/meson_rdma.c
··· 27 27 /* Allocate a PAGE buffer */ 28 28 priv->rdma.addr = 29 29 dma_alloc_coherent(priv->dev, SZ_4K, 30 - &priv->rdma.addr_phys, 30 + &priv->rdma.addr_dma, 31 31 GFP_KERNEL); 32 32 if (!priv->rdma.addr) 33 33 return -ENOMEM; ··· 47 47 48 48 void meson_rdma_free(struct meson_drm *priv) 49 49 { 50 - if (!priv->rdma.addr && !priv->rdma.addr_phys) 50 + if (!priv->rdma.addr && !priv->rdma.addr_dma) 51 51 return; 52 52 53 53 meson_rdma_stop(priv); 54 54 55 55 dma_free_coherent(priv->dev, SZ_4K, 56 - priv->rdma.addr, priv->rdma.addr_phys); 56 + priv->rdma.addr, priv->rdma.addr_dma); 57 57 58 58 priv->rdma.addr = NULL; 59 - priv->rdma.addr_phys = (dma_addr_t)NULL; 59 + priv->rdma.addr_dma = (dma_addr_t)0; 60 60 } 61 61 62 62 void meson_rdma_setup(struct meson_drm *priv) ··· 118 118 meson_rdma_stop(priv); 119 119 120 120 /* Start of Channel 1 register writes buffer */ 121 - writel(priv->rdma.addr_phys, 121 + writel(priv->rdma.addr_dma, 122 122 priv->io_base + _REG(RDMA_AHB_START_ADDR_1)); 123 123 124 124 /* Last byte on Channel 1 register writes buffer */ 125 - writel(priv->rdma.addr_phys + (priv->rdma.offset * RDMA_DESC_SIZE) - 1, 125 + writel(priv->rdma.addr_dma + (priv->rdma.offset * RDMA_DESC_SIZE) - 1, 126 126 priv->io_base + _REG(RDMA_AHB_END_ADDR_1)); 127 127 128 128 /* Trigger Channel 1 on VSYNC event */
+1 -2
drivers/gpu/drm/omapdrm/dss/dispc.c
··· 393 393 enum dispc_feat_reg_field id, 394 394 u8 *start, u8 *end) 395 395 { 396 - if (id >= dispc->feat->num_reg_fields) 397 - BUG(); 396 + BUG_ON(id >= dispc->feat->num_reg_fields); 398 397 399 398 *start = dispc->feat->reg_fields[id].start; 400 399 *end = dispc->feat->reg_fields[id].end;
+11
drivers/gpu/drm/panel/Kconfig
··· 338 338 Say Y here if you want to enable support for the Sitronix 339 339 ST7789V controller for 240x320 LCD panels 340 340 341 + config DRM_PANEL_SONY_ACX424AKP 342 + tristate "Sony ACX424AKP DSI command mode panel" 343 + depends on OF 344 + depends on DRM_MIPI_DSI 345 + depends on BACKLIGHT_CLASS_DEVICE 346 + select VIDEOMODE_HELPERS 347 + help 348 + Say Y here if you want to enable the Sony ACX424 display 349 + panel. This panel supports DSI in both command and video 350 + mode. 351 + 341 352 config DRM_PANEL_SONY_ACX565AKM 342 353 tristate "Sony ACX565AKM panel" 343 354 depends on GPIOLIB && OF && SPI
+1
drivers/gpu/drm/panel/Makefile
··· 35 35 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o 36 36 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o 37 37 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o 38 + obj-$(CONFIG_DRM_PANEL_SONY_ACX424AKP) += panel-sony-acx424akp.o 38 39 obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o 39 40 obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o 40 41 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
+94
drivers/gpu/drm/panel/panel-simple.c
··· 629 629 }, 630 630 }; 631 631 632 + static const struct drm_display_mode auo_b116xak01_mode = { 633 + .clock = 69300, 634 + .hdisplay = 1366, 635 + .hsync_start = 1366 + 48, 636 + .hsync_end = 1366 + 48 + 32, 637 + .htotal = 1366 + 48 + 32 + 10, 638 + .vdisplay = 768, 639 + .vsync_start = 768 + 4, 640 + .vsync_end = 768 + 4 + 6, 641 + .vtotal = 768 + 4 + 6 + 15, 642 + .vrefresh = 60, 643 + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC, 644 + }; 645 + 646 + static const struct panel_desc auo_b116xak01 = { 647 + .modes = &auo_b116xak01_mode, 648 + .num_modes = 1, 649 + .bpc = 6, 650 + .size = { 651 + .width = 256, 652 + .height = 144, 653 + }, 654 + .delay = { 655 + .hpd_absent_delay = 200, 656 + }, 657 + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, 658 + .connector_type = DRM_MODE_CONNECTOR_eDP, 659 + }; 660 + 632 661 static const struct drm_display_mode auo_b116xw03_mode = { 633 662 .clock = 70589, 634 663 .hdisplay = 1366, ··· 1035 1006 .enable = 50, 1036 1007 .unprepare = 160, 1037 1008 }, 1009 + }; 1010 + 1011 + static const struct drm_display_mode boe_nv140fhmn49_modes[] = { 1012 + { 1013 + .clock = 148500, 1014 + .hdisplay = 1920, 1015 + .hsync_start = 1920 + 48, 1016 + .hsync_end = 1920 + 48 + 32, 1017 + .htotal = 2200, 1018 + .vdisplay = 1080, 1019 + .vsync_start = 1080 + 3, 1020 + .vsync_end = 1080 + 3 + 5, 1021 + .vtotal = 1125, 1022 + .vrefresh = 60, 1023 + }, 1024 + }; 1025 + 1026 + static const struct panel_desc boe_nv140fhmn49 = { 1027 + .modes = boe_nv140fhmn49_modes, 1028 + .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes), 1029 + .bpc = 6, 1030 + .size = { 1031 + .width = 309, 1032 + .height = 174, 1033 + }, 1034 + .delay = { 1035 + .prepare = 210, 1036 + .enable = 50, 1037 + .unprepare = 160, 1038 + }, 1039 + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, 1040 + .connector_type = DRM_MODE_CONNECTOR_eDP, 1038 1041 }; 1039 1042 1040 1043 static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = { ··· 2614 2553 }, 2615 2554 }; 2616 2555 2556 + static const struct display_timing satoz_sat050at40h12r2_timing = { 2557 + .pixelclock = {33300000, 33300000, 50000000}, 2558 + .hactive = {800, 800, 800}, 2559 + .hfront_porch = {16, 210, 354}, 2560 + .hback_porch = {46, 46, 46}, 2561 + .hsync_len = {1, 1, 40}, 2562 + .vactive = {480, 480, 480}, 2563 + .vfront_porch = {7, 22, 147}, 2564 + .vback_porch = {23, 23, 23}, 2565 + .vsync_len = {1, 1, 20}, 2566 + }; 2567 + 2568 + static const struct panel_desc satoz_sat050at40h12r2 = { 2569 + .timings = &satoz_sat050at40h12r2_timing, 2570 + .num_timings = 1, 2571 + .bpc = 8, 2572 + .size = { 2573 + .width = 108, 2574 + .height = 65, 2575 + }, 2576 + .bus_format = MEDIA_BUS_FMT_RGB888_1X24, 2577 + .connector_type = DRM_MODE_CONNECTOR_LVDS, 2578 + }; 2579 + 2617 2580 static const struct drm_display_mode sharp_ld_d5116z01b_mode = { 2618 2581 .clock = 168480, 2619 2582 .hdisplay = 1920, ··· 3211 3126 .compatible = "auo,b101xtn01", 3212 3127 .data = &auo_b101xtn01, 3213 3128 }, { 3129 + .compatible = "auo,b116xa01", 3130 + .data = &auo_b116xak01, 3131 + }, { 3214 3132 .compatible = "auo,b116xw03", 3215 3133 .data = &auo_b116xw03, 3216 3134 }, { ··· 3255 3167 }, { 3256 3168 .compatible = "boe,nv101wxmn51", 3257 3169 .data = &boe_nv101wxmn51, 3170 + }, { 3171 + .compatible = "boe,nv140fhmn49", 3172 + .data = &boe_nv140fhmn49, 3258 3173 }, { 3259 3174 .compatible = "cdtech,s043wq26h-ct7", 3260 3175 .data = &cdtech_s043wq26h_ct7, ··· 3447 3356 }, { 3448 3357 .compatible = "samsung,ltn140at29-301", 3449 3358 .data = &samsung_ltn140at29_301, 3359 + }, { 3360 + .compatible = "satoz,sat050at40h12r2", 3361 + .data = &satoz_sat050at40h12r2, 3450 3362 }, { 3451 3363 .compatible = "sharp,ld-d5116z01b", 3452 3364 .data = &sharp_ld_d5116z01b,
+550
drivers/gpu/drm/panel/panel-sony-acx424akp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * MIPI-DSI Sony ACX424AKP panel driver. This is a 480x864 4 + * AMOLED panel with a command-only DSI interface. 5 + * 6 + * Copyright (C) Linaro Ltd. 2019 7 + * Author: Linus Walleij 8 + * Based on code and know-how from Marcus Lorentzon 9 + * Copyright (C) ST-Ericsson SA 2010 10 + */ 11 + #include <linux/backlight.h> 12 + #include <linux/delay.h> 13 + #include <linux/gpio/consumer.h> 14 + #include <linux/module.h> 15 + #include <linux/of.h> 16 + #include <linux/regulator/consumer.h> 17 + 18 + #include <video/mipi_display.h> 19 + 20 + #include <drm/drm_mipi_dsi.h> 21 + #include <drm/drm_modes.h> 22 + #include <drm/drm_panel.h> 23 + #include <drm/drm_print.h> 24 + 25 + #define ACX424_DCS_READ_ID1 0xDA 26 + #define ACX424_DCS_READ_ID2 0xDB 27 + #define ACX424_DCS_READ_ID3 0xDC 28 + #define ACX424_DCS_SET_MDDI 0xAE 29 + 30 + /* 31 + * Sony seems to use vendor ID 0x81 32 + */ 33 + #define DISPLAY_SONY_ACX424AKP_ID1 0x811b 34 + #define DISPLAY_SONY_ACX424AKP_ID2 0x811a 35 + /* 36 + * The third ID looks like a bug, vendor IDs begin at 0x80 37 + * and panel 00 ... seems like default values. 38 + */ 39 + #define DISPLAY_SONY_ACX424AKP_ID3 0x8000 40 + 41 + struct acx424akp { 42 + struct drm_panel panel; 43 + struct device *dev; 44 + struct backlight_device *bl; 45 + struct regulator *supply; 46 + struct gpio_desc *reset_gpio; 47 + bool video_mode; 48 + }; 49 + 50 + static const struct drm_display_mode sony_acx424akp_vid_mode = { 51 + .clock = 330000, 52 + .hdisplay = 480, 53 + .hsync_start = 480 + 15, 54 + .hsync_end = 480 + 15 + 0, 55 + .htotal = 480 + 15 + 0 + 15, 56 + .vdisplay = 864, 57 + .vsync_start = 864 + 14, 58 + .vsync_end = 864 + 14 + 1, 59 + .vtotal = 864 + 14 + 1 + 11, 60 + .vrefresh = 60, 61 + .width_mm = 48, 62 + .height_mm = 84, 63 + .flags = DRM_MODE_FLAG_PVSYNC, 64 + }; 65 + 66 + /* 67 + * The timings are not very helpful as the display is used in 68 + * command mode using the maximum HS frequency. 69 + */ 70 + static const struct drm_display_mode sony_acx424akp_cmd_mode = { 71 + .clock = 420160, 72 + .hdisplay = 480, 73 + .hsync_start = 480 + 154, 74 + .hsync_end = 480 + 154 + 16, 75 + .htotal = 480 + 154 + 16 + 32, 76 + .vdisplay = 864, 77 + .vsync_start = 864 + 1, 78 + .vsync_end = 864 + 1 + 1, 79 + .vtotal = 864 + 1 + 1 + 1, 80 + /* 81 + * Some desired refresh rate, experiments at the maximum "pixel" 82 + * clock speed (HS clock 420 MHz) yields around 117Hz. 83 + */ 84 + .vrefresh = 60, 85 + .width_mm = 48, 86 + .height_mm = 84, 87 + }; 88 + 89 + static inline struct acx424akp *panel_to_acx424akp(struct drm_panel *panel) 90 + { 91 + return container_of(panel, struct acx424akp, panel); 92 + } 93 + 94 + #define FOSC 20 /* 20Mhz */ 95 + #define SCALE_FACTOR_NS_DIV_MHZ 1000 96 + 97 + static int acx424akp_set_brightness(struct backlight_device *bl) 98 + { 99 + struct acx424akp *acx = bl_get_data(bl); 100 + struct mipi_dsi_device *dsi = to_mipi_dsi_device(acx->dev); 101 + int period_ns = 1023; 102 + int duty_ns = bl->props.brightness; 103 + u8 pwm_ratio; 104 + u8 pwm_div; 105 + u8 par; 106 + int ret; 107 + 108 + /* Calculate the PWM duty cycle in n/256's */ 109 + pwm_ratio = max(((duty_ns * 256) / period_ns) - 1, 1); 110 + pwm_div = max(1, 111 + ((FOSC * period_ns) / 256) / 112 + SCALE_FACTOR_NS_DIV_MHZ); 113 + 114 + /* Set up PWM dutycycle ONE byte (differs from the standard) */ 115 + DRM_DEV_DEBUG(acx->dev, "calculated duty cycle %02x\n", pwm_ratio); 116 + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 117 + &pwm_ratio, 1); 118 + if (ret < 0) { 119 + DRM_DEV_ERROR(acx->dev, 120 + "failed to set display PWM ratio (%d)\n", 121 + ret); 122 + return ret; 123 + } 124 + 125 + /* 126 + * Sequence to write PWMDIV: 127 + * address data 128 + * 0xF3 0xAA CMD2 Unlock 129 + * 0x00 0x01 Enter CMD2 page 0 130 + * 0X7D 0x01 No reload MTP of CMD2 P1 131 + * 0x22 PWMDIV 132 + * 0x7F 0xAA CMD2 page 1 lock 133 + */ 134 + par = 0xaa; 135 + ret = mipi_dsi_dcs_write(dsi, 0xf3, &par, 1); 136 + if (ret < 0) { 137 + DRM_DEV_ERROR(acx->dev, 138 + "failed to unlock CMD 2 (%d)\n", 139 + ret); 140 + return ret; 141 + } 142 + par = 0x01; 143 + ret = mipi_dsi_dcs_write(dsi, 0x00, &par, 1); 144 + if (ret < 0) { 145 + DRM_DEV_ERROR(acx->dev, 146 + "failed to enter page 1 (%d)\n", 147 + ret); 148 + return ret; 149 + } 150 + par = 0x01; 151 + ret = mipi_dsi_dcs_write(dsi, 0x7d, &par, 1); 152 + if (ret < 0) { 153 + DRM_DEV_ERROR(acx->dev, 154 + "failed to disable MTP reload (%d)\n", 155 + ret); 156 + return ret; 157 + } 158 + ret = mipi_dsi_dcs_write(dsi, 0x22, &pwm_div, 1); 159 + if (ret < 0) { 160 + DRM_DEV_ERROR(acx->dev, 161 + "failed to set PWM divisor (%d)\n", 162 + ret); 163 + return ret; 164 + } 165 + par = 0xaa; 166 + ret = mipi_dsi_dcs_write(dsi, 0x7f, &par, 1); 167 + if (ret < 0) { 168 + DRM_DEV_ERROR(acx->dev, 169 + "failed to lock CMD 2 (%d)\n", 170 + ret); 171 + return ret; 172 + } 173 + 174 + /* Enable backlight */ 175 + par = 0x24; 176 + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 177 + &par, 1); 178 + if (ret < 0) { 179 + DRM_DEV_ERROR(acx->dev, 180 + "failed to enable display backlight (%d)\n", 181 + ret); 182 + return ret; 183 + } 184 + 185 + return 0; 186 + } 187 + 188 + static const struct backlight_ops acx424akp_bl_ops = { 189 + .update_status = acx424akp_set_brightness, 190 + }; 191 + 192 + static int acx424akp_read_id(struct acx424akp *acx) 193 + { 194 + struct mipi_dsi_device *dsi = to_mipi_dsi_device(acx->dev); 195 + u8 vendor, version, panel; 196 + u16 val; 197 + int ret; 198 + 199 + ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID1, &vendor, 1); 200 + if (ret < 0) { 201 + DRM_DEV_ERROR(acx->dev, "could not vendor ID byte\n"); 202 + return ret; 203 + } 204 + ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID2, &version, 1); 205 + if (ret < 0) { 206 + DRM_DEV_ERROR(acx->dev, "could not read device version byte\n"); 207 + return ret; 208 + } 209 + ret = mipi_dsi_dcs_read(dsi, ACX424_DCS_READ_ID3, &panel, 1); 210 + if (ret < 0) { 211 + DRM_DEV_ERROR(acx->dev, "could not read panel ID byte\n"); 212 + return ret; 213 + } 214 + 215 + if (vendor == 0x00) { 216 + DRM_DEV_ERROR(acx->dev, "device vendor ID is zero\n"); 217 + return -ENODEV; 218 + } 219 + 220 + val = (vendor << 8) | panel; 221 + switch (val) { 222 + case DISPLAY_SONY_ACX424AKP_ID1: 223 + case DISPLAY_SONY_ACX424AKP_ID2: 224 + case DISPLAY_SONY_ACX424AKP_ID3: 225 + DRM_DEV_INFO(acx->dev, 226 + "MTP vendor: %02x, version: %02x, panel: %02x\n", 227 + vendor, version, panel); 228 + break; 229 + default: 230 + DRM_DEV_INFO(acx->dev, 231 + "unknown vendor: %02x, version: %02x, panel: %02x\n", 232 + vendor, version, panel); 233 + break; 234 + } 235 + 236 + return 0; 237 + } 238 + 239 + static int acx424akp_power_on(struct acx424akp *acx) 240 + { 241 + int ret; 242 + 243 + ret = regulator_enable(acx->supply); 244 + if (ret) { 245 + DRM_DEV_ERROR(acx->dev, "failed to enable supply (%d)\n", ret); 246 + return ret; 247 + } 248 + 249 + /* Assert RESET */ 250 + gpiod_set_value_cansleep(acx->reset_gpio, 1); 251 + udelay(20); 252 + /* De-assert RESET */ 253 + gpiod_set_value_cansleep(acx->reset_gpio, 0); 254 + usleep_range(11000, 20000); 255 + 256 + return 0; 257 + } 258 + 259 + static void acx424akp_power_off(struct acx424akp *acx) 260 + { 261 + /* Assert RESET */ 262 + gpiod_set_value_cansleep(acx->reset_gpio, 1); 263 + usleep_range(11000, 20000); 264 + 265 + regulator_disable(acx->supply); 266 + } 267 + 268 + static int acx424akp_prepare(struct drm_panel *panel) 269 + { 270 + struct acx424akp *acx = panel_to_acx424akp(panel); 271 + struct mipi_dsi_device *dsi = to_mipi_dsi_device(acx->dev); 272 + const u8 mddi = 3; 273 + int ret; 274 + 275 + ret = acx424akp_power_on(acx); 276 + if (ret) 277 + return ret; 278 + 279 + ret = acx424akp_read_id(acx); 280 + if (ret) { 281 + DRM_DEV_ERROR(acx->dev, "failed to read panel ID (%d)\n", ret); 282 + goto err_power_off; 283 + } 284 + 285 + /* Enabe tearing mode: send TE (tearing effect) at VBLANK */ 286 + ret = mipi_dsi_dcs_set_tear_on(dsi, 287 + MIPI_DSI_DCS_TEAR_MODE_VBLANK); 288 + if (ret) { 289 + DRM_DEV_ERROR(acx->dev, "failed to enable vblank TE (%d)\n", 290 + ret); 291 + goto err_power_off; 292 + } 293 + 294 + /* 295 + * Set MDDI 296 + * 297 + * This presumably deactivates the Qualcomm MDDI interface and 298 + * selects DSI, similar code is found in other drivers such as the 299 + * Sharp LS043T1LE01 which makes us suspect that this panel may be 300 + * using a Novatek NT35565 or similar display driver chip that shares 301 + * this command. Due to the lack of documentation we cannot know for 302 + * sure. 303 + */ 304 + ret = mipi_dsi_dcs_write(dsi, ACX424_DCS_SET_MDDI, 305 + &mddi, sizeof(mddi)); 306 + if (ret < 0) { 307 + DRM_DEV_ERROR(acx->dev, "failed to set MDDI (%d)\n", ret); 308 + goto err_power_off; 309 + } 310 + 311 + /* Exit sleep mode */ 312 + ret = mipi_dsi_dcs_exit_sleep_mode(dsi); 313 + if (ret) { 314 + DRM_DEV_ERROR(acx->dev, "failed to exit sleep mode (%d)\n", 315 + ret); 316 + goto err_power_off; 317 + } 318 + msleep(140); 319 + 320 + ret = mipi_dsi_dcs_set_display_on(dsi); 321 + if (ret) { 322 + DRM_DEV_ERROR(acx->dev, "failed to turn display on (%d)\n", 323 + ret); 324 + goto err_power_off; 325 + } 326 + if (acx->video_mode) { 327 + /* In video mode turn peripheral on */ 328 + ret = mipi_dsi_turn_on_peripheral(dsi); 329 + if (ret) { 330 + dev_err(acx->dev, "failed to turn on peripheral\n"); 331 + goto err_power_off; 332 + } 333 + } 334 + 335 + acx->bl->props.power = FB_BLANK_NORMAL; 336 + 337 + return 0; 338 + 339 + err_power_off: 340 + acx424akp_power_off(acx); 341 + return ret; 342 + } 343 + 344 + static int acx424akp_unprepare(struct drm_panel *panel) 345 + { 346 + struct acx424akp *acx = panel_to_acx424akp(panel); 347 + struct mipi_dsi_device *dsi = to_mipi_dsi_device(acx->dev); 348 + u8 par; 349 + int ret; 350 + 351 + /* Disable backlight */ 352 + par = 0x00; 353 + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 354 + &par, 1); 355 + if (ret) { 356 + DRM_DEV_ERROR(acx->dev, 357 + "failed to disable display backlight (%d)\n", 358 + ret); 359 + return ret; 360 + } 361 + 362 + ret = mipi_dsi_dcs_set_display_off(dsi); 363 + if (ret) { 364 + DRM_DEV_ERROR(acx->dev, "failed to turn display off (%d)\n", 365 + ret); 366 + return ret; 367 + } 368 + 369 + /* Enter sleep mode */ 370 + ret = mipi_dsi_dcs_enter_sleep_mode(dsi); 371 + if (ret) { 372 + DRM_DEV_ERROR(acx->dev, "failed to enter sleep mode (%d)\n", 373 + ret); 374 + return ret; 375 + } 376 + msleep(85); 377 + 378 + acx424akp_power_off(acx); 379 + acx->bl->props.power = FB_BLANK_POWERDOWN; 380 + 381 + return 0; 382 + } 383 + 384 + static int acx424akp_enable(struct drm_panel *panel) 385 + { 386 + struct acx424akp *acx = panel_to_acx424akp(panel); 387 + 388 + /* 389 + * The backlight is on as long as the display is on 390 + * so no use to call backlight_enable() here. 391 + */ 392 + acx->bl->props.power = FB_BLANK_UNBLANK; 393 + 394 + return 0; 395 + } 396 + 397 + static int acx424akp_disable(struct drm_panel *panel) 398 + { 399 + struct acx424akp *acx = panel_to_acx424akp(panel); 400 + 401 + /* 402 + * The backlight is on as long as the display is on 403 + * so no use to call backlight_disable() here. 404 + */ 405 + acx->bl->props.power = FB_BLANK_NORMAL; 406 + 407 + return 0; 408 + } 409 + 410 + static int acx424akp_get_modes(struct drm_panel *panel, 411 + struct drm_connector *connector) 412 + { 413 + struct acx424akp *acx = panel_to_acx424akp(panel); 414 + struct drm_display_mode *mode; 415 + 416 + if (acx->video_mode) 417 + mode = drm_mode_duplicate(connector->dev, 418 + &sony_acx424akp_vid_mode); 419 + else 420 + mode = drm_mode_duplicate(connector->dev, 421 + &sony_acx424akp_cmd_mode); 422 + if (!mode) { 423 + DRM_ERROR("bad mode or failed to add mode\n"); 424 + return -EINVAL; 425 + } 426 + drm_mode_set_name(mode); 427 + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; 428 + 429 + connector->display_info.width_mm = mode->width_mm; 430 + connector->display_info.height_mm = mode->height_mm; 431 + 432 + drm_mode_probed_add(connector, mode); 433 + 434 + return 1; /* Number of modes */ 435 + } 436 + 437 + static const struct drm_panel_funcs acx424akp_drm_funcs = { 438 + .disable = acx424akp_disable, 439 + .unprepare = acx424akp_unprepare, 440 + .prepare = acx424akp_prepare, 441 + .enable = acx424akp_enable, 442 + .get_modes = acx424akp_get_modes, 443 + }; 444 + 445 + static int acx424akp_probe(struct mipi_dsi_device *dsi) 446 + { 447 + struct device *dev = &dsi->dev; 448 + struct acx424akp *acx; 449 + int ret; 450 + 451 + acx = devm_kzalloc(dev, sizeof(struct acx424akp), GFP_KERNEL); 452 + if (!acx) 453 + return -ENOMEM; 454 + acx->video_mode = of_property_read_bool(dev->of_node, 455 + "enforce-video-mode"); 456 + 457 + mipi_dsi_set_drvdata(dsi, acx); 458 + acx->dev = dev; 459 + 460 + dsi->lanes = 2; 461 + dsi->format = MIPI_DSI_FMT_RGB888; 462 + /* 463 + * FIXME: these come from the ST-Ericsson vendor driver for the 464 + * HREF520 and seems to reflect limitations in the PLLs on that 465 + * platform, if you have the datasheet, please cross-check the 466 + * actual max rates. 467 + */ 468 + dsi->lp_rate = 19200000; 469 + dsi->hs_rate = 420160000; 470 + 471 + if (acx->video_mode) 472 + /* Burst mode using event for sync */ 473 + dsi->mode_flags = 474 + MIPI_DSI_MODE_VIDEO | 475 + MIPI_DSI_MODE_VIDEO_BURST; 476 + else 477 + dsi->mode_flags = 478 + MIPI_DSI_CLOCK_NON_CONTINUOUS | 479 + MIPI_DSI_MODE_EOT_PACKET; 480 + 481 + acx->supply = devm_regulator_get(dev, "vddi"); 482 + if (IS_ERR(acx->supply)) 483 + return PTR_ERR(acx->supply); 484 + 485 + /* This asserts RESET by default */ 486 + acx->reset_gpio = devm_gpiod_get_optional(dev, "reset", 487 + GPIOD_OUT_HIGH); 488 + if (IS_ERR(acx->reset_gpio)) { 489 + ret = PTR_ERR(acx->reset_gpio); 490 + if (ret != -EPROBE_DEFER) 491 + DRM_DEV_ERROR(dev, "failed to request GPIO (%d)\n", 492 + ret); 493 + return ret; 494 + } 495 + 496 + drm_panel_init(&acx->panel, dev, &acx424akp_drm_funcs, 497 + DRM_MODE_CONNECTOR_DSI); 498 + 499 + acx->bl = devm_backlight_device_register(dev, "acx424akp", dev, acx, 500 + &acx424akp_bl_ops, NULL); 501 + if (IS_ERR(acx->bl)) { 502 + DRM_DEV_ERROR(dev, "failed to register backlight device\n"); 503 + return PTR_ERR(acx->bl); 504 + } 505 + acx->bl->props.max_brightness = 1023; 506 + acx->bl->props.brightness = 512; 507 + acx->bl->props.power = FB_BLANK_POWERDOWN; 508 + 509 + ret = drm_panel_add(&acx->panel); 510 + if (ret < 0) 511 + return ret; 512 + 513 + ret = mipi_dsi_attach(dsi); 514 + if (ret < 0) { 515 + drm_panel_remove(&acx->panel); 516 + return ret; 517 + } 518 + 519 + return 0; 520 + } 521 + 522 + static int acx424akp_remove(struct mipi_dsi_device *dsi) 523 + { 524 + struct acx424akp *acx = mipi_dsi_get_drvdata(dsi); 525 + 526 + mipi_dsi_detach(dsi); 527 + drm_panel_remove(&acx->panel); 528 + 529 + return 0; 530 + } 531 + 532 + static const struct of_device_id acx424akp_of_match[] = { 533 + { .compatible = "sony,acx424akp" }, 534 + { /* sentinel */ } 535 + }; 536 + MODULE_DEVICE_TABLE(of, acx424akp_of_match); 537 + 538 + static struct mipi_dsi_driver acx424akp_driver = { 539 + .probe = acx424akp_probe, 540 + .remove = acx424akp_remove, 541 + .driver = { 542 + .name = "panel-sony-acx424akp", 543 + .of_match_table = acx424akp_of_match, 544 + }, 545 + }; 546 + module_mipi_dsi_driver(acx424akp_driver); 547 + 548 + MODULE_AUTHOR("Linus Wallei <linus.walleij@linaro.org>"); 549 + MODULE_DESCRIPTION("MIPI-DSI Sony acx424akp Panel Driver"); 550 + MODULE_LICENSE("GPL v2");
+3 -5
drivers/gpu/drm/rcar-du/rcar_lvds.c
··· 590 590 } 591 591 592 592 static void rcar_lvds_atomic_enable(struct drm_bridge *bridge, 593 - struct drm_bridge_state *old_bridge_state) 593 + struct drm_atomic_state *state) 594 594 { 595 - struct drm_atomic_state *state = old_bridge_state->base.state; 596 595 struct drm_connector *connector; 597 596 struct drm_crtc *crtc; 598 597 ··· 603 604 } 604 605 605 606 static void rcar_lvds_atomic_disable(struct drm_bridge *bridge, 606 - struct drm_bridge_state *old_bridge_state) 607 + struct drm_atomic_state *state) 607 608 { 608 609 struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge); 609 610 ··· 618 619 619 620 /* Disable the companion LVDS encoder in dual-link mode. */ 620 621 if (lvds->link_type != RCAR_LVDS_SINGLE_LINK && lvds->companion) 621 - lvds->companion->funcs->atomic_disable(lvds->companion, 622 - old_bridge_state); 622 + lvds->companion->funcs->atomic_disable(lvds->companion, state); 623 623 624 624 clk_disable_unprepare(lvds->clocks.mod); 625 625 }
+9
drivers/gpu/drm/sun4i/sun4i_backend.c
··· 856 856 ret = PTR_ERR(backend->mod_clk); 857 857 goto err_disable_bus_clk; 858 858 } 859 + 860 + ret = clk_set_rate_exclusive(backend->mod_clk, 300000000); 861 + if (ret) { 862 + dev_err(dev, "Couldn't set the module clock frequency\n"); 863 + goto err_disable_bus_clk; 864 + } 865 + 859 866 clk_prepare_enable(backend->mod_clk); 860 867 861 868 backend->ram_clk = devm_clk_get(dev, "ram"); ··· 939 932 err_disable_ram_clk: 940 933 clk_disable_unprepare(backend->ram_clk); 941 934 err_disable_mod_clk: 935 + clk_rate_exclusive_put(backend->mod_clk); 942 936 clk_disable_unprepare(backend->mod_clk); 943 937 err_disable_bus_clk: 944 938 clk_disable_unprepare(backend->bus_clk); ··· 960 952 sun4i_backend_free_sat(dev); 961 953 962 954 clk_disable_unprepare(backend->ram_clk); 955 + clk_rate_exclusive_put(backend->mod_clk); 963 956 clk_disable_unprepare(backend->mod_clk); 964 957 clk_disable_unprepare(backend->bus_clk); 965 958 reset_control_assert(backend->reset);
+8
drivers/gpu/drm/sun4i/sun6i_drc.c
··· 56 56 ret = PTR_ERR(drc->mod_clk); 57 57 goto err_disable_bus_clk; 58 58 } 59 + 60 + ret = clk_set_rate_exclusive(drc->mod_clk, 300000000); 61 + if (ret) { 62 + dev_err(dev, "Couldn't set the module clock frequency\n"); 63 + goto err_disable_bus_clk; 64 + } 65 + 59 66 clk_prepare_enable(drc->mod_clk); 60 67 61 68 return 0; ··· 79 72 { 80 73 struct sun6i_drc *drc = dev_get_drvdata(dev); 81 74 75 + clk_rate_exclusive_put(drc->mod_clk); 82 76 clk_disable_unprepare(drc->mod_clk); 83 77 clk_disable_unprepare(drc->bus_clk); 84 78 reset_control_assert(drc->reset);
+4 -3
drivers/gpu/drm/tegra/hdmi.c
··· 1430 1430 1431 1431 hdmi->output.dev = client->dev; 1432 1432 1433 - drm_connector_init(drm, &hdmi->output.connector, 1434 - &tegra_hdmi_connector_funcs, 1435 - DRM_MODE_CONNECTOR_HDMIA); 1433 + drm_connector_init_with_ddc(drm, &hdmi->output.connector, 1434 + &tegra_hdmi_connector_funcs, 1435 + DRM_MODE_CONNECTOR_HDMIA, 1436 + hdmi->output.ddc); 1436 1437 drm_connector_helper_add(&hdmi->output.connector, 1437 1438 &tegra_hdmi_connector_helper_funcs); 1438 1439 hdmi->output.connector.dpms = DRM_MODE_DPMS_OFF;
+4 -3
drivers/gpu/drm/tegra/sor.c
··· 3086 3086 3087 3087 sor->output.dev = sor->dev; 3088 3088 3089 - drm_connector_init(drm, &sor->output.connector, 3090 - &tegra_sor_connector_funcs, 3091 - connector); 3089 + drm_connector_init_with_ddc(drm, &sor->output.connector, 3090 + &tegra_sor_connector_funcs, 3091 + connector, 3092 + sor->output.ddc); 3092 3093 drm_connector_helper_add(&sor->output.connector, 3093 3094 &tegra_sor_connector_helper_funcs); 3094 3095 sor->output.connector.dpms = DRM_MODE_DPMS_OFF;
+1 -2
drivers/gpu/drm/udl/Kconfig
··· 2 2 config DRM_UDL 3 3 tristate "DisplayLink" 4 4 depends on DRM 5 - depends on USB_SUPPORT 5 + depends on USB 6 6 depends on USB_ARCH_HAS_HCD 7 - select USB 8 7 select DRM_GEM_SHMEM_HELPER 9 8 select DRM_KMS_HELPER 10 9 help
+22 -6
drivers/gpu/drm/vc4/vc4_dsi.c
··· 753 753 struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder); 754 754 struct vc4_dsi *dsi = vc4_encoder->dsi; 755 755 struct device *dev = &dsi->pdev->dev; 756 + struct drm_bridge *iter; 756 757 757 - drm_bridge_chain_disable(dsi->bridge); 758 + list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { 759 + if (iter->funcs->disable) 760 + iter->funcs->disable(iter); 761 + } 762 + 758 763 vc4_dsi_ulps(dsi, true); 759 - drm_bridge_chain_post_disable(dsi->bridge); 764 + 765 + list_for_each_entry_from(iter, &dsi->bridge_chain, chain_node) { 766 + if (iter->funcs->post_disable) 767 + iter->funcs->post_disable(iter); 768 + } 760 769 761 770 clk_disable_unprepare(dsi->pll_phy_clock); 762 771 clk_disable_unprepare(dsi->escape_clock); ··· 833 824 struct vc4_dsi *dsi = vc4_encoder->dsi; 834 825 struct device *dev = &dsi->pdev->dev; 835 826 bool debug_dump_regs = false; 827 + struct drm_bridge *iter; 836 828 unsigned long hs_clock; 837 829 u32 ui_ns; 838 830 /* Minimum LP state duration in escape clock cycles. */ ··· 1066 1056 1067 1057 vc4_dsi_ulps(dsi, false); 1068 1058 1069 - drm_bridge_chain_pre_enable(dsi->bridge); 1059 + list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) { 1060 + if (iter->funcs->pre_enable) 1061 + iter->funcs->pre_enable(iter); 1062 + } 1070 1063 1071 1064 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { 1072 1065 DSI_PORT_WRITE(DISP0_CTRL, ··· 1086 1073 DSI_DISP0_ENABLE); 1087 1074 } 1088 1075 1089 - drm_bridge_chain_enable(dsi->bridge); 1076 + list_for_each_entry(iter, &dsi->bridge_chain, chain_node) { 1077 + if (iter->funcs->enable) 1078 + iter->funcs->enable(iter); 1079 + } 1090 1080 1091 1081 if (debug_dump_regs) { 1092 1082 struct drm_printer p = drm_info_printer(&dsi->pdev->dev); ··· 1629 1613 * from our driver, since we need to sequence them within the 1630 1614 * encoder's enable/disable paths. 1631 1615 */ 1632 - list_splice(&dsi->encoder->bridge_chain, &dsi->bridge_chain); 1616 + list_splice_init(&dsi->encoder->bridge_chain, &dsi->bridge_chain); 1633 1617 1634 1618 if (dsi->port == 0) 1635 1619 vc4_debugfs_add_regset32(drm, "dsi0_regs", &dsi->regset); ··· 1655 1639 * Restore the bridge_chain so the bridge detach procedure can happen 1656 1640 * normally. 1657 1641 */ 1658 - list_splice(&dsi->bridge_chain, &dsi->encoder->bridge_chain); 1642 + list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain); 1659 1643 vc4_dsi_encoder_destroy(dsi->encoder); 1660 1644 1661 1645 if (dsi->port == 1)
+8 -4
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 267 267 }; 268 268 269 269 static struct drm_connector *vc4_hdmi_connector_init(struct drm_device *dev, 270 - struct drm_encoder *encoder) 270 + struct drm_encoder *encoder, 271 + struct i2c_adapter *ddc) 271 272 { 272 273 struct drm_connector *connector; 273 274 struct vc4_hdmi_connector *hdmi_connector; ··· 282 281 283 282 hdmi_connector->encoder = encoder; 284 283 285 - drm_connector_init(dev, connector, &vc4_hdmi_connector_funcs, 286 - DRM_MODE_CONNECTOR_HDMIA); 284 + drm_connector_init_with_ddc(dev, connector, 285 + &vc4_hdmi_connector_funcs, 286 + DRM_MODE_CONNECTOR_HDMIA, 287 + ddc); 287 288 drm_connector_helper_add(connector, &vc4_hdmi_connector_helper_funcs); 288 289 289 290 /* Create and attach TV margin props to this connector. */ ··· 1398 1395 DRM_MODE_ENCODER_TMDS, NULL); 1399 1396 drm_encoder_helper_add(hdmi->encoder, &vc4_hdmi_encoder_helper_funcs); 1400 1397 1401 - hdmi->connector = vc4_hdmi_connector_init(drm, hdmi->encoder); 1398 + hdmi->connector = 1399 + vc4_hdmi_connector_init(drm, hdmi->encoder, hdmi->ddc); 1402 1400 if (IS_ERR(hdmi->connector)) { 1403 1401 ret = PTR_ERR(hdmi->connector); 1404 1402 goto err_destroy_encoder;
+4 -2
drivers/gpu/drm/zte/zx_hdmi.c
··· 319 319 320 320 hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD; 321 321 322 - drm_connector_init(drm, &hdmi->connector, &zx_hdmi_connector_funcs, 323 - DRM_MODE_CONNECTOR_HDMIA); 322 + drm_connector_init_with_ddc(drm, &hdmi->connector, 323 + &zx_hdmi_connector_funcs, 324 + DRM_MODE_CONNECTOR_HDMIA, 325 + &hdmi->ddc->adap); 324 326 drm_connector_helper_add(&hdmi->connector, 325 327 &zx_hdmi_connector_helper_funcs); 326 328
+4 -2
drivers/gpu/drm/zte/zx_vga.c
··· 165 165 166 166 vga->connector.polled = DRM_CONNECTOR_POLL_HPD; 167 167 168 - ret = drm_connector_init(drm, connector, &zx_vga_connector_funcs, 169 - DRM_MODE_CONNECTOR_VGA); 168 + ret = drm_connector_init_with_ddc(drm, connector, 169 + &zx_vga_connector_funcs, 170 + DRM_MODE_CONNECTOR_VGA, 171 + &vga->ddc->adap); 170 172 if (ret) { 171 173 DRM_DEV_ERROR(dev, "failed to init connector: %d\n", ret); 172 174 goto clean_encoder;
-1
drivers/video/fbdev/mmp/hw/mmp_ctrl.c
··· 456 456 457 457 irq = platform_get_irq(pdev, 0); 458 458 if (irq < 0) { 459 - dev_err(&pdev->dev, "%s: no IRQ defined\n", __func__); 460 459 ret = -ENOENT; 461 460 goto failed; 462 461 }
-3
include/drm/drm_atomic.h
··· 670 670 } 671 671 672 672 int __must_check 673 - drm_atomic_add_encoder_bridges(struct drm_atomic_state *state, 674 - struct drm_encoder *encoder); 675 - int __must_check 676 673 drm_atomic_add_affected_connectors(struct drm_atomic_state *state, 677 674 struct drm_crtc *crtc); 678 675 int __must_check
+5 -270
include/drm/drm_bridge.h
··· 25 25 26 26 #include <linux/list.h> 27 27 #include <linux/ctype.h> 28 - 29 - #include <drm/drm_atomic.h> 30 28 #include <drm/drm_encoder.h> 31 29 #include <drm/drm_mode_object.h> 32 30 #include <drm/drm_modes.h> ··· 32 34 struct drm_bridge; 33 35 struct drm_bridge_timings; 34 36 struct drm_panel; 35 - 36 - /** 37 - * struct drm_bus_cfg - bus configuration 38 - * 39 - * This structure stores the configuration of a physical bus between two 40 - * components in an output pipeline, usually between two bridges, an encoder 41 - * and a bridge, or a bridge and a connector. 42 - * 43 - * The bus configuration is stored in &drm_bridge_state separately for the 44 - * input and output buses, as seen from the point of view of each bridge. The 45 - * bus configuration of a bridge output is usually identical to the 46 - * configuration of the next bridge's input, but may differ if the signals are 47 - * modified between the two bridges, for instance by an inverter on the board. 48 - * The input and output configurations of a bridge may differ if the bridge 49 - * modifies the signals internally, for instance by performing format 50 - * conversion, or modifying signals polarities. 51 - */ 52 - struct drm_bus_cfg { 53 - /** 54 - * @format: format used on this bus (one of the MEDIA_BUS_FMT_* format) 55 - * 56 - * This field should not be directly modified by drivers 57 - * (&drm_atomic_bridge_chain_select_bus_fmts() takes care of the bus 58 - * format negotiation). 59 - */ 60 - u32 format; 61 - 62 - /** 63 - * @flags: DRM_BUS_* flags used on this bus 64 - */ 65 - u32 flags; 66 - }; 67 - 68 - /** 69 - * struct drm_bridge_state - Atomic bridge state object 70 - * @base: inherit from &drm_private_state 71 - * @bridge: the bridge this state refers to 72 - */ 73 - struct drm_bridge_state { 74 - struct drm_private_state base; 75 - 76 - struct drm_bridge *bridge; 77 - 78 - /** 79 - * @input_bus_cfg: input bus configuration 80 - */ 81 - struct drm_bus_cfg input_bus_cfg; 82 - 83 - /** 84 - * @output_bus_cfg: input bus configuration 85 - */ 86 - struct drm_bus_cfg output_bus_cfg; 87 - }; 88 - 89 - static inline struct drm_bridge_state * 90 - drm_priv_to_bridge_state(struct drm_private_state *priv) 91 - { 92 - return container_of(priv, struct drm_bridge_state, base); 93 - } 94 37 95 38 /** 96 39 * struct drm_bridge_funcs - drm_bridge control functions ··· 109 170 * this function passes all other callbacks must succeed for this 110 171 * configuration. 111 172 * 112 - * The mode_fixup callback is optional. &drm_bridge_funcs.mode_fixup() 113 - * is not called when &drm_bridge_funcs.atomic_check() is implemented, 114 - * so only one of them should be provided. 173 + * The @mode_fixup callback is optional. 115 174 * 116 175 * NOTE: 117 176 * ··· 263 326 * The @atomic_pre_enable callback is optional. 264 327 */ 265 328 void (*atomic_pre_enable)(struct drm_bridge *bridge, 266 - struct drm_bridge_state *old_bridge_state); 329 + struct drm_atomic_state *old_state); 267 330 268 331 /** 269 332 * @atomic_enable: ··· 288 351 * The @atomic_enable callback is optional. 289 352 */ 290 353 void (*atomic_enable)(struct drm_bridge *bridge, 291 - struct drm_bridge_state *old_bridge_state); 354 + struct drm_atomic_state *old_state); 292 355 /** 293 356 * @atomic_disable: 294 357 * ··· 311 374 * The @atomic_disable callback is optional. 312 375 */ 313 376 void (*atomic_disable)(struct drm_bridge *bridge, 314 - struct drm_bridge_state *old_bridge_state); 377 + struct drm_atomic_state *old_state); 315 378 316 379 /** 317 380 * @atomic_post_disable: ··· 337 400 * The @atomic_post_disable callback is optional. 338 401 */ 339 402 void (*atomic_post_disable)(struct drm_bridge *bridge, 340 - struct drm_bridge_state *old_bridge_state); 341 - 342 - /** 343 - * @atomic_duplicate_state: 344 - * 345 - * Duplicate the current bridge state object (which is guaranteed to be 346 - * non-NULL). 347 - * 348 - * The atomic_duplicate_state() is optional. When not implemented the 349 - * core allocates a drm_bridge_state object and calls 350 - * &__drm_atomic_helper_bridge_duplicate_state() to initialize it. 351 - * 352 - * RETURNS: 353 - * A valid drm_bridge_state object or NULL if the allocation fails. 354 - */ 355 - struct drm_bridge_state *(*atomic_duplicate_state)(struct drm_bridge *bridge); 356 - 357 - /** 358 - * @atomic_destroy_state: 359 - * 360 - * Destroy a bridge state object previously allocated by 361 - * &drm_bridge_funcs.atomic_duplicate_state(). 362 - * 363 - * The atomic_destroy_state hook is optional. When not implemented the 364 - * core calls kfree() on the state. 365 - */ 366 - void (*atomic_destroy_state)(struct drm_bridge *bridge, 367 - struct drm_bridge_state *state); 368 - 369 - /** 370 - * @atomic_get_output_bus_fmts: 371 - * 372 - * Return the supported bus formats on the output end of a bridge. 373 - * The returned array must be allocated with kmalloc() and will be 374 - * freed by the caller. If the allocation fails, NULL should be 375 - * returned. num_output_fmts must be set to the returned array size. 376 - * Formats listed in the returned array should be listed in decreasing 377 - * preference order (the core will try all formats until it finds one 378 - * that works). 379 - * 380 - * This method is only called on the last element of the bridge chain 381 - * as part of the bus format negotiation process that happens in 382 - * &drm_atomic_bridge_chain_select_bus_fmts(). 383 - * This method is optional. When not implemented, the core will 384 - * fall back to &drm_connector.display_info.bus_formats[0] if 385 - * &drm_connector.display_info.num_bus_formats > 0, 386 - * or to MEDIA_BUS_FMT_FIXED otherwise. 387 - */ 388 - u32 *(*atomic_get_output_bus_fmts)(struct drm_bridge *bridge, 389 - struct drm_bridge_state *bridge_state, 390 - struct drm_crtc_state *crtc_state, 391 - struct drm_connector_state *conn_state, 392 - unsigned int *num_output_fmts); 393 - 394 - /** 395 - * @atomic_get_input_bus_fmts: 396 - * 397 - * Return the supported bus formats on the input end of a bridge for 398 - * a specific output bus format. 399 - * 400 - * The returned array must be allocated with kmalloc() and will be 401 - * freed by the caller. If the allocation fails, NULL should be 402 - * returned. num_output_fmts must be set to the returned array size. 403 - * Formats listed in the returned array should be listed in decreasing 404 - * preference order (the core will try all formats until it finds one 405 - * that works). When the format is not supported NULL should be 406 - * returned and *num_output_fmts should be set to 0. 407 - * 408 - * This method is called on all elements of the bridge chain as part of 409 - * the bus format negotiation process that happens in 410 - * &drm_atomic_bridge_chain_select_bus_fmts(). 411 - * This method is optional. When not implemented, the core will bypass 412 - * bus format negotiation on this element of the bridge without 413 - * failing, and the previous element in the chain will be passed 414 - * MEDIA_BUS_FMT_FIXED as its output bus format. 415 - * 416 - * Bridge drivers that need to support being linked to bridges that are 417 - * not supporting bus format negotiation should handle the 418 - * output_fmt == MEDIA_BUS_FMT_FIXED case appropriately, by selecting a 419 - * sensible default value or extracting this information from somewhere 420 - * else (FW property, &drm_display_mode, &drm_display_info, ...) 421 - * 422 - * Note: Even if input format selection on the first bridge has no 423 - * impact on the negotiation process (bus format negotiation stops once 424 - * we reach the first element of the chain), drivers are expected to 425 - * return accurate input formats as the input format may be used to 426 - * configure the CRTC output appropriately. 427 - */ 428 - u32 *(*atomic_get_input_bus_fmts)(struct drm_bridge *bridge, 429 - struct drm_bridge_state *bridge_state, 430 - struct drm_crtc_state *crtc_state, 431 - struct drm_connector_state *conn_state, 432 - u32 output_fmt, 433 - unsigned int *num_input_fmts); 434 - 435 - /** 436 - * @atomic_check: 437 - * 438 - * This method is responsible for checking bridge state correctness. 439 - * It can also check the state of the surrounding components in chain 440 - * to make sure the whole pipeline can work properly. 441 - * 442 - * &drm_bridge_funcs.atomic_check() hooks are called in reverse 443 - * order (from the last to the first bridge). 444 - * 445 - * This method is optional. &drm_bridge_funcs.mode_fixup() is not 446 - * called when &drm_bridge_funcs.atomic_check() is implemented, so only 447 - * one of them should be provided. 448 - * 449 - * If drivers need to tweak &drm_bridge_state.input_bus_cfg.flags or 450 - * &drm_bridge_state.output_bus_cfg.flags it should should happen in 451 - * this function. By default the &drm_bridge_state.output_bus_cfg.flags 452 - * field is set to the next bridge 453 - * &drm_bridge_state.input_bus_cfg.flags value or 454 - * &drm_connector.display_info.bus_flags if the bridge is the last 455 - * element in the chain. 456 - * 457 - * RETURNS: 458 - * zero if the check passed, a negative error code otherwise. 459 - */ 460 - int (*atomic_check)(struct drm_bridge *bridge, 461 - struct drm_bridge_state *bridge_state, 462 - struct drm_crtc_state *crtc_state, 463 - struct drm_connector_state *conn_state); 464 - 465 - /** 466 - * @atomic_reset: 467 - * 468 - * Reset the bridge to a predefined state (or retrieve its current 469 - * state) and return a &drm_bridge_state object matching this state. 470 - * This function is called at attach time. 471 - * 472 - * The atomic_reset hook is optional. When not implemented the core 473 - * allocates a new state and calls &__drm_atomic_helper_bridge_reset(). 474 - * 475 - * RETURNS: 476 - * A valid drm_bridge_state object in case of success, an ERR_PTR() 477 - * giving the reason of the failure otherwise. 478 - */ 479 - struct drm_bridge_state *(*atomic_reset)(struct drm_bridge *bridge); 403 + struct drm_atomic_state *old_state); 480 404 }; 481 405 482 406 /** ··· 380 582 * struct drm_bridge - central DRM bridge control structure 381 583 */ 382 584 struct drm_bridge { 383 - /** @base: inherit from &drm_private_object */ 384 - struct drm_private_obj base; 385 585 /** @dev: DRM device this bridge belongs to */ 386 586 struct drm_device *dev; 387 587 /** @encoder: encoder to which this bridge is connected */ ··· 403 607 /** @driver_private: pointer to the bridge driver's internal context */ 404 608 void *driver_private; 405 609 }; 406 - 407 - static inline struct drm_bridge * 408 - drm_priv_to_bridge(struct drm_private_obj *priv) 409 - { 410 - return container_of(priv, struct drm_bridge, base); 411 - } 412 610 413 611 void drm_bridge_add(struct drm_bridge *bridge); 414 612 void drm_bridge_remove(struct drm_bridge *bridge); ··· 482 692 void drm_bridge_chain_pre_enable(struct drm_bridge *bridge); 483 693 void drm_bridge_chain_enable(struct drm_bridge *bridge); 484 694 485 - int drm_atomic_bridge_chain_check(struct drm_bridge *bridge, 486 - struct drm_crtc_state *crtc_state, 487 - struct drm_connector_state *conn_state); 488 695 void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, 489 696 struct drm_atomic_state *state); 490 697 void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge, ··· 490 703 struct drm_atomic_state *state); 491 704 void drm_atomic_bridge_chain_enable(struct drm_bridge *bridge, 492 705 struct drm_atomic_state *state); 493 - 494 - u32 * 495 - drm_atomic_helper_bridge_propagate_bus_fmt(struct drm_bridge *bridge, 496 - struct drm_bridge_state *bridge_state, 497 - struct drm_crtc_state *crtc_state, 498 - struct drm_connector_state *conn_state, 499 - u32 output_fmt, 500 - unsigned int *num_input_fmts); 501 - 502 - void __drm_atomic_helper_bridge_reset(struct drm_bridge *bridge, 503 - struct drm_bridge_state *state); 504 - void __drm_atomic_helper_bridge_duplicate_state(struct drm_bridge *bridge, 505 - struct drm_bridge_state *new); 506 - 507 - static inline struct drm_bridge_state * 508 - drm_atomic_get_bridge_state(struct drm_atomic_state *state, 509 - struct drm_bridge *bridge) 510 - { 511 - struct drm_private_state *obj_state; 512 - 513 - obj_state = drm_atomic_get_private_obj_state(state, &bridge->base); 514 - if (IS_ERR(obj_state)) 515 - return ERR_CAST(obj_state); 516 - 517 - return drm_priv_to_bridge_state(obj_state); 518 - } 519 - 520 - static inline struct drm_bridge_state * 521 - drm_atomic_get_old_bridge_state(struct drm_atomic_state *state, 522 - struct drm_bridge *bridge) 523 - { 524 - struct drm_private_state *obj_state; 525 - 526 - obj_state = drm_atomic_get_old_private_obj_state(state, &bridge->base); 527 - if (!obj_state) 528 - return NULL; 529 - 530 - return drm_priv_to_bridge_state(obj_state); 531 - } 532 - 533 - static inline struct drm_bridge_state * 534 - drm_atomic_get_new_bridge_state(struct drm_atomic_state *state, 535 - struct drm_bridge *bridge) 536 - { 537 - struct drm_private_state *obj_state; 538 - 539 - obj_state = drm_atomic_get_new_private_obj_state(state, &bridge->base); 540 - if (!obj_state) 541 - return NULL; 542 - 543 - return drm_priv_to_bridge_state(obj_state); 544 - } 545 706 546 707 #ifdef CONFIG_DRM_PANEL_BRIDGE 547 708 struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel);
+2
include/drm/drm_fb_cma_helper.h
··· 2 2 #ifndef __DRM_FB_CMA_HELPER_H__ 3 3 #define __DRM_FB_CMA_HELPER_H__ 4 4 5 + #include <linux/types.h> 6 + 5 7 struct drm_framebuffer; 6 8 struct drm_plane_state; 7 9