aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 13:47:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 13:47:51 -0400
commit0af9fb63915cf5ebb47b5c9ff16526b47545baf5 (patch)
tree2e05c80a4b3ef074e7535c0222e37150cdec09e7
parente5744abb2fa3629aa5a94e21ca1eae32ff2fe00b (diff)
parent0f5d9d2e7d234acb26bc98dd820cc8dd178774d6 (diff)
Merge tag 'fbdev-omap-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux
Pull OMAP fbdev changes from Tomi Valkeinen: "This is based on the already pulled fbdev-main changes, and this also merges .dts branch from Tony Lindgren (which has also been pulled), so that I was able to add the display related .dts changes. This contains OMAP related fbdev changes for 3.15. The bulk of the patches are for adding Device Tree support for OMAP Display Subsystem: - SoCs: OMAP2/3/4 - Boards: OMAP4 Panda, OMAP4 SDP, OMAP3 Beagle, OMAP3 Beagle-xM, OMAP3 IGEP0020, OMAP3 N900 - Devices: TFP410 Encoder, tpd12s015 HDMI companion chip, Sony acx565akm panel, MIPI DSI Command mode panel and HDMI, DVI and Analog TV connectors" * tag 'fbdev-omap-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (45 commits) OMAPDSS: HDMI: fix interlace output OMAPDSS: add missing __init for dss_init_ports ARM: OMAP2+: remove pdata quirks for displays OMAPDSS: remove DT hacks for regulators Doc/DT: Add DT binding documentation for tpd12s015 encoder Doc/DT: Add DT binding documentation for TFP410 encoder Doc/DT: Add DT binding documentation for Sony acx565akm panel Doc/DT: Add DT binding documentation for MIPI DSI CM Panel Doc/DT: Add DT binding documentation for HDMI Connector Doc/DT: Add DT binding documentation for DVI Connector Doc/DT: Add DT binding documentation for Analog TV Connector ARM: omap3-n900.dts: add display information ARM: omap3-igep0020.dts: add display information ARM: omap3-beagle-xm.dts: add display information ARM: omap3-beagle.dts: add display information ARM: omap4-sdp.dts: add display information Doc/DT: Add DT binding documentation for OMAP DSS OMAPDSS: acx565akm: Add DT support OMAPDSS: connector-analog-tv: Add DT support OMAPDSS: hdmi-connector: Add DT support ...
-rw-r--r--Documentation/devicetree/bindings/video/analog-tv-connector.txt25
-rw-r--r--Documentation/devicetree/bindings/video/dvi-connector.txt35
-rw-r--r--Documentation/devicetree/bindings/video/hdmi-connector.txt28
-rw-r--r--Documentation/devicetree/bindings/video/panel-dsi-cm.txt29
-rw-r--r--Documentation/devicetree/bindings/video/sony,acx565akm.txt30
-rw-r--r--Documentation/devicetree/bindings/video/ti,omap-dss.txt211
-rw-r--r--Documentation/devicetree/bindings/video/ti,omap2-dss.txt54
-rw-r--r--Documentation/devicetree/bindings/video/ti,omap3-dss.txt83
-rw-r--r--Documentation/devicetree/bindings/video/ti,omap4-dss.txt111
-rw-r--r--Documentation/devicetree/bindings/video/ti,tfp410.txt41
-rw-r--r--Documentation/devicetree/bindings/video/ti,tpd12s015.txt44
-rw-r--r--arch/arm/boot/dts/omap2.dtsi31
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts138
-rw-r--r--arch/arm/boot/dts/omap3-beagle.dts135
-rw-r--r--arch/arm/boot/dts/omap3-igep0020.dts58
-rw-r--r--arch/arm/boot/dts/omap3-n900.dts77
-rw-r--r--arch/arm/boot/dts/omap3.dtsi52
-rw-r--r--arch/arm/boot/dts/omap3430es1-clocks.dtsi6
-rw-r--r--arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi6
-rw-r--r--arch/arm/boot/dts/omap36xx-clocks.dtsi20
-rw-r--r--arch/arm/boot/dts/omap36xx.dtsi8
-rw-r--r--arch/arm/boot/dts/omap3xxx-clocks.dtsi8
-rw-r--r--arch/arm/boot/dts/omap4-panda-common.dtsi115
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts113
-rw-r--r--arch/arm/boot/dts/omap4.dtsi79
-rw-r--r--arch/arm/mach-omap2/board-generic.c4
-rw-r--r--arch/arm/mach-omap2/common.h3
-rw-r--r--arch/arm/mach-omap2/display.c166
-rw-r--r--arch/arm/mach-omap2/display.h3
-rw-r--r--arch/arm/mach-omap2/dss-common.c224
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c3
-rw-r--r--drivers/video/omap2/displays-new/connector-analog-tv.c43
-rw-r--r--drivers/video/omap2/displays-new/connector-dvi.c43
-rw-r--r--drivers/video/omap2/displays-new/connector-hdmi.c30
-rw-r--r--drivers/video/omap2/displays-new/encoder-tfp410.c43
-rw-r--r--drivers/video/omap2/displays-new/encoder-tpd12s015.c56
-rw-r--r--drivers/video/omap2/displays-new/panel-dsi-cm.c60
-rw-r--r--drivers/video/omap2/displays-new/panel-sony-acx565akm.c33
-rw-r--r--drivers/video/omap2/dss/Makefile2
-rw-r--r--drivers/video/omap2/dss/dispc.c8
-rw-r--r--drivers/video/omap2/dss/display.c28
-rw-r--r--drivers/video/omap2/dss/dpi.c47
-rw-r--r--drivers/video/omap2/dss/dsi.c147
-rw-r--r--drivers/video/omap2/dss/dss-of.c159
-rw-r--r--drivers/video/omap2/dss/dss.c66
-rw-r--r--drivers/video/omap2/dss/dss.h6
-rw-r--r--drivers/video/omap2/dss/hdmi4.c14
-rw-r--r--drivers/video/omap2/dss/hdmi_wp.c2
-rw-r--r--drivers/video/omap2/dss/sdi.c45
-rw-r--r--drivers/video/omap2/dss/venc.c66
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c67
-rw-r--r--include/video/omapdss.h14
52 files changed, 2625 insertions, 294 deletions
diff --git a/Documentation/devicetree/bindings/video/analog-tv-connector.txt b/Documentation/devicetree/bindings/video/analog-tv-connector.txt
new file mode 100644
index 000000000000..0218fcdc1299
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/analog-tv-connector.txt
@@ -0,0 +1,25 @@
1Analog TV Connector
2===================
3
4Required properties:
5- compatible: "composite-connector" or "svideo-connector"
6
7Optional properties:
8- label: a symbolic name for the connector
9
10Required nodes:
11- Video port for TV input
12
13Example
14-------
15
16tv: connector {
17 compatible = "composite-connector";
18 label = "tv";
19
20 port {
21 tv_connector_in: endpoint {
22 remote-endpoint = <&venc_out>;
23 };
24 };
25};
diff --git a/Documentation/devicetree/bindings/video/dvi-connector.txt b/Documentation/devicetree/bindings/video/dvi-connector.txt
new file mode 100644
index 000000000000..fc53f7c60bc6
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/dvi-connector.txt
@@ -0,0 +1,35 @@
1DVI Connector
2==============
3
4Required properties:
5- compatible: "dvi-connector"
6
7Optional properties:
8- label: a symbolic name for the connector
9- ddc-i2c-bus: phandle to the i2c bus that is connected to DVI DDC
10- analog: the connector has DVI analog pins
11- digital: the connector has DVI digital pins
12- dual-link: the connector has pins for DVI dual-link
13
14Required nodes:
15- Video port for DVI input
16
17Note: One (or both) of 'analog' or 'digital' must be set.
18
19Example
20-------
21
22dvi0: connector@0 {
23 compatible = "dvi-connector";
24 label = "dvi";
25
26 digital;
27
28 ddc-i2c-bus = <&i2c3>;
29
30 port {
31 dvi_connector_in: endpoint {
32 remote-endpoint = <&tfp410_out>;
33 };
34 };
35};
diff --git a/Documentation/devicetree/bindings/video/hdmi-connector.txt b/Documentation/devicetree/bindings/video/hdmi-connector.txt
new file mode 100644
index 000000000000..ccccc19e2573
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/hdmi-connector.txt
@@ -0,0 +1,28 @@
1HDMI Connector
2==============
3
4Required properties:
5- compatible: "hdmi-connector"
6- type: the HDMI connector type: "a", "b", "c", "d" or "e"
7
8Optional properties:
9- label: a symbolic name for the connector
10
11Required nodes:
12- Video port for HDMI input
13
14Example
15-------
16
17hdmi0: connector@1 {
18 compatible = "hdmi-connector";
19 label = "hdmi";
20
21 type = "a";
22
23 port {
24 hdmi_connector_in: endpoint {
25 remote-endpoint = <&tpd12s015_out>;
26 };
27 };
28};
diff --git a/Documentation/devicetree/bindings/video/panel-dsi-cm.txt b/Documentation/devicetree/bindings/video/panel-dsi-cm.txt
new file mode 100644
index 000000000000..dce48eb9db57
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/panel-dsi-cm.txt
@@ -0,0 +1,29 @@
1Generic MIPI DSI Command Mode Panel
2===================================
3
4Required properties:
5- compatible: "panel-dsi-cm"
6
7Optional properties:
8- label: a symbolic name for the panel
9- reset-gpios: panel reset gpio
10- te-gpios: panel TE gpio
11
12Required nodes:
13- Video port for DSI input
14
15Example
16-------
17
18lcd0: display {
19 compatible = "tpo,taal", "panel-dsi-cm";
20 label = "lcd0";
21
22 reset-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>;
23
24 port {
25 lcd0_in: endpoint {
26 remote-endpoint = <&dsi1_out_ep>;
27 };
28 };
29};
diff --git a/Documentation/devicetree/bindings/video/sony,acx565akm.txt b/Documentation/devicetree/bindings/video/sony,acx565akm.txt
new file mode 100644
index 000000000000..e12333280749
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/sony,acx565akm.txt
@@ -0,0 +1,30 @@
1Sony ACX565AKM SDI Panel
2========================
3
4Required properties:
5- compatible: "sony,acx565akm"
6
7Optional properties:
8- label: a symbolic name for the panel
9- reset-gpios: panel reset gpio
10
11Required nodes:
12- Video port for SDI input
13
14Example
15-------
16
17acx565akm@2 {
18 compatible = "sony,acx565akm";
19 spi-max-frequency = <6000000>;
20 reg = <2>;
21
22 label = "lcd";
23 reset-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* 90 */
24
25 port {
26 lcd_in: endpoint {
27 remote-endpoint = <&sdi_out>;
28 };
29 };
30};
diff --git a/Documentation/devicetree/bindings/video/ti,omap-dss.txt b/Documentation/devicetree/bindings/video/ti,omap-dss.txt
new file mode 100644
index 000000000000..d5f1a3fe3109
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,omap-dss.txt
@@ -0,0 +1,211 @@
1Texas Instruments OMAP Display Subsystem
2========================================
3
4Generic Description
5-------------------
6
7This document is a generic description of the OMAP Display Subsystem bindings.
8Binding details for each OMAP SoC version are described in respective binding
9documentation.
10
11The OMAP Display Subsystem (DSS) hardware consists of DSS Core, DISPC module and
12a number of encoder modules. All DSS versions contain DSS Core and DISPC, but
13the encoder modules vary.
14
15The DSS Core is the parent of the other DSS modules, and manages clock routing,
16integration to the SoC, etc.
17
18DISPC is the display controller, which reads pixels from the memory and outputs
19a RGB pixel stream to encoders.
20
21The encoder modules encode the received RGB pixel stream to a video output like
22HDMI, MIPI DPI, etc.
23
24Video Ports
25-----------
26
27The DSS Core and the encoders have video port outputs. The structure of the
28video ports is described in Documentation/devicetree/bindings/video/video-
29ports.txt, and the properties for the ports and endpoints for each encoder are
30described in the SoC's DSS binding documentation.
31
32The video ports are used to describe the connections to external hardware, like
33panels or external encoders.
34
35Aliases
36-------
37
38The board dts file may define aliases for displays to assign "displayX" style
39name for each display. If no aliases are defined, a semi-random number is used
40for the display.
41
42Example
43-------
44
45A shortened example of the DSS description for OMAP4, with non-relevant parts
46removed, defined in omap4.dtsi:
47
48dss: dss@58000000 {
49 compatible = "ti,omap4-dss";
50 reg = <0x58000000 0x80>;
51 status = "disabled";
52 ti,hwmods = "dss_core";
53 clocks = <&dss_dss_clk>;
54 clock-names = "fck";
55 #address-cells = <1>;
56 #size-cells = <1>;
57 ranges;
58
59 dispc@58001000 {
60 compatible = "ti,omap4-dispc";
61 reg = <0x58001000 0x1000>;
62 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
63 ti,hwmods = "dss_dispc";
64 clocks = <&dss_dss_clk>;
65 clock-names = "fck";
66 };
67
68 hdmi: encoder@58006000 {
69 compatible = "ti,omap4-hdmi";
70 reg = <0x58006000 0x200>,
71 <0x58006200 0x100>,
72 <0x58006300 0x100>,
73 <0x58006400 0x1000>;
74 reg-names = "wp", "pll", "phy", "core";
75 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
76 status = "disabled";
77 ti,hwmods = "dss_hdmi";
78 clocks = <&dss_48mhz_clk>, <&dss_sys_clk>;
79 clock-names = "fck", "sys_clk";
80 };
81};
82
83A shortened example of the board description for OMAP4 Panda board, defined in
84omap4-panda.dts.
85
86The Panda board has a DVI and a HDMI connector, and the board contains a TFP410
87chip (MIPI DPI to DVI encoder) and a TPD12S015 chip (HDMI ESD protection & level
88shifter). The video pipelines for the connectors are formed as follows:
89
90DSS Core --(MIPI DPI)--> TFP410 --(DVI)--> DVI Connector
91OMAP HDMI --(HDMI)--> TPD12S015 --(HDMI)--> HDMI Connector
92
93/ {
94 aliases {
95 display0 = &dvi0;
96 display1 = &hdmi0;
97 };
98
99 tfp410: encoder@0 {
100 compatible = "ti,tfp410";
101 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; /* 0, power-down */
102
103 pinctrl-names = "default";
104 pinctrl-0 = <&tfp410_pins>;
105
106 ports {
107 #address-cells = <1>;
108 #size-cells = <0>;
109
110 port@0 {
111 reg = <0>;
112
113 tfp410_in: endpoint@0 {
114 remote-endpoint = <&dpi_out>;
115 };
116 };
117
118 port@1 {
119 reg = <1>;
120
121 tfp410_out: endpoint@0 {
122 remote-endpoint = <&dvi_connector_in>;
123 };
124 };
125 };
126 };
127
128 dvi0: connector@0 {
129 compatible = "dvi-connector";
130 label = "dvi";
131
132 i2c-bus = <&i2c3>;
133
134 port {
135 dvi_connector_in: endpoint {
136 remote-endpoint = <&tfp410_out>;
137 };
138 };
139 };
140
141 tpd12s015: encoder@1 {
142 compatible = "ti,tpd12s015";
143
144 pinctrl-names = "default";
145 pinctrl-0 = <&tpd12s015_pins>;
146
147 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
148 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
149 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
150
151 ports {
152 #address-cells = <1>;
153 #size-cells = <0>;
154
155 port@0 {
156 reg = <0>;
157
158 tpd12s015_in: endpoint@0 {
159 remote-endpoint = <&hdmi_out>;
160 };
161 };
162
163 port@1 {
164 reg = <1>;
165
166 tpd12s015_out: endpoint@0 {
167 remote-endpoint = <&hdmi_connector_in>;
168 };
169 };
170 };
171 };
172
173 hdmi0: connector@1 {
174 compatible = "hdmi-connector";
175 label = "hdmi";
176
177 port {
178 hdmi_connector_in: endpoint {
179 remote-endpoint = <&tpd12s015_out>;
180 };
181 };
182 };
183};
184
185&dss {
186 status = "ok";
187
188 pinctrl-names = "default";
189 pinctrl-0 = <&dss_dpi_pins>;
190
191 port {
192 dpi_out: endpoint {
193 remote-endpoint = <&tfp410_in>;
194 data-lines = <24>;
195 };
196 };
197};
198
199&hdmi {
200 status = "ok";
201 vdda-supply = <&vdac>;
202
203 pinctrl-names = "default";
204 pinctrl-0 = <&dss_hdmi_pins>;
205
206 port {
207 hdmi_out: endpoint {
208 remote-endpoint = <&tpd12s015_in>;
209 };
210 };
211};
diff --git a/Documentation/devicetree/bindings/video/ti,omap2-dss.txt b/Documentation/devicetree/bindings/video/ti,omap2-dss.txt
new file mode 100644
index 000000000000..fa8bb2ed1170
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,omap2-dss.txt
@@ -0,0 +1,54 @@
1Texas Instruments OMAP2 Display Subsystem
2=========================================
3
4See Documentation/devicetree/bindings/video/ti,omap-dss.txt for generic
5description about OMAP Display Subsystem bindings.
6
7DSS Core
8--------
9
10Required properties:
11- compatible: "ti,omap2-dss"
12- reg: address and length of the register space
13- ti,hwmods: "dss_core"
14
15Optional nodes:
16- Video port for DPI output
17
18DPI Endpoint required properties:
19- data-lines: number of lines used
20
21
22DISPC
23-----
24
25Required properties:
26- compatible: "ti,omap2-dispc"
27- reg: address and length of the register space
28- ti,hwmods: "dss_dispc"
29- interrupts: the DISPC interrupt
30
31
32RFBI
33----
34
35Required properties:
36- compatible: "ti,omap2-rfbi"
37- reg: address and length of the register space
38- ti,hwmods: "dss_rfbi"
39
40
41VENC
42----
43
44Required properties:
45- compatible: "ti,omap2-venc"
46- reg: address and length of the register space
47- ti,hwmods: "dss_venc"
48- vdda-supply: power supply for DAC
49
50VENC Endpoint required properties:
51
52Required properties:
53- ti,invert-polarity: invert the polarity of the video signal
54- ti,channels: 1 for composite, 2 for s-video
diff --git a/Documentation/devicetree/bindings/video/ti,omap3-dss.txt b/Documentation/devicetree/bindings/video/ti,omap3-dss.txt
new file mode 100644
index 000000000000..0023fa4b1328
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,omap3-dss.txt
@@ -0,0 +1,83 @@
1Texas Instruments OMAP3 Display Subsystem
2=========================================
3
4See Documentation/devicetree/bindings/video/ti,omap-dss.txt for generic
5description about OMAP Display Subsystem bindings.
6
7DSS Core
8--------
9
10Required properties:
11- compatible: "ti,omap3-dss"
12- reg: address and length of the register space
13- ti,hwmods: "dss_core"
14- clocks: handle to fclk
15- clock-names: "fck"
16
17Optional nodes:
18- Video ports:
19 - Port 0: DPI output
20 - Port 1: SDI output
21
22DPI Endpoint required properties:
23- data-lines: number of lines used
24
25SDI Endpoint required properties:
26- datapairs: number of datapairs used
27
28
29DISPC
30-----
31
32Required properties:
33- compatible: "ti,omap3-dispc"
34- reg: address and length of the register space
35- ti,hwmods: "dss_dispc"
36- interrupts: the DISPC interrupt
37- clocks: handle to fclk
38- clock-names: "fck"
39
40
41RFBI
42----
43
44Required properties:
45- compatible: "ti,omap3-rfbi"
46- reg: address and length of the register space
47- ti,hwmods: "dss_rfbi"
48- clocks: handles to fclk and iclk
49- clock-names: "fck", "ick"
50
51
52VENC
53----
54
55Required properties:
56- compatible: "ti,omap3-venc"
57- reg: address and length of the register space
58- ti,hwmods: "dss_venc"
59- vdda-supply: power supply for DAC
60- clocks: handle to fclk
61- clock-names: "fck"
62
63VENC Endpoint required properties:
64- ti,invert-polarity: invert the polarity of the video signal
65- ti,channels: 1 for composite, 2 for s-video
66
67
68DSI
69---
70
71Required properties:
72- compatible: "ti,omap3-dsi"
73- reg: addresses and lengths of the register spaces for 'proto', 'phy' and 'pll'
74- reg-names: "proto", "phy", "pll"
75- interrupts: the DSI interrupt line
76- ti,hwmods: "dss_dsi1"
77- vdd-supply: power supply for DSI
78- clocks: handles to fclk and pll clock
79- clock-names: "fck", "sys_clk"
80
81DSI Endpoint required properties:
82- lanes: list of pin numbers for the DSI lanes: CLK+, CLK-, DATA0+, DATA0-,
83 DATA1+, DATA1-, ...
diff --git a/Documentation/devicetree/bindings/video/ti,omap4-dss.txt b/Documentation/devicetree/bindings/video/ti,omap4-dss.txt
new file mode 100644
index 000000000000..f85d6fcfa705
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,omap4-dss.txt
@@ -0,0 +1,111 @@
1Texas Instruments OMAP4 Display Subsystem
2=========================================
3
4See Documentation/devicetree/bindings/video/ti,omap-dss.txt for generic
5description about OMAP Display Subsystem bindings.
6
7DSS Core
8--------
9
10Required properties:
11- compatible: "ti,omap4-dss"
12- reg: address and length of the register space
13- ti,hwmods: "dss_core"
14- clocks: handle to fclk
15- clock-names: "fck"
16
17Required nodes:
18- DISPC
19
20Optional nodes:
21- DSS Submodules: RFBI, VENC, DSI, HDMI
22- Video port for DPI output
23
24DPI Endpoint required properties:
25- data-lines: number of lines used
26
27
28DISPC
29-----
30
31Required properties:
32- compatible: "ti,omap4-dispc"
33- reg: address and length of the register space
34- ti,hwmods: "dss_dispc"
35- interrupts: the DISPC interrupt
36- clocks: handle to fclk
37- clock-names: "fck"
38
39
40RFBI
41----
42
43Required properties:
44- compatible: "ti,omap4-rfbi"
45- reg: address and length of the register space
46- ti,hwmods: "dss_rfbi"
47- clocks: handles to fclk and iclk
48- clock-names: "fck", "ick"
49
50Optional nodes:
51- Video port for RFBI output
52- RFBI controlled peripherals
53
54
55VENC
56----
57
58Required properties:
59- compatible: "ti,omap4-venc"
60- reg: address and length of the register space
61- ti,hwmods: "dss_venc"
62- vdda-supply: power supply for DAC
63- clocks: handle to fclk
64- clock-names: "fck"
65
66Optional nodes:
67- Video port for VENC output
68
69VENC Endpoint required properties:
70- ti,invert-polarity: invert the polarity of the video signal
71- ti,channels: 1 for composite, 2 for s-video
72
73
74DSI
75---
76
77Required properties:
78- compatible: "ti,omap4-dsi"
79- reg: addresses and lengths of the register spaces for 'proto', 'phy' and 'pll'
80- reg-names: "proto", "phy", "pll"
81- interrupts: the DSI interrupt line
82- ti,hwmods: "dss_dsi1" or "dss_dsi2"
83- vdd-supply: power supply for DSI
84- clocks: handles to fclk and pll clock
85- clock-names: "fck", "sys_clk"
86
87Optional nodes:
88- Video port for DSI output
89- DSI controlled peripherals
90
91DSI Endpoint required properties:
92- lanes: list of pin numbers for the DSI lanes: CLK+, CLK-, DATA0+, DATA0-,
93 DATA1+, DATA1-, ...
94
95
96HDMI
97----
98
99Required properties:
100- compatible: "ti,omap4-hdmi"
101- reg: addresses and lengths of the register spaces for 'wp', 'pll', 'phy',
102 'core'
103- reg-names: "wp", "pll", "phy", "core"
104- interrupts: the HDMI interrupt line
105- ti,hwmods: "dss_hdmi"
106- vdda-supply: vdda power supply
107- clocks: handles to fclk and pll clock
108- clock-names: "fck", "sys_clk"
109
110Optional nodes:
111- Video port for HDMI output
diff --git a/Documentation/devicetree/bindings/video/ti,tfp410.txt b/Documentation/devicetree/bindings/video/ti,tfp410.txt
new file mode 100644
index 000000000000..2cbe32a3d0bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,tfp410.txt
@@ -0,0 +1,41 @@
1TFP410 DPI to DVI encoder
2=========================
3
4Required properties:
5- compatible: "ti,tfp410"
6
7Optional properties:
8- powerdown-gpios: power-down gpio
9
10Required nodes:
11- Video port 0 for DPI input
12- Video port 1 for DVI output
13
14Example
15-------
16
17tfp410: encoder@0 {
18 compatible = "ti,tfp410";
19 powerdown-gpios = <&twl_gpio 2 GPIO_ACTIVE_LOW>;
20
21 ports {
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 port@0 {
26 reg = <0>;
27
28 tfp410_in: endpoint@0 {
29 remote-endpoint = <&dpi_out>;
30 };
31 };
32
33 port@1 {
34 reg = <1>;
35
36 tfp410_out: endpoint@0 {
37 remote-endpoint = <&dvi_connector_in>;
38 };
39 };
40 };
41};
diff --git a/Documentation/devicetree/bindings/video/ti,tpd12s015.txt b/Documentation/devicetree/bindings/video/ti,tpd12s015.txt
new file mode 100644
index 000000000000..26e6d32e3f20
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/ti,tpd12s015.txt
@@ -0,0 +1,44 @@
1TPD12S015 HDMI level shifter and ESD protection chip
2====================================================
3
4Required properties:
5- compatible: "ti,tpd12s015"
6
7Optional properties:
8- gpios: CT CP HPD, LS OE and HPD gpios
9
10Required nodes:
11- Video port 0 for HDMI input
12- Video port 1 for HDMI output
13
14Example
15-------
16
17tpd12s015: encoder@1 {
18 compatible = "ti,tpd12s015";
19
20 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
21 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
22 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
23
24 ports {
25 #address-cells = <1>;
26 #size-cells = <0>;
27
28 port@0 {
29 reg = <0>;
30
31 tpd12s015_in: endpoint@0 {
32 remote-endpoint = <&hdmi_out>;
33 };
34 };
35
36 port@1 {
37 reg = <1>;
38
39 tpd12s015_out: endpoint@0 {
40 remote-endpoint = <&hdmi_connector_in>;
41 };
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 5377ddf83bf8..22f35ea142c1 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -271,5 +271,36 @@
271 ti,hwmods = "timer12"; 271 ti,hwmods = "timer12";
272 ti,timer-pwm; 272 ti,timer-pwm;
273 }; 273 };
274
275 dss: dss@48050000 {
276 compatible = "ti,omap2-dss";
277 reg = <0x48050000 0x400>;
278 status = "disabled";
279 ti,hwmods = "dss_core";
280 #address-cells = <1>;
281 #size-cells = <1>;
282 ranges;
283
284 dispc@48050400 {
285 compatible = "ti,omap2-dispc";
286 reg = <0x48050400 0x400>;
287 interrupts = <25>;
288 ti,hwmods = "dss_dispc";
289 };
290
291 rfbi: encoder@48050800 {
292 compatible = "ti,omap2-rfbi";
293 reg = <0x48050800 0x400>;
294 status = "disabled";
295 ti,hwmods = "dss_rfbi";
296 };
297
298 venc: encoder@48050c00 {
299 compatible = "ti,omap2-venc";
300 reg = <0x48050c00 0x400>;
301 status = "disabled";
302 ti,hwmods = "dss_venc";
303 };
304 };
274 }; 305 };
275}; 306};
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index cba357023878..cf0be662297e 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -24,6 +24,11 @@
24 reg = <0x80000000 0x20000000>; /* 512 MB */ 24 reg = <0x80000000 0x20000000>; /* 512 MB */
25 }; 25 };
26 26
27 aliases {
28 display0 = &dvi0;
29 display1 = &tv0;
30 };
31
27 leds { 32 leds {
28 compatible = "gpio-leds"; 33 compatible = "gpio-leds";
29 34
@@ -86,6 +91,60 @@
86 reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */ 91 reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */
87 vcc-supply = <&hsusb2_power>; 92 vcc-supply = <&hsusb2_power>;
88 }; 93 };
94
95 tfp410: encoder@0 {
96 compatible = "ti,tfp410";
97 powerdown-gpios = <&twl_gpio 2 GPIO_ACTIVE_LOW>;
98
99 /* XXX pinctrl from twl */
100
101 ports {
102 #address-cells = <1>;
103 #size-cells = <0>;
104
105 port@0 {
106 reg = <0>;
107
108 tfp410_in: endpoint@0 {
109 remote-endpoint = <&dpi_out>;
110 };
111 };
112
113 port@1 {
114 reg = <1>;
115
116 tfp410_out: endpoint@0 {
117 remote-endpoint = <&dvi_connector_in>;
118 };
119 };
120 };
121 };
122
123 dvi0: connector@0 {
124 compatible = "dvi-connector";
125 label = "dvi";
126
127 digital;
128
129 ddc-i2c-bus = <&i2c3>;
130
131 port {
132 dvi_connector_in: endpoint {
133 remote-endpoint = <&tfp410_out>;
134 };
135 };
136 };
137
138 tv0: connector@1 {
139 compatible = "svideo-connector";
140 label = "tv";
141
142 port {
143 tv_connector_in: endpoint {
144 remote-endpoint = <&venc_out>;
145 };
146 };
147 };
89}; 148};
90 149
91&omap3_pmx_wkup { 150&omap3_pmx_wkup {
@@ -94,6 +153,17 @@
94 0x0e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot2.gpio_4 */ 153 0x0e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot2.gpio_4 */
95 >; 154 >;
96 }; 155 };
156
157 dss_dpi_pins2: pinmux_dss_dpi_pins1 {
158 pinctrl-single,pins = <
159 0x0a (PIN_OUTPUT | MUX_MODE3) /* sys_boot0.dss_data18 */
160 0x0c (PIN_OUTPUT | MUX_MODE3) /* sys_boot1.dss_data19 */
161 0x10 (PIN_OUTPUT | MUX_MODE3) /* sys_boot3.dss_data20 */
162 0x12 (PIN_OUTPUT | MUX_MODE3) /* sys_boot4.dss_data21 */
163 0x14 (PIN_OUTPUT | MUX_MODE3) /* sys_boot5.dss_data22 */
164 0x16 (PIN_OUTPUT | MUX_MODE3) /* sys_boot6.dss_data23 */
165 >;
166 };
97}; 167};
98 168
99&omap3_pmx_core { 169&omap3_pmx_core {
@@ -119,6 +189,35 @@
119 OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs1.hsusb2_data3 */ 189 OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs1.hsusb2_data3 */
120 >; 190 >;
121 }; 191 };
192
193 dss_dpi_pins1: pinmux_dss_dpi_pins2 {
194 pinctrl-single,pins = <
195 OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
196 OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
197 OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
198 OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
199
200 OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
201 OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
202 OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
203 OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
204 OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
205 OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
206 OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
207 OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
208 OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
209 OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
210 OMAP3_CORE1_IOPAD(0x20fc, PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
211 OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
212
213 OMAP3_CORE1_IOPAD(0x2100, PIN_OUTPUT | MUX_MODE3) /* dss_data18.dss_data0 */
214 OMAP3_CORE1_IOPAD(0x2102, PIN_OUTPUT | MUX_MODE3) /* dss_data19.dss_data1 */
215 OMAP3_CORE1_IOPAD(0x2104, PIN_OUTPUT | MUX_MODE3) /* dss_data20.dss_data2 */
216 OMAP3_CORE1_IOPAD(0x2106, PIN_OUTPUT | MUX_MODE3) /* dss_data21.dss_data3 */
217 OMAP3_CORE1_IOPAD(0x2108, PIN_OUTPUT | MUX_MODE3) /* dss_data22.dss_data4 */
218 OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE3) /* dss_data23.dss_data5 */
219 >;
220 };
122}; 221};
123 222
124&omap3_pmx_core2 { 223&omap3_pmx_core2 {
@@ -164,15 +263,6 @@
164 263
165&i2c3 { 264&i2c3 {
166 clock-frequency = <100000>; 265 clock-frequency = <100000>;
167
168 /*
169 * Display monitor features are burnt in the EEPROM
170 * as EDID data.
171 */
172 eeprom@50 {
173 compatible = "ti,eeprom";
174 reg = <0x50>;
175 };
176}; 266};
177 267
178&mmc1 { 268&mmc1 {
@@ -238,3 +328,33 @@
238&mcbsp2 { 328&mcbsp2 {
239 status = "okay"; 329 status = "okay";
240}; 330};
331
332&dss {
333 status = "ok";
334
335 pinctrl-names = "default";
336 pinctrl-0 = <
337 &dss_dpi_pins1
338 &dss_dpi_pins2
339 >;
340
341 port {
342 dpi_out: endpoint {
343 remote-endpoint = <&tfp410_in>;
344 data-lines = <24>;
345 };
346 };
347};
348
349&venc {
350 status = "ok";
351
352 vdda-supply = <&vdac>;
353
354 port {
355 venc_out: endpoint {
356 remote-endpoint = <&tv_connector_in>;
357 ti,channels = <2>;
358 };
359 };
360};
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index d01e9a76c5da..3c3e6da1deac 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -24,6 +24,11 @@
24 reg = <0x80000000 0x10000000>; /* 256 MB */ 24 reg = <0x80000000 0x10000000>; /* 256 MB */
25 }; 25 };
26 26
27 aliases {
28 display0 = &dvi0;
29 display1 = &tv0;
30 };
31
27 leds { 32 leds {
28 compatible = "gpio-leds"; 33 compatible = "gpio-leds";
29 pmu_stat { 34 pmu_stat {
@@ -80,6 +85,61 @@
80 }; 85 };
81 86
82 }; 87 };
88
89 tfp410: encoder@0 {
90 compatible = "ti,tfp410";
91 powerdown-gpios = <&gpio6 10 GPIO_ACTIVE_LOW>; /* gpio_170 */
92
93 pinctrl-names = "default";
94 pinctrl-0 = <&tfp410_pins>;
95
96 ports {
97 #address-cells = <1>;
98 #size-cells = <0>;
99
100 port@0 {
101 reg = <0>;
102
103 tfp410_in: endpoint@0 {
104 remote-endpoint = <&dpi_out>;
105 };
106 };
107
108 port@1 {
109 reg = <1>;
110
111 tfp410_out: endpoint@0 {
112 remote-endpoint = <&dvi_connector_in>;
113 };
114 };
115 };
116 };
117
118 dvi0: connector@0 {
119 compatible = "dvi-connector";
120 label = "dvi";
121
122 digital;
123
124 ddc-i2c-bus = <&i2c3>;
125
126 port {
127 dvi_connector_in: endpoint {
128 remote-endpoint = <&tfp410_out>;
129 };
130 };
131 };
132
133 tv0: connector@1 {
134 compatible = "svideo-connector";
135 label = "tv";
136
137 port {
138 tv_connector_in: endpoint {
139 remote-endpoint = <&venc_out>;
140 };
141 };
142 };
83}; 143};
84 144
85&omap3_pmx_wkup { 145&omap3_pmx_wkup {
@@ -113,6 +173,45 @@
113 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */ 173 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
114 >; 174 >;
115 }; 175 };
176
177 tfp410_pins: pinmux_tfp410_pins {
178 pinctrl-single,pins = <
179 0x194 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
180 >;
181 };
182
183 dss_dpi_pins: pinmux_dss_dpi_pins {
184 pinctrl-single,pins = <
185 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
186 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
187 0x0a8 (PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
188 0x0aa (PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
189 0x0ac (PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */
190 0x0ae (PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */
191 0x0b0 (PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */
192 0x0b2 (PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */
193 0x0b4 (PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */
194 0x0b6 (PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */
195 0x0b8 (PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
196 0x0ba (PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
197 0x0bc (PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
198 0x0be (PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
199 0x0c0 (PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
200 0x0c2 (PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
201 0x0c4 (PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
202 0x0c6 (PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
203 0x0c8 (PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
204 0x0ca (PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
205 0x0cc (PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
206 0x0ce (PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
207 0x0d0 (PIN_OUTPUT | MUX_MODE0) /* dss_data18.dss_data18 */
208 0x0d2 (PIN_OUTPUT | MUX_MODE0) /* dss_data19.dss_data19 */
209 0x0d4 (PIN_OUTPUT | MUX_MODE0) /* dss_data20.dss_data20 */
210 0x0d6 (PIN_OUTPUT | MUX_MODE0) /* dss_data21.dss_data21 */
211 0x0d8 (PIN_OUTPUT | MUX_MODE0) /* dss_data22.dss_data22 */
212 0x0da (PIN_OUTPUT | MUX_MODE0) /* dss_data23.dss_data23 */
213 >;
214 };
116}; 215};
117 216
118&omap3_pmx_core2 { 217&omap3_pmx_core2 {
@@ -152,6 +251,10 @@
152#include "twl4030.dtsi" 251#include "twl4030.dtsi"
153#include "twl4030_omap3.dtsi" 252#include "twl4030_omap3.dtsi"
154 253
254&i2c3 {
255 clock-frequency = <100000>;
256};
257
155&mmc1 { 258&mmc1 {
156 vmmc-supply = <&vmmc1>; 259 vmmc-supply = <&vmmc1>;
157 vmmc_aux-supply = <&vsim>; 260 vmmc_aux-supply = <&vsim>;
@@ -215,3 +318,35 @@
215&mcbsp2 { 318&mcbsp2 {
216 status = "okay"; 319 status = "okay";
217}; 320};
321
322/* Needed to power the DPI pins */
323&vpll2 {
324 regulator-always-on;
325};
326
327&dss {
328 status = "ok";
329
330 pinctrl-names = "default";
331 pinctrl-0 = <&dss_dpi_pins>;
332
333 port {
334 dpi_out: endpoint {
335 remote-endpoint = <&tfp410_in>;
336 data-lines = <24>;
337 };
338 };
339};
340
341&venc {
342 status = "ok";
343
344 vdda-supply = <&vdac>;
345
346 port {
347 venc_out: endpoint {
348 remote-endpoint = <&tv_connector_in>;
349 ti,channels = <2>;
350 };
351 };
352};
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
index f2779ac75872..7abd64f6ae21 100644
--- a/arch/arm/boot/dts/omap3-igep0020.dts
+++ b/arch/arm/boot/dts/omap3-igep0020.dts
@@ -61,22 +61,63 @@
61 reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; /* gpio_24 */ 61 reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; /* gpio_24 */
62 vcc-supply = <&hsusb1_power>; 62 vcc-supply = <&hsusb1_power>;
63 }; 63 };
64
65 tfp410: encoder@0 {
66 compatible = "ti,tfp410";
67 powerdown-gpios = <&gpio6 10 GPIO_ACTIVE_LOW>; /* gpio_170 */
68
69 ports {
70 #address-cells = <1>;
71 #size-cells = <0>;
72
73 port@0 {
74 reg = <0>;
75
76 tfp410_in: endpoint@0 {
77 remote-endpoint = <&dpi_out>;
78 };
79 };
80
81 port@1 {
82 reg = <1>;
83
84 tfp410_out: endpoint@0 {
85 remote-endpoint = <&dvi_connector_in>;
86 };
87 };
88 };
89 };
90
91 dvi0: connector@0 {
92 compatible = "dvi-connector";
93 label = "dvi";
94
95 digital;
96
97 ddc-i2c-bus = <&i2c3>;
98
99 port {
100 dvi_connector_in: endpoint {
101 remote-endpoint = <&tfp410_out>;
102 };
103 };
104 };
64}; 105};
65 106
66&omap3_pmx_core { 107&omap3_pmx_core {
67 pinctrl-names = "default"; 108 pinctrl-names = "default";
68 pinctrl-0 = < 109 pinctrl-0 = <
69 &tfp410_pins 110 &tfp410_pins
70 &dss_pins 111 &dss_dpi_pins
71 >; 112 >;
72 113
73 tfp410_pins: tfp410_dvi_pins { 114 tfp410_pins: pinmux_tfp410_pins {
74 pinctrl-single,pins = < 115 pinctrl-single,pins = <
75 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */ 116 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
76 >; 117 >;
77 }; 118 };
78 119
79 dss_pins: pinmux_dss_dvi_pins { 120 dss_dpi_pins: pinmux_dss_dpi_pins {
80 pinctrl-single,pins = < 121 pinctrl-single,pins = <
81 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */ 122 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
82 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */ 123 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
@@ -226,3 +267,14 @@
226 /* Needed for DSS */ 267 /* Needed for DSS */
227 regulator-name = "vdds_dsi"; 268 regulator-name = "vdds_dsi";
228}; 269};
270
271&dss {
272 status = "ok";
273
274 port {
275 dpi_out: endpoint {
276 remote-endpoint = <&tfp410_in>;
277 data-lines = <24>;
278 };
279 };
280};
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index d1c3d99dc947..1a57b61f5e24 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -79,6 +79,17 @@
79 nxp,enable-gpio = <&gpio3 3 GPIO_ACTIVE_HIGH>; 79 nxp,enable-gpio = <&gpio3 3 GPIO_ACTIVE_HIGH>;
80 usb-phy = <&usb2_phy>; 80 usb-phy = <&usb2_phy>;
81 }; 81 };
82
83 tv: connector {
84 compatible = "composite-connector";
85 label = "tv";
86
87 port {
88 tv_connector_in: endpoint {
89 remote-endpoint = <&venc_out>;
90 };
91 };
92 };
82}; 93};
83 94
84&omap3_pmx_core { 95&omap3_pmx_core {
@@ -145,11 +156,23 @@
145 >; 156 >;
146 }; 157 };
147 158
148 display_pins: pinmux_display_pins { 159 acx565akm_pins: pinmux_acx565akm_pins {
149 pinctrl-single,pins = < 160 pinctrl-single,pins = <
150 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */ 161 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */
151 >; 162 >;
152 }; 163 };
164
165 dss_sdi_pins: pinmux_dss_sdi_pins {
166 pinctrl-single,pins = <
167 0x0c0 (PIN_OUTPUT | MUX_MODE1) /* dss_data10.sdi_dat1n */
168 0x0c2 (PIN_OUTPUT | MUX_MODE1) /* dss_data11.sdi_dat1p */
169 0x0c4 (PIN_OUTPUT | MUX_MODE1) /* dss_data12.sdi_dat2n */
170 0x0c6 (PIN_OUTPUT | MUX_MODE1) /* dss_data13.sdi_dat2p */
171
172 0x0d8 (PIN_OUTPUT | MUX_MODE1) /* dss_data22.sdi_clkp */
173 0x0da (PIN_OUTPUT | MUX_MODE1) /* dss_data23.sdi_clkn */
174 >;
175 };
153}; 176};
154 177
155&i2c1 { 178&i2c1 {
@@ -561,13 +584,23 @@
561 spi-max-frequency = <6000000>; 584 spi-max-frequency = <6000000>;
562 reg = <0>; 585 reg = <0>;
563 }; 586 };
564 mipid@2 { 587
565 compatible = "acx565akm"; 588 acx565akm@2 {
589 compatible = "sony,acx565akm";
566 spi-max-frequency = <6000000>; 590 spi-max-frequency = <6000000>;
567 reg = <2>; 591 reg = <2>;
568 592
569 pinctrl-names = "default"; 593 pinctrl-names = "default";
570 pinctrl-0 = <&display_pins>; 594 pinctrl-0 = <&acx565akm_pins>;
595
596 label = "lcd";
597 reset-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* 90 */
598
599 port {
600 lcd_in: endpoint {
601 remote-endpoint = <&sdi_out>;
602 };
603 };
571 }; 604 };
572}; 605};
573 606
@@ -593,3 +626,39 @@
593 pinctrl-names = "default"; 626 pinctrl-names = "default";
594 pinctrl-0 = <&uart3_pins>; 627 pinctrl-0 = <&uart3_pins>;
595}; 628};
629
630&dss {
631 status = "ok";
632
633 pinctrl-names = "default";
634 pinctrl-0 = <&dss_sdi_pins>;
635
636 vdds_sdi-supply = <&vaux1>;
637
638 ports {
639 #address-cells = <1>;
640 #size-cells = <0>;
641
642 port@1 {
643 reg = <1>;
644
645 sdi_out: endpoint {
646 remote-endpoint = <&lcd_in>;
647 datapairs = <2>;
648 };
649 };
650 };
651};
652
653&venc {
654 status = "ok";
655
656 vdda-supply = <&vdac>;
657
658 port {
659 venc_out: endpoint {
660 remote-endpoint = <&tv_connector_in>;
661 ti,channels = <1>;
662 };
663 };
664};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index a089e6e00457..3d05eff67e25 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -688,6 +688,58 @@
688 num-eps = <16>; 688 num-eps = <16>;
689 ram-bits = <12>; 689 ram-bits = <12>;
690 }; 690 };
691
692 dss: dss@48050000 {
693 compatible = "ti,omap3-dss";
694 reg = <0x48050000 0x200>;
695 status = "disabled";
696 ti,hwmods = "dss_core";
697 clocks = <&dss1_alwon_fck>;
698 clock-names = "fck";
699 #address-cells = <1>;
700 #size-cells = <1>;
701 ranges;
702
703 dispc@48050400 {
704 compatible = "ti,omap3-dispc";
705 reg = <0x48050400 0x400>;
706 interrupts = <25>;
707 ti,hwmods = "dss_dispc";
708 clocks = <&dss1_alwon_fck>;
709 clock-names = "fck";
710 };
711
712 dsi: encoder@4804fc00 {
713 compatible = "ti,omap3-dsi";
714 reg = <0x4804fc00 0x200>,
715 <0x4804fe00 0x40>,
716 <0x4804ff00 0x20>;
717 reg-names = "proto", "phy", "pll";
718 interrupts = <25>;
719 status = "disabled";
720 ti,hwmods = "dss_dsi1";
721 clocks = <&dss1_alwon_fck>, <&dss2_alwon_fck>;
722 clock-names = "fck", "sys_clk";
723 };
724
725 rfbi: encoder@48050800 {
726 compatible = "ti,omap3-rfbi";
727 reg = <0x48050800 0x100>;
728 status = "disabled";
729 ti,hwmods = "dss_rfbi";
730 clocks = <&dss1_alwon_fck>, <&dss_ick>;
731 clock-names = "fck", "ick";
732 };
733
734 venc: encoder@48050c00 {
735 compatible = "ti,omap3-venc";
736 reg = <0x48050c00 0x100>;
737 status = "disabled";
738 ti,hwmods = "dss_venc";
739 clocks = <&dss_tv_fck>;
740 clock-names = "fck";
741 };
742 };
691 }; 743 };
692}; 744};
693 745
diff --git a/arch/arm/boot/dts/omap3430es1-clocks.dtsi b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
index 6f31954636a1..4c22f3a7f813 100644
--- a/arch/arm/boot/dts/omap3430es1-clocks.dtsi
+++ b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
@@ -152,7 +152,7 @@
152 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>; 152 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>;
153 }; 153 };
154 154
155 dss1_alwon_fck_3430es1: dss1_alwon_fck_3430es1 { 155 dss1_alwon_fck: dss1_alwon_fck_3430es1 {
156 #clock-cells = <0>; 156 #clock-cells = <0>;
157 compatible = "ti,gate-clock"; 157 compatible = "ti,gate-clock";
158 clocks = <&dpll4_m4x2_ck>; 158 clocks = <&dpll4_m4x2_ck>;
@@ -161,7 +161,7 @@
161 ti,set-rate-parent; 161 ti,set-rate-parent;
162 }; 162 };
163 163
164 dss_ick_3430es1: dss_ick_3430es1 { 164 dss_ick: dss_ick_3430es1 {
165 #clock-cells = <0>; 165 #clock-cells = <0>;
166 compatible = "ti,omap3-no-wait-interface-clock"; 166 compatible = "ti,omap3-no-wait-interface-clock";
167 clocks = <&l4_ick>; 167 clocks = <&l4_ick>;
@@ -184,7 +184,7 @@
184 dss_clkdm: dss_clkdm { 184 dss_clkdm: dss_clkdm {
185 compatible = "ti,clockdomain"; 185 compatible = "ti,clockdomain";
186 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>, 186 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
187 <&dss1_alwon_fck_3430es1>, <&dss_ick_3430es1>; 187 <&dss1_alwon_fck>, <&dss_ick>;
188 }; 188 };
189 189
190 d2d_clkdm: d2d_clkdm { 190 d2d_clkdm: d2d_clkdm {
diff --git a/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
index af9ae5346bf2..080fb3f4e429 100644
--- a/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
+++ b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
@@ -160,7 +160,7 @@
160 ti,bit-shift = <30>; 160 ti,bit-shift = <30>;
161 }; 161 };
162 162
163 dss1_alwon_fck_3430es2: dss1_alwon_fck_3430es2 { 163 dss1_alwon_fck: dss1_alwon_fck_3430es2 {
164 #clock-cells = <0>; 164 #clock-cells = <0>;
165 compatible = "ti,dss-gate-clock"; 165 compatible = "ti,dss-gate-clock";
166 clocks = <&dpll4_m4x2_ck>; 166 clocks = <&dpll4_m4x2_ck>;
@@ -169,7 +169,7 @@
169 ti,set-rate-parent; 169 ti,set-rate-parent;
170 }; 170 };
171 171
172 dss_ick_3430es2: dss_ick_3430es2 { 172 dss_ick: dss_ick_3430es2 {
173 #clock-cells = <0>; 173 #clock-cells = <0>;
174 compatible = "ti,omap3-dss-interface-clock"; 174 compatible = "ti,omap3-dss-interface-clock";
175 clocks = <&l4_ick>; 175 clocks = <&l4_ick>;
@@ -216,7 +216,7 @@
216 dss_clkdm: dss_clkdm { 216 dss_clkdm: dss_clkdm {
217 compatible = "ti,clockdomain"; 217 compatible = "ti,clockdomain";
218 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>, 218 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
219 <&dss1_alwon_fck_3430es2>, <&dss_ick_3430es2>; 219 <&dss1_alwon_fck>, <&dss_ick>;
220 }; 220 };
221 221
222 core_l4_clkdm: core_l4_clkdm { 222 core_l4_clkdm: core_l4_clkdm {
diff --git a/arch/arm/boot/dts/omap36xx-clocks.dtsi b/arch/arm/boot/dts/omap36xx-clocks.dtsi
index 2fcf253b677c..6b5280d04a0e 100644
--- a/arch/arm/boot/dts/omap36xx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap36xx-clocks.dtsi
@@ -70,6 +70,26 @@
70 }; 70 };
71}; 71};
72 72
73&dpll4_m2x2_mul_ck {
74 clock-mult = <1>;
75};
76
77&dpll4_m3x2_mul_ck {
78 clock-mult = <1>;
79};
80
81&dpll4_m4x2_mul_ck {
82 ti,clock-mult = <1>;
83};
84
85&dpll4_m5x2_mul_ck {
86 clock-mult = <1>;
87};
88
89&dpll4_m6x2_mul_ck {
90 clock-mult = <1>;
91};
92
73&cm_clockdomains { 93&cm_clockdomains {
74 dpll4_clkdm: dpll4_clkdm { 94 dpll4_clkdm: dpll4_clkdm {
75 compatible = "ti,clockdomain"; 95 compatible = "ti,clockdomain";
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index ba077cd95e4e..22cf4647087e 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -72,7 +72,13 @@
72 }; 72 };
73}; 73};
74 74
75/include/ "omap36xx-clocks.dtsi" 75/* OMAP3630 needs dss_96m_fck for VENC */
76&venc {
77 clocks = <&dss_tv_fck>, <&dss_96m_fck>;
78 clock-names = "fck", "tv_dac_clk";
79};
80
76/include/ "omap34xx-omap36xx-clocks.dtsi" 81/include/ "omap34xx-omap36xx-clocks.dtsi"
77/include/ "omap36xx-omap3430es2plus-clocks.dtsi" 82/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
78/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" 83/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
84/include/ "omap36xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap3xxx-clocks.dtsi b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
index cb04d4b37e7f..12be2b35dae9 100644
--- a/arch/arm/boot/dts/omap3xxx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
@@ -425,10 +425,11 @@
425 425
426 dpll4_m4x2_mul_ck: dpll4_m4x2_mul_ck { 426 dpll4_m4x2_mul_ck: dpll4_m4x2_mul_ck {
427 #clock-cells = <0>; 427 #clock-cells = <0>;
428 compatible = "fixed-factor-clock"; 428 compatible = "ti,fixed-factor-clock";
429 clocks = <&dpll4_m4_ck>; 429 clocks = <&dpll4_m4_ck>;
430 clock-mult = <2>; 430 ti,clock-mult = <2>;
431 clock-div = <1>; 431 ti,clock-div = <1>;
432 ti,set-rate-parent;
432 }; 433 };
433 434
434 dpll4_m4x2_ck: dpll4_m4x2_ck { 435 dpll4_m4x2_ck: dpll4_m4x2_ck {
@@ -438,6 +439,7 @@
438 ti,bit-shift = <0x1d>; 439 ti,bit-shift = <0x1d>;
439 reg = <0x0d00>; 440 reg = <0x0d00>;
440 ti,set-bit-to-disable; 441 ti,set-bit-to-disable;
442 ti,set-rate-parent;
441 }; 443 };
442 444
443 dpll4_m5_ck: dpll4_m5_ck { 445 dpll4_m5_ck: dpll4_m5_ck {
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index cbc45cfc44e9..d2c45bfaaa2c 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -16,6 +16,11 @@
16 reg = <0x80000000 0x40000000>; /* 1 GB */ 16 reg = <0x80000000 0x40000000>; /* 1 GB */
17 }; 17 };
18 18
19 aliases {
20 display0 = &dvi0;
21 display1 = &hdmi0;
22 };
23
19 leds: leds { 24 leds: leds {
20 compatible = "gpio-leds"; 25 compatible = "gpio-leds";
21 pinctrl-names = "default"; 26 pinctrl-names = "default";
@@ -100,6 +105,89 @@
100 startup-delay-us = <70000>; 105 startup-delay-us = <70000>;
101 enable-active-high; 106 enable-active-high;
102 }; 107 };
108
109 tfp410: encoder@0 {
110 compatible = "ti,tfp410";
111 powerdown-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; /* gpio_0 */
112
113 ports {
114 #address-cells = <1>;
115 #size-cells = <0>;
116
117 port@0 {
118 reg = <0>;
119
120 tfp410_in: endpoint@0 {
121 remote-endpoint = <&dpi_out>;
122 };
123 };
124
125 port@1 {
126 reg = <1>;
127
128 tfp410_out: endpoint@0 {
129 remote-endpoint = <&dvi_connector_in>;
130 };
131 };
132 };
133 };
134
135 dvi0: connector@0 {
136 compatible = "dvi-connector";
137 label = "dvi";
138
139 digital;
140
141 ddc-i2c-bus = <&i2c3>;
142
143 port {
144 dvi_connector_in: endpoint {
145 remote-endpoint = <&tfp410_out>;
146 };
147 };
148 };
149
150 tpd12s015: encoder@1 {
151 compatible = "ti,tpd12s015";
152
153 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
154 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
155 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
156
157 ports {
158 #address-cells = <1>;
159 #size-cells = <0>;
160
161 port@0 {
162 reg = <0>;
163
164 tpd12s015_in: endpoint@0 {
165 remote-endpoint = <&hdmi_out>;
166 };
167 };
168
169 port@1 {
170 reg = <1>;
171
172 tpd12s015_out: endpoint@0 {
173 remote-endpoint = <&hdmi_connector_in>;
174 };
175 };
176 };
177 };
178
179 hdmi0: connector@1 {
180 compatible = "hdmi-connector";
181 label = "hdmi";
182
183 type = "a";
184
185 port {
186 hdmi_connector_in: endpoint {
187 remote-endpoint = <&tpd12s015_out>;
188 };
189 };
190 };
103}; 191};
104 192
105&omap4_pmx_core { 193&omap4_pmx_core {
@@ -406,3 +494,30 @@
406&usbhsehci { 494&usbhsehci {
407 phys = <&hsusb1_phy>; 495 phys = <&hsusb1_phy>;
408}; 496};
497
498&dss {
499 status = "ok";
500
501 port {
502 dpi_out: endpoint {
503 remote-endpoint = <&tfp410_in>;
504 data-lines = <24>;
505 };
506 };
507};
508
509&dsi2 {
510 status = "ok";
511 vdd-supply = <&vcxio>;
512};
513
514&hdmi {
515 status = "ok";
516 vdda-supply = <&vdac>;
517
518 port {
519 hdmi_out: endpoint {
520 remote-endpoint = <&tpd12s015_in>;
521 };
522 };
523};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 9bbbbec1d63d..48983c8d56c2 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -19,6 +19,12 @@
19 reg = <0x80000000 0x40000000>; /* 1 GB */ 19 reg = <0x80000000 0x40000000>; /* 1 GB */
20 }; 20 };
21 21
22 aliases {
23 display0 = &lcd0;
24 display1 = &lcd1;
25 display2 = &hdmi0;
26 };
27
22 vdd_eth: fixedregulator-vdd-eth { 28 vdd_eth: fixedregulator-vdd-eth {
23 compatible = "regulator-fixed"; 29 compatible = "regulator-fixed";
24 regulator-name = "VDD_ETH"; 30 regulator-name = "VDD_ETH";
@@ -153,6 +159,48 @@
153 startup-delay-us = <70000>; 159 startup-delay-us = <70000>;
154 enable-active-high; 160 enable-active-high;
155 }; 161 };
162
163 tpd12s015: encoder@0 {
164 compatible = "ti,tpd12s015";
165
166 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
167 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
168 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
169
170 ports {
171 #address-cells = <1>;
172 #size-cells = <0>;
173
174 port@0 {
175 reg = <0>;
176
177 tpd12s015_in: endpoint@0 {
178 remote-endpoint = <&hdmi_out>;
179 };
180 };
181
182 port@1 {
183 reg = <1>;
184
185 tpd12s015_out: endpoint@0 {
186 remote-endpoint = <&hdmi_connector_in>;
187 };
188 };
189 };
190 };
191
192 hdmi0: connector@0 {
193 compatible = "hdmi-connector";
194 label = "hdmi";
195
196 type = "c";
197
198 port {
199 hdmi_connector_in: endpoint {
200 remote-endpoint = <&tpd12s015_out>;
201 };
202 };
203 };
156}; 204};
157 205
158&omap4_pmx_core { 206&omap4_pmx_core {
@@ -569,3 +617,68 @@
569 mode = <3>; 617 mode = <3>;
570 power = <50>; 618 power = <50>;
571}; 619};
620
621&dss {
622 status = "ok";
623};
624
625&dsi1 {
626 status = "ok";
627 vdd-supply = <&vcxio>;
628
629 port {
630 dsi1_out_ep: endpoint {
631 remote-endpoint = <&lcd0_in>;
632 lanes = <0 1 2 3 4 5>;
633 };
634 };
635
636 lcd0: display {
637 compatible = "tpo,taal", "panel-dsi-cm";
638 label = "lcd0";
639
640 reset-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
641
642 port {
643 lcd0_in: endpoint {
644 remote-endpoint = <&dsi1_out_ep>;
645 };
646 };
647 };
648};
649
650&dsi2 {
651 status = "ok";
652 vdd-supply = <&vcxio>;
653
654 port {
655 dsi2_out_ep: endpoint {
656 remote-endpoint = <&lcd1_in>;
657 lanes = <0 1 2 3 4 5>;
658 };
659 };
660
661 lcd1: display {
662 compatible = "tpo,taal", "panel-dsi-cm";
663 label = "lcd1";
664
665 reset-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* 104 */
666
667 port {
668 lcd1_in: endpoint {
669 remote-endpoint = <&dsi2_out_ep>;
670 };
671 };
672 };
673};
674
675&hdmi {
676 status = "ok";
677 vdda-supply = <&vdac>;
678
679 port {
680 hdmi_out: endpoint {
681 remote-endpoint = <&tpd12s015_in>;
682 };
683 };
684};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 0769ec57a3f5..2b4c1cbbce33 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -825,6 +825,85 @@
825 825
826 status = "disabled"; 826 status = "disabled";
827 }; 827 };
828
829 dss: dss@58000000 {
830 compatible = "ti,omap4-dss";
831 reg = <0x58000000 0x80>;
832 status = "disabled";
833 ti,hwmods = "dss_core";
834 clocks = <&dss_dss_clk>;
835 clock-names = "fck";
836 #address-cells = <1>;
837 #size-cells = <1>;
838 ranges;
839
840 dispc@58001000 {
841 compatible = "ti,omap4-dispc";
842 reg = <0x58001000 0x1000>;
843 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
844 ti,hwmods = "dss_dispc";
845 clocks = <&dss_dss_clk>;
846 clock-names = "fck";
847 };
848
849 rfbi: encoder@58002000 {
850 compatible = "ti,omap4-rfbi";
851 reg = <0x58002000 0x1000>;
852 status = "disabled";
853 ti,hwmods = "dss_rfbi";
854 clocks = <&dss_dss_clk>, <&dss_fck>;
855 clock-names = "fck", "ick";
856 };
857
858 venc: encoder@58003000 {
859 compatible = "ti,omap4-venc";
860 reg = <0x58003000 0x1000>;
861 status = "disabled";
862 ti,hwmods = "dss_venc";
863 clocks = <&dss_tv_clk>;
864 clock-names = "fck";
865 };
866
867 dsi1: encoder@58004000 {
868 compatible = "ti,omap4-dsi";
869 reg = <0x58004000 0x200>,
870 <0x58004200 0x40>,
871 <0x58004300 0x20>;
872 reg-names = "proto", "phy", "pll";
873 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
874 status = "disabled";
875 ti,hwmods = "dss_dsi1";
876 clocks = <&dss_dss_clk>, <&dss_sys_clk>;
877 clock-names = "fck", "sys_clk";
878 };
879
880 dsi2: encoder@58005000 {
881 compatible = "ti,omap4-dsi";
882 reg = <0x58005000 0x200>,
883 <0x58005200 0x40>,
884 <0x58005300 0x20>;
885 reg-names = "proto", "phy", "pll";
886 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
887 status = "disabled";
888 ti,hwmods = "dss_dsi2";
889 clocks = <&dss_dss_clk>, <&dss_sys_clk>;
890 clock-names = "fck", "sys_clk";
891 };
892
893 hdmi: encoder@58006000 {
894 compatible = "ti,omap4-hdmi";
895 reg = <0x58006000 0x200>,
896 <0x58006200 0x100>,
897 <0x58006300 0x100>,
898 <0x58006400 0x1000>;
899 reg-names = "wp", "pll", "phy", "core";
900 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
901 status = "disabled";
902 ti,hwmods = "dss_hdmi";
903 clocks = <&dss_48mhz_clk>, <&dss_sys_clk>;
904 clock-names = "fck", "sys_clk";
905 };
906 };
828 }; 907 };
829}; 908};
830 909
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index bc6013fbb773..b8920b6bc104 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -35,7 +35,11 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
35 35
36static void __init omap_generic_init(void) 36static void __init omap_generic_init(void)
37{ 37{
38 omapdss_early_init_of();
39
38 pdata_quirks_init(omap_dt_match_table); 40 pdata_quirks_init(omap_dt_match_table);
41
42 omapdss_init_of();
39} 43}
40 44
41#ifdef CONFIG_SOC_OMAP2420 45#ifdef CONFIG_SOC_OMAP2420
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index a6aae300542c..d88aff7baff8 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -315,5 +315,8 @@ extern int omap_dss_reset(struct omap_hwmod *);
315/* SoC specific clock initializer */ 315/* SoC specific clock initializer */
316int omap_clk_init(void); 316int omap_clk_init(void);
317 317
318int __init omapdss_init_of(void);
319void __init omapdss_early_init_of(void);
320
318#endif /* __ASSEMBLER__ */ 321#endif /* __ASSEMBLER__ */
319#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 322#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 93ebb4007ea9..16d33d831287 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,9 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/of.h>
27#include <linux/of_platform.h>
28#include <linux/slab.h>
26 29
27#include <video/omapdss.h> 30#include <video/omapdss.h>
28#include "omap_hwmod.h" 31#include "omap_hwmod.h"
@@ -551,3 +554,166 @@ int omap_dss_reset(struct omap_hwmod *oh)
551 554
552 return r; 555 return r;
553} 556}
557
558/* list of 'compatible' nodes to convert to omapdss specific */
559static const char * const dss_compat_conv_list[] __initconst = {
560 "composite-connector",
561 "dvi-connector",
562 "hdmi-connector",
563 "panel-dpi",
564 "panel-dsi-cm",
565 "sony,acx565akm",
566 "svideo-connector",
567 "ti,tfp410",
568 "ti,tpd12s015",
569};
570
571/* prepend compatible string with "omapdss," */
572static __init void omapdss_omapify_node(struct device_node *node,
573 const char *compat)
574{
575 char *new_compat;
576 struct property *prop;
577
578 new_compat = kasprintf(GFP_KERNEL, "omapdss,%s", compat);
579
580 prop = kzalloc(sizeof(*prop), GFP_KERNEL);
581
582 if (!prop) {
583 pr_err("omapdss_omapify_node: kzalloc failed\n");
584 return;
585 }
586
587 prop->name = "compatible";
588 prop->value = new_compat;
589 prop->length = strlen(new_compat) + 1;
590
591 of_update_property(node, prop);
592}
593
594/*
595 * As omapdss panel drivers are omapdss specific, but we want to define the
596 * DT-data in generic manner, we convert the compatible strings of the panel
597 * nodes from "panel-foo" to "omapdss,panel-foo". This way we can have both
598 * correct DT data and omapdss specific drivers.
599 *
600 * When we get generic panel drivers to the kernel, this will be removed.
601 */
602void __init omapdss_early_init_of(void)
603{
604 int i;
605
606 for (i = 0; i < ARRAY_SIZE(dss_compat_conv_list); ++i) {
607 const char *compat = dss_compat_conv_list[i];
608 struct device_node *node = NULL;
609
610 while ((node = of_find_compatible_node(node, NULL, compat))) {
611 if (!of_device_is_available(node))
612 continue;
613
614 omapdss_omapify_node(node, compat);
615 }
616 }
617}
618
619struct device_node * __init omapdss_find_dss_of_node(void)
620{
621 struct device_node *node;
622
623 node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
624 if (node)
625 return node;
626
627 node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
628 if (node)
629 return node;
630
631 node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
632 if (node)
633 return node;
634
635 return NULL;
636}
637
638int __init omapdss_init_of(void)
639{
640 int r;
641 enum omapdss_version ver;
642 struct device_node *node;
643 struct platform_device *pdev;
644
645 static struct omap_dss_board_info board_data = {
646 .dsi_enable_pads = omap_dsi_enable_pads,
647 .dsi_disable_pads = omap_dsi_disable_pads,
648 .set_min_bus_tput = omap_dss_set_min_bus_tput,
649 };
650
651 /* only create dss helper devices if dss is enabled in the .dts */
652
653 node = omapdss_find_dss_of_node();
654 if (!node)
655 return 0;
656
657 if (!of_device_is_available(node))
658 return 0;
659
660 ver = omap_display_get_version();
661
662 if (ver == OMAPDSS_VER_UNKNOWN) {
663 pr_err("DSS not supported on this SoC\n");
664 return -ENODEV;
665 }
666
667 pdev = of_find_device_by_node(node);
668
669 if (!pdev) {
670 pr_err("Unable to find DSS platform device\n");
671 return -ENODEV;
672 }
673
674 r = of_platform_populate(node, NULL, NULL, &pdev->dev);
675 if (r) {
676 pr_err("Unable to populate DSS submodule devices\n");
677 return r;
678 }
679
680 board_data.version = ver;
681
682 omap_display_device.dev.platform_data = &board_data;
683
684 r = platform_device_register(&omap_display_device);
685 if (r < 0) {
686 pr_err("Unable to register omapdss device\n");
687 return r;
688 }
689
690 /* create DRM device */
691 r = omap_init_drm();
692 if (r < 0) {
693 pr_err("Unable to register omapdrm device\n");
694 return r;
695 }
696
697 /* create vrfb device */
698 r = omap_init_vrfb();
699 if (r < 0) {
700 pr_err("Unable to register omapvrfb device\n");
701 return r;
702 }
703
704 /* create FB device */
705 r = omap_init_fb();
706 if (r < 0) {
707 pr_err("Unable to register omapfb device\n");
708 return r;
709 }
710
711 /* create V4L2 display device */
712 r = omap_init_vout();
713 if (r < 0) {
714 pr_err("Unable to register omap_vout device\n");
715 return r;
716 }
717
718 return 0;
719}
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index f3d2ce4bc262..7375854b16c7 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -30,4 +30,7 @@ int omap_init_drm(void);
30int omap_init_vrfb(void); 30int omap_init_vrfb(void);
31int omap_init_fb(void); 31int omap_init_fb(void);
32int omap_init_vout(void); 32int omap_init_vout(void);
33
34struct device_node * __init omapdss_find_dss_of_node(void);
35
33#endif 36#endif
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index dadccc91488c..ea2be0f5953b 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -33,227 +33,5 @@
33#include "soc.h" 33#include "soc.h"
34#include "dss-common.h" 34#include "dss-common.h"
35#include "mux.h" 35#include "mux.h"
36#include "display.h"
36 37
37#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
38#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
39#define HDMI_GPIO_HPD 63 /* Hotplug detect */
40
41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42
43/* DVI Connector */
44static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .name = "dvi",
46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
48};
49
50static struct platform_device omap4_panda_dvi_connector_device = {
51 .name = "connector-dvi",
52 .id = 0,
53 .dev.platform_data = &omap4_panda_dvi_connector_pdata,
54};
55
56/* TFP410 DPI-to-DVI chip */
57static struct encoder_tfp410_platform_data omap4_panda_tfp410_pdata = {
58 .name = "tfp410.0",
59 .source = "dpi.0",
60 .data_lines = 24,
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
62};
63
64static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
68};
69
70/* HDMI Connector */
71static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
74};
75
76static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
78 .id = 0,
79 .dev.platform_data = &omap4_panda_hdmi_connector_pdata,
80};
81
82/* TPD12S015 HDMI ESD protection & level shifter chip */
83static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
85 .source = "hdmi.0",
86
87 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
88 .ls_oe_gpio = HDMI_GPIO_LS_OE,
89 .hpd_gpio = HDMI_GPIO_HPD,
90};
91
92static struct platform_device omap4_panda_tpd_device = {
93 .name = "tpd12s015",
94 .id = 0,
95 .dev.platform_data = &omap4_panda_tpd_pdata,
96};
97
98static struct omap_dss_board_info omap4_panda_dss_data = {
99 .default_display_name = "dvi",
100};
101
102void __init omap4_panda_display_init_of(void)
103{
104 omap_display_init(&omap4_panda_dss_data);
105
106 platform_device_register(&omap4_panda_tfp410_device);
107 platform_device_register(&omap4_panda_dvi_connector_device);
108
109 platform_device_register(&omap4_panda_tpd_device);
110 platform_device_register(&omap4_panda_hdmi_connector_device);
111}
112
113
114/* OMAP4 Blaze display data */
115
116#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
117#define DLP_POWER_ON_GPIO 40
118
119static struct panel_dsicm_platform_data dsi1_panel = {
120 .name = "lcd",
121 .source = "dsi.0",
122 .reset_gpio = 102,
123 .use_ext_te = false,
124 .ext_te_gpio = 101,
125 .pin_config = {
126 .num_pins = 6,
127 .pins = { 0, 1, 2, 3, 4, 5 },
128 },
129};
130
131static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
133 .id = 0,
134 .dev.platform_data = &dsi1_panel,
135};
136
137static struct panel_dsicm_platform_data dsi2_panel = {
138 .name = "lcd2",
139 .source = "dsi.1",
140 .reset_gpio = 104,
141 .use_ext_te = false,
142 .ext_te_gpio = 103,
143 .pin_config = {
144 .num_pins = 6,
145 .pins = { 0, 1, 2, 3, 4, 5 },
146 },
147};
148
149static struct platform_device sdp4430_lcd2_device = {
150 .name = "panel-dsi-cm",
151 .id = 1,
152 .dev.platform_data = &dsi2_panel,
153};
154
155/* HDMI Connector */
156static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
157 .name = "hdmi",
158 .source = "tpd12s015.0",
159};
160
161static struct platform_device sdp4430_hdmi_connector_device = {
162 .name = "connector-hdmi",
163 .id = 0,
164 .dev.platform_data = &sdp4430_hdmi_connector_pdata,
165};
166
167/* TPD12S015 HDMI ESD protection & level shifter chip */
168static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
169 .name = "tpd12s015.0",
170 .source = "hdmi.0",
171
172 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
173 .ls_oe_gpio = HDMI_GPIO_LS_OE,
174 .hpd_gpio = HDMI_GPIO_HPD,
175};
176
177static struct platform_device sdp4430_tpd_device = {
178 .name = "tpd12s015",
179 .id = 0,
180 .dev.platform_data = &sdp4430_tpd_pdata,
181};
182
183
184static struct omap_dss_board_info sdp4430_dss_data = {
185 .default_display_name = "lcd",
186};
187
188/*
189 * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
190 * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
191 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
192 * selected by default
193 */
194void __init omap_4430sdp_display_init_of(void)
195{
196 int r;
197
198 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
199 "display_sel");
200 if (r)
201 pr_err("%s: Could not get display_sel GPIO\n", __func__);
202
203 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
204 "DLP POWER ON");
205 if (r)
206 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
207
208 omap_display_init(&sdp4430_dss_data);
209
210 platform_device_register(&sdp4430_lcd_device);
211 platform_device_register(&sdp4430_lcd2_device);
212
213 platform_device_register(&sdp4430_tpd_device);
214 platform_device_register(&sdp4430_hdmi_connector_device);
215}
216
217
218/* OMAP3 IGEPv2 data */
219
220#define IGEP2_DVI_TFP410_POWER_DOWN_GPIO 170
221
222/* DVI Connector */
223static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = {
224 .name = "dvi",
225 .source = "tfp410.0",
226 .i2c_bus_num = 2,
227};
228
229static struct platform_device omap3_igep2_dvi_connector_device = {
230 .name = "connector-dvi",
231 .id = 0,
232 .dev.platform_data = &omap3_igep2_dvi_connector_pdata,
233};
234
235/* TFP410 DPI-to-DVI chip */
236static struct encoder_tfp410_platform_data omap3_igep2_tfp410_pdata = {
237 .name = "tfp410.0",
238 .source = "dpi.0",
239 .data_lines = 24,
240 .power_down_gpio = IGEP2_DVI_TFP410_POWER_DOWN_GPIO,
241};
242
243static struct platform_device omap3_igep2_tfp410_device = {
244 .name = "tfp410",
245 .id = 0,
246 .dev.platform_data = &omap3_igep2_tfp410_pdata,
247};
248
249static struct omap_dss_board_info igep2_dss_data = {
250 .default_display_name = "dvi",
251};
252
253void __init omap3_igep2_display_init_of(void)
254{
255 omap_display_init(&igep2_dss_data);
256
257 platform_device_register(&omap3_igep2_tfp410_device);
258 platform_device_register(&omap3_igep2_dvi_connector_device);
259}
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index b04c5f0fc278..c3b73351cb7a 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -141,7 +141,6 @@ static void __init omap3_sbc_t3530_legacy_init(void)
141 141
142static void __init omap3_igep0020_legacy_init(void) 142static void __init omap3_igep0020_legacy_init(void)
143{ 143{
144 omap3_igep2_display_init_of();
145} 144}
146 145
147static void __init omap3_evm_legacy_init(void) 146static void __init omap3_evm_legacy_init(void)
@@ -247,14 +246,12 @@ static void __init nokia_n900_legacy_init(void)
247#ifdef CONFIG_ARCH_OMAP4 246#ifdef CONFIG_ARCH_OMAP4
248static void __init omap4_sdp_legacy_init(void) 247static void __init omap4_sdp_legacy_init(void)
249{ 248{
250 omap_4430sdp_display_init_of();
251 legacy_init_wl12xx(WL12XX_REFCLOCK_26, 249 legacy_init_wl12xx(WL12XX_REFCLOCK_26,
252 WL12XX_TCXOCLOCK_26, 53); 250 WL12XX_TCXOCLOCK_26, 53);
253} 251}
254 252
255static void __init omap4_panda_legacy_init(void) 253static void __init omap4_panda_legacy_init(void)
256{ 254{
257 omap4_panda_display_init_of();
258 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 255 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
259} 256}
260#endif 257#endif
diff --git a/drivers/video/omap2/displays-new/connector-analog-tv.c b/drivers/video/omap2/displays-new/connector-analog-tv.c
index 27f33ef8fca1..5ee3b5505f7f 100644
--- a/drivers/video/omap2/displays-new/connector-analog-tv.c
+++ b/drivers/video/omap2/displays-new/connector-analog-tv.c
@@ -12,6 +12,7 @@
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/of.h>
15 16
16#include <video/omapdss.h> 17#include <video/omapdss.h>
17#include <video/omap-panel-data.h> 18#include <video/omap-panel-data.h>
@@ -42,6 +43,12 @@ static const struct omap_video_timings tvc_pal_timings = {
42 .interlace = true, 43 .interlace = true,
43}; 44};
44 45
46static const struct of_device_id tvc_of_match[];
47
48struct tvc_of_data {
49 enum omap_dss_venc_type connector_type;
50};
51
45#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev) 52#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)
46 53
47static int tvc_connect(struct omap_dss_device *dssdev) 54static int tvc_connect(struct omap_dss_device *dssdev)
@@ -91,8 +98,12 @@ static int tvc_enable(struct omap_dss_device *dssdev)
91 98
92 in->ops.atv->set_timings(in, &ddata->timings); 99 in->ops.atv->set_timings(in, &ddata->timings);
93 100
94 in->ops.atv->set_type(in, ddata->connector_type); 101 if (!ddata->dev->of_node) {
95 in->ops.atv->invert_vid_out_polarity(in, ddata->invert_polarity); 102 in->ops.atv->set_type(in, ddata->connector_type);
103
104 in->ops.atv->invert_vid_out_polarity(in,
105 ddata->invert_polarity);
106 }
96 107
97 r = in->ops.atv->enable(in); 108 r = in->ops.atv->enable(in);
98 if (r) 109 if (r)
@@ -205,6 +216,23 @@ static int tvc_probe_pdata(struct platform_device *pdev)
205 return 0; 216 return 0;
206} 217}
207 218
219static int tvc_probe_of(struct platform_device *pdev)
220{
221 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
222 struct device_node *node = pdev->dev.of_node;
223 struct omap_dss_device *in;
224
225 in = omapdss_of_find_source_for_first_ep(node);
226 if (IS_ERR(in)) {
227 dev_err(&pdev->dev, "failed to find video source\n");
228 return PTR_ERR(in);
229 }
230
231 ddata->in = in;
232
233 return 0;
234}
235
208static int tvc_probe(struct platform_device *pdev) 236static int tvc_probe(struct platform_device *pdev)
209{ 237{
210 struct panel_drv_data *ddata; 238 struct panel_drv_data *ddata;
@@ -222,6 +250,10 @@ static int tvc_probe(struct platform_device *pdev)
222 r = tvc_probe_pdata(pdev); 250 r = tvc_probe_pdata(pdev);
223 if (r) 251 if (r)
224 return r; 252 return r;
253 } else if (pdev->dev.of_node) {
254 r = tvc_probe_of(pdev);
255 if (r)
256 return r;
225 } else { 257 } else {
226 return -ENODEV; 258 return -ENODEV;
227 } 259 }
@@ -263,12 +295,19 @@ static int __exit tvc_remove(struct platform_device *pdev)
263 return 0; 295 return 0;
264} 296}
265 297
298static const struct of_device_id tvc_of_match[] = {
299 { .compatible = "omapdss,svideo-connector", },
300 { .compatible = "omapdss,composite-video-connector", },
301 {},
302};
303
266static struct platform_driver tvc_connector_driver = { 304static struct platform_driver tvc_connector_driver = {
267 .probe = tvc_probe, 305 .probe = tvc_probe,
268 .remove = __exit_p(tvc_remove), 306 .remove = __exit_p(tvc_remove),
269 .driver = { 307 .driver = {
270 .name = "connector-analog-tv", 308 .name = "connector-analog-tv",
271 .owner = THIS_MODULE, 309 .owner = THIS_MODULE,
310 .of_match_table = tvc_of_match,
272 }, 311 },
273}; 312};
274 313
diff --git a/drivers/video/omap2/displays-new/connector-dvi.c b/drivers/video/omap2/displays-new/connector-dvi.c
index d18e4b8c0731..74de2bc50c4f 100644
--- a/drivers/video/omap2/displays-new/connector-dvi.c
+++ b/drivers/video/omap2/displays-new/connector-dvi.c
@@ -277,6 +277,37 @@ static int dvic_probe_pdata(struct platform_device *pdev)
277 return 0; 277 return 0;
278} 278}
279 279
280static int dvic_probe_of(struct platform_device *pdev)
281{
282 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
283 struct device_node *node = pdev->dev.of_node;
284 struct omap_dss_device *in;
285 struct device_node *adapter_node;
286 struct i2c_adapter *adapter;
287
288 in = omapdss_of_find_source_for_first_ep(node);
289 if (IS_ERR(in)) {
290 dev_err(&pdev->dev, "failed to find video source\n");
291 return PTR_ERR(in);
292 }
293
294 ddata->in = in;
295
296 adapter_node = of_parse_phandle(node, "ddc-i2c-bus", 0);
297 if (adapter_node) {
298 adapter = of_find_i2c_adapter_by_node(adapter_node);
299 if (adapter == NULL) {
300 dev_err(&pdev->dev, "failed to parse ddc-i2c-bus\n");
301 omap_dss_put_device(ddata->in);
302 return -EPROBE_DEFER;
303 }
304
305 ddata->i2c_adapter = adapter;
306 }
307
308 return 0;
309}
310
280static int dvic_probe(struct platform_device *pdev) 311static int dvic_probe(struct platform_device *pdev)
281{ 312{
282 struct panel_drv_data *ddata; 313 struct panel_drv_data *ddata;
@@ -293,6 +324,10 @@ static int dvic_probe(struct platform_device *pdev)
293 r = dvic_probe_pdata(pdev); 324 r = dvic_probe_pdata(pdev);
294 if (r) 325 if (r)
295 return r; 326 return r;
327 } else if (pdev->dev.of_node) {
328 r = dvic_probe_of(pdev);
329 if (r)
330 return r;
296 } else { 331 } else {
297 return -ENODEV; 332 return -ENODEV;
298 } 333 }
@@ -342,12 +377,20 @@ static int __exit dvic_remove(struct platform_device *pdev)
342 return 0; 377 return 0;
343} 378}
344 379
380static const struct of_device_id dvic_of_match[] = {
381 { .compatible = "omapdss,dvi-connector", },
382 {},
383};
384
385MODULE_DEVICE_TABLE(of, dvic_of_match);
386
345static struct platform_driver dvi_connector_driver = { 387static struct platform_driver dvi_connector_driver = {
346 .probe = dvic_probe, 388 .probe = dvic_probe,
347 .remove = __exit_p(dvic_remove), 389 .remove = __exit_p(dvic_remove),
348 .driver = { 390 .driver = {
349 .name = "connector-dvi", 391 .name = "connector-dvi",
350 .owner = THIS_MODULE, 392 .owner = THIS_MODULE,
393 .of_match_table = dvic_of_match,
351 }, 394 },
352}; 395};
353 396
diff --git a/drivers/video/omap2/displays-new/connector-hdmi.c b/drivers/video/omap2/displays-new/connector-hdmi.c
index 9393e2d6473d..29ed21b9dce5 100644
--- a/drivers/video/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/omap2/displays-new/connector-hdmi.c
@@ -12,6 +12,7 @@
12#include <linux/slab.h> 12#include <linux/slab.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/of.h>
15 16
16#include <drm/drm_edid.h> 17#include <drm/drm_edid.h>
17 18
@@ -301,6 +302,23 @@ static int hdmic_probe_pdata(struct platform_device *pdev)
301 return 0; 302 return 0;
302} 303}
303 304
305static int hdmic_probe_of(struct platform_device *pdev)
306{
307 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
308 struct device_node *node = pdev->dev.of_node;
309 struct omap_dss_device *in;
310
311 in = omapdss_of_find_source_for_first_ep(node);
312 if (IS_ERR(in)) {
313 dev_err(&pdev->dev, "failed to find video source\n");
314 return PTR_ERR(in);
315 }
316
317 ddata->in = in;
318
319 return 0;
320}
321
304static int hdmic_probe(struct platform_device *pdev) 322static int hdmic_probe(struct platform_device *pdev)
305{ 323{
306 struct panel_drv_data *ddata; 324 struct panel_drv_data *ddata;
@@ -318,6 +336,10 @@ static int hdmic_probe(struct platform_device *pdev)
318 r = hdmic_probe_pdata(pdev); 336 r = hdmic_probe_pdata(pdev);
319 if (r) 337 if (r)
320 return r; 338 return r;
339 } else if (pdev->dev.of_node) {
340 r = hdmic_probe_of(pdev);
341 if (r)
342 return r;
321 } else { 343 } else {
322 return -ENODEV; 344 return -ENODEV;
323 } 345 }
@@ -359,12 +381,20 @@ static int __exit hdmic_remove(struct platform_device *pdev)
359 return 0; 381 return 0;
360} 382}
361 383
384static const struct of_device_id hdmic_of_match[] = {
385 { .compatible = "omapdss,hdmi-connector", },
386 {},
387};
388
389MODULE_DEVICE_TABLE(of, hdmic_of_match);
390
362static struct platform_driver hdmi_connector_driver = { 391static struct platform_driver hdmi_connector_driver = {
363 .probe = hdmic_probe, 392 .probe = hdmic_probe,
364 .remove = __exit_p(hdmic_remove), 393 .remove = __exit_p(hdmic_remove),
365 .driver = { 394 .driver = {
366 .name = "connector-hdmi", 395 .name = "connector-hdmi",
367 .owner = THIS_MODULE, 396 .owner = THIS_MODULE,
397 .of_match_table = hdmic_of_match,
368 }, 398 },
369}; 399};
370 400
diff --git a/drivers/video/omap2/displays-new/encoder-tfp410.c b/drivers/video/omap2/displays-new/encoder-tfp410.c
index 4a291e756be9..b4e9a42a79e6 100644
--- a/drivers/video/omap2/displays-new/encoder-tfp410.c
+++ b/drivers/video/omap2/displays-new/encoder-tfp410.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/of_gpio.h>
16 17
17#include <video/omapdss.h> 18#include <video/omapdss.h>
18#include <video/omap-panel-data.h> 19#include <video/omap-panel-data.h>
@@ -82,7 +83,8 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
82 return 0; 83 return 0;
83 84
84 in->ops.dpi->set_timings(in, &ddata->timings); 85 in->ops.dpi->set_timings(in, &ddata->timings);
85 in->ops.dpi->set_data_lines(in, ddata->data_lines); 86 if (ddata->data_lines)
87 in->ops.dpi->set_data_lines(in, ddata->data_lines);
86 88
87 r = in->ops.dpi->enable(in); 89 r = in->ops.dpi->enable(in);
88 if (r) 90 if (r)
@@ -179,6 +181,33 @@ static int tfp410_probe_pdata(struct platform_device *pdev)
179 return 0; 181 return 0;
180} 182}
181 183
184static int tfp410_probe_of(struct platform_device *pdev)
185{
186 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
187 struct device_node *node = pdev->dev.of_node;
188 struct omap_dss_device *in;
189 int gpio;
190
191 gpio = of_get_named_gpio(node, "powerdown-gpios", 0);
192
193 if (gpio_is_valid(gpio) || gpio == -ENOENT) {
194 ddata->pd_gpio = gpio;
195 } else {
196 dev_err(&pdev->dev, "failed to parse PD gpio\n");
197 return gpio;
198 }
199
200 in = omapdss_of_find_source_for_first_ep(node);
201 if (IS_ERR(in)) {
202 dev_err(&pdev->dev, "failed to find video source\n");
203 return PTR_ERR(in);
204 }
205
206 ddata->in = in;
207
208 return 0;
209}
210
182static int tfp410_probe(struct platform_device *pdev) 211static int tfp410_probe(struct platform_device *pdev)
183{ 212{
184 struct panel_drv_data *ddata; 213 struct panel_drv_data *ddata;
@@ -195,6 +224,10 @@ static int tfp410_probe(struct platform_device *pdev)
195 r = tfp410_probe_pdata(pdev); 224 r = tfp410_probe_pdata(pdev);
196 if (r) 225 if (r)
197 return r; 226 return r;
227 } else if (pdev->dev.of_node) {
228 r = tfp410_probe_of(pdev);
229 if (r)
230 return r;
198 } else { 231 } else {
199 return -ENODEV; 232 return -ENODEV;
200 } 233 }
@@ -251,12 +284,20 @@ static int __exit tfp410_remove(struct platform_device *pdev)
251 return 0; 284 return 0;
252} 285}
253 286
287static const struct of_device_id tfp410_of_match[] = {
288 { .compatible = "omapdss,ti,tfp410", },
289 {},
290};
291
292MODULE_DEVICE_TABLE(of, tfp410_of_match);
293
254static struct platform_driver tfp410_driver = { 294static struct platform_driver tfp410_driver = {
255 .probe = tfp410_probe, 295 .probe = tfp410_probe,
256 .remove = __exit_p(tfp410_remove), 296 .remove = __exit_p(tfp410_remove),
257 .driver = { 297 .driver = {
258 .name = "tfp410", 298 .name = "tfp410",
259 .owner = THIS_MODULE, 299 .owner = THIS_MODULE,
300 .of_match_table = tfp410_of_match,
260 }, 301 },
261}; 302};
262 303
diff --git a/drivers/video/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/omap2/displays-new/encoder-tpd12s015.c
index d5c936cb217f..7e33686171e3 100644
--- a/drivers/video/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/omap2/displays-new/encoder-tpd12s015.c
@@ -15,6 +15,7 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/of_gpio.h>
18 19
19#include <video/omapdss.h> 20#include <video/omapdss.h>
20#include <video/omap-panel-data.h> 21#include <video/omap-panel-data.h>
@@ -289,6 +290,49 @@ static int tpd_probe_pdata(struct platform_device *pdev)
289 return 0; 290 return 0;
290} 291}
291 292
293static int tpd_probe_of(struct platform_device *pdev)
294{
295 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
296 struct device_node *node = pdev->dev.of_node;
297 struct omap_dss_device *in;
298 int gpio;
299
300 /* CT CP HPD GPIO */
301 gpio = of_get_gpio(node, 0);
302 if (!gpio_is_valid(gpio)) {
303 dev_err(&pdev->dev, "failed to parse CT CP HPD gpio\n");
304 return gpio;
305 }
306 ddata->ct_cp_hpd_gpio = gpio;
307
308 /* LS OE GPIO */
309 gpio = of_get_gpio(node, 1);
310 if (gpio_is_valid(gpio) || gpio == -ENOENT) {
311 ddata->ls_oe_gpio = gpio;
312 } else {
313 dev_err(&pdev->dev, "failed to parse LS OE gpio\n");
314 return gpio;
315 }
316
317 /* HPD GPIO */
318 gpio = of_get_gpio(node, 2);
319 if (!gpio_is_valid(gpio)) {
320 dev_err(&pdev->dev, "failed to parse HPD gpio\n");
321 return gpio;
322 }
323 ddata->hpd_gpio = gpio;
324
325 in = omapdss_of_find_source_for_first_ep(node);
326 if (IS_ERR(in)) {
327 dev_err(&pdev->dev, "failed to find video source\n");
328 return PTR_ERR(in);
329 }
330
331 ddata->in = in;
332
333 return 0;
334}
335
292static int tpd_probe(struct platform_device *pdev) 336static int tpd_probe(struct platform_device *pdev)
293{ 337{
294 struct omap_dss_device *in, *dssdev; 338 struct omap_dss_device *in, *dssdev;
@@ -307,6 +351,10 @@ static int tpd_probe(struct platform_device *pdev)
307 r = tpd_probe_pdata(pdev); 351 r = tpd_probe_pdata(pdev);
308 if (r) 352 if (r)
309 return r; 353 return r;
354 } else if (pdev->dev.of_node) {
355 r = tpd_probe_of(pdev);
356 if (r)
357 return r;
310 } else { 358 } else {
311 return -ENODEV; 359 return -ENODEV;
312 } 360 }
@@ -379,12 +427,20 @@ static int __exit tpd_remove(struct platform_device *pdev)
379 return 0; 427 return 0;
380} 428}
381 429
430static const struct of_device_id tpd_of_match[] = {
431 { .compatible = "omapdss,ti,tpd12s015", },
432 {},
433};
434
435MODULE_DEVICE_TABLE(of, tpd_of_match);
436
382static struct platform_driver tpd_driver = { 437static struct platform_driver tpd_driver = {
383 .probe = tpd_probe, 438 .probe = tpd_probe,
384 .remove = __exit_p(tpd_remove), 439 .remove = __exit_p(tpd_remove),
385 .driver = { 440 .driver = {
386 .name = "tpd12s015", 441 .name = "tpd12s015",
387 .owner = THIS_MODULE, 442 .owner = THIS_MODULE,
443 .of_match_table = tpd_of_match,
388 }, 444 },
389}; 445};
390 446
diff --git a/drivers/video/omap2/displays-new/panel-dsi-cm.c b/drivers/video/omap2/displays-new/panel-dsi-cm.c
index f317c878a259..d6f14e8717e8 100644
--- a/drivers/video/omap2/displays-new/panel-dsi-cm.c
+++ b/drivers/video/omap2/displays-new/panel-dsi-cm.c
@@ -22,6 +22,8 @@
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/of_device.h>
26#include <linux/of_gpio.h>
25 27
26#include <video/omapdss.h> 28#include <video/omapdss.h>
27#include <video/omap-panel-data.h> 29#include <video/omap-panel-data.h>
@@ -595,10 +597,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
595 .lp_clk_max = 10000000, 597 .lp_clk_max = 10000000,
596 }; 598 };
597 599
598 r = in->ops.dsi->configure_pins(in, &ddata->pin_config); 600 if (ddata->pin_config.num_pins > 0) {
599 if (r) { 601 r = in->ops.dsi->configure_pins(in, &ddata->pin_config);
600 dev_err(&ddata->pdev->dev, "failed to configure DSI pins\n"); 602 if (r) {
601 goto err0; 603 dev_err(&ddata->pdev->dev,
604 "failed to configure DSI pins\n");
605 goto err0;
606 }
602 } 607 }
603 608
604 r = in->ops.dsi->set_config(in, &dsi_config); 609 r = in->ops.dsi->set_config(in, &dsi_config);
@@ -1156,6 +1161,41 @@ static int dsicm_probe_pdata(struct platform_device *pdev)
1156 return 0; 1161 return 0;
1157} 1162}
1158 1163
1164static int dsicm_probe_of(struct platform_device *pdev)
1165{
1166 struct device_node *node = pdev->dev.of_node;
1167 struct panel_drv_data *ddata = platform_get_drvdata(pdev);
1168 struct omap_dss_device *in;
1169 int gpio;
1170
1171 gpio = of_get_named_gpio(node, "reset-gpios", 0);
1172 if (!gpio_is_valid(gpio)) {
1173 dev_err(&pdev->dev, "failed to parse reset gpio\n");
1174 return gpio;
1175 }
1176 ddata->reset_gpio = gpio;
1177
1178 gpio = of_get_named_gpio(node, "te-gpios", 0);
1179 if (gpio_is_valid(gpio) || gpio == -ENOENT) {
1180 ddata->ext_te_gpio = gpio;
1181 } else {
1182 dev_err(&pdev->dev, "failed to parse TE gpio\n");
1183 return gpio;
1184 }
1185
1186 in = omapdss_of_find_source_for_first_ep(node);
1187 if (IS_ERR(in)) {
1188 dev_err(&pdev->dev, "failed to find video source\n");
1189 return PTR_ERR(in);
1190 }
1191
1192 ddata->in = in;
1193
1194 /* TODO: ulps, backlight */
1195
1196 return 0;
1197}
1198
1159static int dsicm_probe(struct platform_device *pdev) 1199static int dsicm_probe(struct platform_device *pdev)
1160{ 1200{
1161 struct backlight_properties props; 1201 struct backlight_properties props;
@@ -1178,6 +1218,10 @@ static int dsicm_probe(struct platform_device *pdev)
1178 r = dsicm_probe_pdata(pdev); 1218 r = dsicm_probe_pdata(pdev);
1179 if (r) 1219 if (r)
1180 return r; 1220 return r;
1221 } else if (pdev->dev.of_node) {
1222 r = dsicm_probe_of(pdev);
1223 if (r)
1224 return r;
1181 } else { 1225 } else {
1182 return -ENODEV; 1226 return -ENODEV;
1183 } 1227 }
@@ -1320,12 +1364,20 @@ static int __exit dsicm_remove(struct platform_device *pdev)
1320 return 0; 1364 return 0;
1321} 1365}
1322 1366
1367static const struct of_device_id dsicm_of_match[] = {
1368 { .compatible = "omapdss,panel-dsi-cm", },
1369 {},
1370};
1371
1372MODULE_DEVICE_TABLE(of, dsicm_of_match);
1373
1323static struct platform_driver dsicm_driver = { 1374static struct platform_driver dsicm_driver = {
1324 .probe = dsicm_probe, 1375 .probe = dsicm_probe,
1325 .remove = __exit_p(dsicm_remove), 1376 .remove = __exit_p(dsicm_remove),
1326 .driver = { 1377 .driver = {
1327 .name = "panel-dsi-cm", 1378 .name = "panel-dsi-cm",
1328 .owner = THIS_MODULE, 1379 .owner = THIS_MODULE,
1380 .of_match_table = dsicm_of_match,
1329 }, 1381 },
1330}; 1382};
1331 1383
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index 27f60ad6b2ab..c7ba4d8b928a 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -30,6 +30,8 @@
30#include <linux/backlight.h> 30#include <linux/backlight.h>
31#include <linux/fb.h> 31#include <linux/fb.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/of.h>
34#include <linux/of_gpio.h>
33 35
34#include <video/omapdss.h> 36#include <video/omapdss.h>
35#include <video/omap-panel-data.h> 37#include <video/omap-panel-data.h>
@@ -547,7 +549,9 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
547 dev_dbg(&ddata->spi->dev, "%s\n", __func__); 549 dev_dbg(&ddata->spi->dev, "%s\n", __func__);
548 550
549 in->ops.sdi->set_timings(in, &ddata->videomode); 551 in->ops.sdi->set_timings(in, &ddata->videomode);
550 in->ops.sdi->set_datapairs(in, ddata->datapairs); 552
553 if (ddata->datapairs > 0)
554 in->ops.sdi->set_datapairs(in, ddata->datapairs);
551 555
552 r = in->ops.sdi->enable(in); 556 r = in->ops.sdi->enable(in);
553 if (r) { 557 if (r) {
@@ -726,6 +730,22 @@ static int acx565akm_probe_pdata(struct spi_device *spi)
726 return 0; 730 return 0;
727} 731}
728 732
733static int acx565akm_probe_of(struct spi_device *spi)
734{
735 struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
736 struct device_node *np = spi->dev.of_node;
737
738 ddata->reset_gpio = of_get_named_gpio(np, "reset-gpios", 0);
739
740 ddata->in = omapdss_of_find_source_for_first_ep(np);
741 if (IS_ERR(ddata->in)) {
742 dev_err(&spi->dev, "failed to find video source\n");
743 return PTR_ERR(ddata->in);
744 }
745
746 return 0;
747}
748
729static int acx565akm_probe(struct spi_device *spi) 749static int acx565akm_probe(struct spi_device *spi)
730{ 750{
731 struct panel_drv_data *ddata; 751 struct panel_drv_data *ddata;
@@ -753,7 +773,12 @@ static int acx565akm_probe(struct spi_device *spi)
753 r = acx565akm_probe_pdata(spi); 773 r = acx565akm_probe_pdata(spi);
754 if (r) 774 if (r)
755 return r; 775 return r;
776 } else if (spi->dev.of_node) {
777 r = acx565akm_probe_of(spi);
778 if (r)
779 return r;
756 } else { 780 } else {
781 dev_err(&spi->dev, "platform data missing!\n");
757 return -ENODEV; 782 return -ENODEV;
758 } 783 }
759 784
@@ -864,10 +889,16 @@ static int acx565akm_remove(struct spi_device *spi)
864 return 0; 889 return 0;
865} 890}
866 891
892static const struct of_device_id acx565akm_of_match[] = {
893 { .compatible = "omapdss,sony,acx565akm", },
894 {},
895};
896
867static struct spi_driver acx565akm_driver = { 897static struct spi_driver acx565akm_driver = {
868 .driver = { 898 .driver = {
869 .name = "acx565akm", 899 .name = "acx565akm",
870 .owner = THIS_MODULE, 900 .owner = THIS_MODULE,
901 .of_match_table = acx565akm_of_match,
871 }, 902 },
872 .probe = acx565akm_probe, 903 .probe = acx565akm_probe,
873 .remove = acx565akm_remove, 904 .remove = acx565akm_remove,
diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile
index d3aa91bdd6a8..8aec8bda27cc 100644
--- a/drivers/video/omap2/dss/Makefile
+++ b/drivers/video/omap2/dss/Makefile
@@ -1,7 +1,7 @@
1obj-$(CONFIG_OMAP2_DSS) += omapdss.o 1obj-$(CONFIG_OMAP2_DSS) += omapdss.o
2# Core DSS files 2# Core DSS files
3omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \ 3omapdss-y := core.o dss.o dss_features.o dispc.o dispc_coefs.o display.o \
4 output.o 4 output.o dss-of.o
5# DSS compat layer files 5# DSS compat layer files
6omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \ 6omapdss-y += manager.o manager-sysfs.o overlay.o overlay-sysfs.o apply.o \
7 dispc-compat.o display-sysfs.o 7 dispc-compat.o display-sysfs.o
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index aaecbf347748..2bbdb7ff7daf 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3778,12 +3778,20 @@ static const struct dev_pm_ops dispc_pm_ops = {
3778 .runtime_resume = dispc_runtime_resume, 3778 .runtime_resume = dispc_runtime_resume,
3779}; 3779};
3780 3780
3781static const struct of_device_id dispc_of_match[] = {
3782 { .compatible = "ti,omap2-dispc", },
3783 { .compatible = "ti,omap3-dispc", },
3784 { .compatible = "ti,omap4-dispc", },
3785 {},
3786};
3787
3781static struct platform_driver omap_dispchw_driver = { 3788static struct platform_driver omap_dispchw_driver = {
3782 .remove = __exit_p(omap_dispchw_remove), 3789 .remove = __exit_p(omap_dispchw_remove),
3783 .driver = { 3790 .driver = {
3784 .name = "omapdss_dispc", 3791 .name = "omapdss_dispc",
3785 .owner = THIS_MODULE, 3792 .owner = THIS_MODULE,
3786 .pm = &dispc_pm_ops, 3793 .pm = &dispc_pm_ops,
3794 .of_match_table = dispc_of_match,
3787 }, 3795 },
3788}; 3796};
3789 3797
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 9f19ae22944c..2412a0dd0c13 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -26,6 +26,7 @@
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/jiffies.h> 27#include <linux/jiffies.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/of.h>
29 30
30#include <video/omapdss.h> 31#include <video/omapdss.h>
31#include "dss.h" 32#include "dss.h"
@@ -133,9 +134,32 @@ static int disp_num_counter;
133int omapdss_register_display(struct omap_dss_device *dssdev) 134int omapdss_register_display(struct omap_dss_device *dssdev)
134{ 135{
135 struct omap_dss_driver *drv = dssdev->driver; 136 struct omap_dss_driver *drv = dssdev->driver;
137 int id;
136 138
137 snprintf(dssdev->alias, sizeof(dssdev->alias), 139 /*
138 "display%d", disp_num_counter++); 140 * Note: this presumes all the displays are either using DT or non-DT,
141 * which normally should be the case. This also presumes that all
142 * displays either have an DT alias, or none has.
143 */
144
145 if (dssdev->dev->of_node) {
146 id = of_alias_get_id(dssdev->dev->of_node, "display");
147
148 if (id < 0)
149 id = disp_num_counter++;
150 } else {
151 id = disp_num_counter++;
152 }
153
154 snprintf(dssdev->alias, sizeof(dssdev->alias), "display%d", id);
155
156 /* Use 'label' property for name, if it exists */
157 if (dssdev->dev->of_node)
158 of_property_read_string(dssdev->dev->of_node, "label",
159 &dssdev->name);
160
161 if (dssdev->name == NULL)
162 dssdev->name = dssdev->alias;
139 163
140 if (drv && drv->get_resolution == NULL) 164 if (drv && drv->get_resolution == NULL)
141 drv->get_resolution = omapdss_default_get_resolution; 165 drv->get_resolution = omapdss_default_get_resolution;
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 6c0bb099b7bf..157921db447a 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -30,6 +30,7 @@
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/regulator/consumer.h> 31#include <linux/regulator/consumer.h>
32#include <linux/string.h> 32#include <linux/string.h>
33#include <linux/of.h>
33 34
34#include <video/omapdss.h> 35#include <video/omapdss.h>
35 36
@@ -49,6 +50,8 @@ static struct {
49 int data_lines; 50 int data_lines;
50 51
51 struct omap_dss_device output; 52 struct omap_dss_device output;
53
54 bool port_initialized;
52} dpi; 55} dpi;
53 56
54static struct platform_device *dpi_get_dsidev(enum omap_channel channel) 57static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
@@ -725,3 +728,47 @@ void __exit dpi_uninit_platform_driver(void)
725{ 728{
726 platform_driver_unregister(&omap_dpi_driver); 729 platform_driver_unregister(&omap_dpi_driver);
727} 730}
731
732int __init dpi_init_port(struct platform_device *pdev, struct device_node *port)
733{
734 struct device_node *ep;
735 u32 datalines;
736 int r;
737
738 ep = omapdss_of_get_next_endpoint(port, NULL);
739 if (!ep)
740 return 0;
741
742 r = of_property_read_u32(ep, "data-lines", &datalines);
743 if (r) {
744 DSSERR("failed to parse datalines\n");
745 goto err_datalines;
746 }
747
748 dpi.data_lines = datalines;
749
750 of_node_put(ep);
751
752 dpi.pdev = pdev;
753
754 mutex_init(&dpi.lock);
755
756 dpi_init_output(pdev);
757
758 dpi.port_initialized = true;
759
760 return 0;
761
762err_datalines:
763 of_node_put(ep);
764
765 return r;
766}
767
768void __exit dpi_uninit_port(void)
769{
770 if (!dpi.port_initialized)
771 return;
772
773 dpi_uninit_output(dpi.pdev);
774}
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 0d82f731d2f0..121d1049d0bc 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -38,6 +38,8 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/debugfs.h> 39#include <linux/debugfs.h>
40#include <linux/pm_runtime.h> 40#include <linux/pm_runtime.h>
41#include <linux/of.h>
42#include <linux/of_platform.h>
41 43
42#include <video/omapdss.h> 44#include <video/omapdss.h>
43#include <video/mipi_display.h> 45#include <video/mipi_display.h>
@@ -386,6 +388,13 @@ struct dsi_packet_sent_handler_data {
386 struct completion *completion; 388 struct completion *completion;
387}; 389};
388 390
391struct dsi_module_id_data {
392 u32 address;
393 int id;
394};
395
396static const struct of_device_id dsi_of_match[];
397
389#ifdef DSI_PERF_MEASURE 398#ifdef DSI_PERF_MEASURE
390static bool dsi_perf; 399static bool dsi_perf;
391module_param(dsi_perf, bool, 0644); 400module_param(dsi_perf, bool, 0644);
@@ -1151,15 +1160,11 @@ static int dsi_regulator_init(struct platform_device *dsidev)
1151 if (dsi->vdds_dsi_reg != NULL) 1160 if (dsi->vdds_dsi_reg != NULL)
1152 return 0; 1161 return 0;
1153 1162
1154 vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdds_dsi"); 1163 vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd");
1155
1156 /* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
1157 if (IS_ERR(vdds_dsi))
1158 vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "VCXIO");
1159 1164
1160 if (IS_ERR(vdds_dsi)) { 1165 if (IS_ERR(vdds_dsi)) {
1161 if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER) 1166 if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
1162 DSSERR("can't get VDDS_DSI regulator\n"); 1167 DSSERR("can't get DSI VDD regulator\n");
1163 return PTR_ERR(vdds_dsi); 1168 return PTR_ERR(vdds_dsi);
1164 } 1169 }
1165 1170
@@ -5370,12 +5375,69 @@ static void dsi_uninit_output(struct platform_device *dsidev)
5370 omapdss_unregister_output(out); 5375 omapdss_unregister_output(out);
5371} 5376}
5372 5377
5378static int dsi_probe_of(struct platform_device *pdev)
5379{
5380 struct device_node *node = pdev->dev.of_node;
5381 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
5382 struct property *prop;
5383 u32 lane_arr[10];
5384 int len, num_pins;
5385 int r, i;
5386 struct device_node *ep;
5387 struct omap_dsi_pin_config pin_cfg;
5388
5389 ep = omapdss_of_get_first_endpoint(node);
5390 if (!ep)
5391 return 0;
5392
5393 prop = of_find_property(ep, "lanes", &len);
5394 if (prop == NULL) {
5395 dev_err(&pdev->dev, "failed to find lane data\n");
5396 r = -EINVAL;
5397 goto err;
5398 }
5399
5400 num_pins = len / sizeof(u32);
5401
5402 if (num_pins < 4 || num_pins % 2 != 0 ||
5403 num_pins > dsi->num_lanes_supported * 2) {
5404 dev_err(&pdev->dev, "bad number of lanes\n");
5405 r = -EINVAL;
5406 goto err;
5407 }
5408
5409 r = of_property_read_u32_array(ep, "lanes", lane_arr, num_pins);
5410 if (r) {
5411 dev_err(&pdev->dev, "failed to read lane data\n");
5412 goto err;
5413 }
5414
5415 pin_cfg.num_pins = num_pins;
5416 for (i = 0; i < num_pins; ++i)
5417 pin_cfg.pins[i] = (int)lane_arr[i];
5418
5419 r = dsi_configure_pins(&dsi->output, &pin_cfg);
5420 if (r) {
5421 dev_err(&pdev->dev, "failed to configure pins");
5422 goto err;
5423 }
5424
5425 of_node_put(ep);
5426
5427 return 0;
5428
5429err:
5430 of_node_put(ep);
5431 return r;
5432}
5433
5373/* DSI1 HW IP initialisation */ 5434/* DSI1 HW IP initialisation */
5374static int omap_dsihw_probe(struct platform_device *dsidev) 5435static int omap_dsihw_probe(struct platform_device *dsidev)
5375{ 5436{
5376 u32 rev; 5437 u32 rev;
5377 int r, i; 5438 int r, i;
5378 struct dsi_data *dsi; 5439 struct dsi_data *dsi;
5440 struct resource *dsi_mem;
5379 struct resource *res; 5441 struct resource *res;
5380 struct resource temp_res; 5442 struct resource temp_res;
5381 5443
@@ -5383,7 +5445,6 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5383 if (!dsi) 5445 if (!dsi)
5384 return -ENOMEM; 5446 return -ENOMEM;
5385 5447
5386 dsi->module_id = dsidev->id;
5387 dsi->pdev = dsidev; 5448 dsi->pdev = dsidev;
5388 dev_set_drvdata(&dsidev->dev, dsi); 5449 dev_set_drvdata(&dsidev->dev, dsi);
5389 5450
@@ -5421,6 +5482,8 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5421 res = &temp_res; 5482 res = &temp_res;
5422 } 5483 }
5423 5484
5485 dsi_mem = res;
5486
5424 dsi->proto_base = devm_ioremap(&dsidev->dev, res->start, 5487 dsi->proto_base = devm_ioremap(&dsidev->dev, res->start,
5425 resource_size(res)); 5488 resource_size(res));
5426 if (!dsi->proto_base) { 5489 if (!dsi->proto_base) {
@@ -5481,6 +5544,31 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5481 return r; 5544 return r;
5482 } 5545 }
5483 5546
5547 if (dsidev->dev.of_node) {
5548 const struct of_device_id *match;
5549 const struct dsi_module_id_data *d;
5550
5551 match = of_match_node(dsi_of_match, dsidev->dev.of_node);
5552 if (!match) {
5553 DSSERR("unsupported DSI module\n");
5554 return -ENODEV;
5555 }
5556
5557 d = match->data;
5558
5559 while (d->address != 0 && d->address != dsi_mem->start)
5560 d++;
5561
5562 if (d->address == 0) {
5563 DSSERR("unsupported DSI module\n");
5564 return -ENODEV;
5565 }
5566
5567 dsi->module_id = d->id;
5568 } else {
5569 dsi->module_id = dsidev->id;
5570 }
5571
5484 /* DSI VCs initialization */ 5572 /* DSI VCs initialization */
5485 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) { 5573 for (i = 0; i < ARRAY_SIZE(dsi->vc); i++) {
5486 dsi->vc[i].source = DSI_VC_SOURCE_L4; 5574 dsi->vc[i].source = DSI_VC_SOURCE_L4;
@@ -5516,6 +5604,19 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5516 5604
5517 dsi_init_output(dsidev); 5605 dsi_init_output(dsidev);
5518 5606
5607 if (dsidev->dev.of_node) {
5608 r = dsi_probe_of(dsidev);
5609 if (r) {
5610 DSSERR("Invalid DSI DT data\n");
5611 goto err_probe_of;
5612 }
5613
5614 r = of_platform_populate(dsidev->dev.of_node, NULL, NULL,
5615 &dsidev->dev);
5616 if (r)
5617 DSSERR("Failed to populate DSI child devices: %d\n", r);
5618 }
5619
5519 dsi_runtime_put(dsidev); 5620 dsi_runtime_put(dsidev);
5520 5621
5521 if (dsi->module_id == 0) 5622 if (dsi->module_id == 0)
@@ -5529,17 +5630,31 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
5529 else if (dsi->module_id == 1) 5630 else if (dsi->module_id == 1)
5530 dss_debugfs_create_file("dsi2_irqs", dsi2_dump_irqs); 5631 dss_debugfs_create_file("dsi2_irqs", dsi2_dump_irqs);
5531#endif 5632#endif
5633
5532 return 0; 5634 return 0;
5533 5635
5636err_probe_of:
5637 dsi_uninit_output(dsidev);
5638 dsi_runtime_put(dsidev);
5639
5534err_runtime_get: 5640err_runtime_get:
5535 pm_runtime_disable(&dsidev->dev); 5641 pm_runtime_disable(&dsidev->dev);
5536 return r; 5642 return r;
5537} 5643}
5538 5644
5645static int dsi_unregister_child(struct device *dev, void *data)
5646{
5647 struct platform_device *pdev = to_platform_device(dev);
5648 platform_device_unregister(pdev);
5649 return 0;
5650}
5651
5539static int __exit omap_dsihw_remove(struct platform_device *dsidev) 5652static int __exit omap_dsihw_remove(struct platform_device *dsidev)
5540{ 5653{
5541 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5654 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
5542 5655
5656 device_for_each_child(&dsidev->dev, NULL, dsi_unregister_child);
5657
5543 WARN_ON(dsi->scp_clk_refcount > 0); 5658 WARN_ON(dsi->scp_clk_refcount > 0);
5544 5659
5545 dsi_uninit_output(dsidev); 5660 dsi_uninit_output(dsidev);
@@ -5577,6 +5692,23 @@ static const struct dev_pm_ops dsi_pm_ops = {
5577 .runtime_resume = dsi_runtime_resume, 5692 .runtime_resume = dsi_runtime_resume,
5578}; 5693};
5579 5694
5695static const struct dsi_module_id_data dsi_of_data_omap3[] = {
5696 { .address = 0x4804fc00, .id = 0, },
5697 { },
5698};
5699
5700static const struct dsi_module_id_data dsi_of_data_omap4[] = {
5701 { .address = 0x58004000, .id = 0, },
5702 { .address = 0x58005000, .id = 1, },
5703 { },
5704};
5705
5706static const struct of_device_id dsi_of_match[] = {
5707 { .compatible = "ti,omap3-dsi", .data = dsi_of_data_omap3, },
5708 { .compatible = "ti,omap4-dsi", .data = dsi_of_data_omap4, },
5709 {},
5710};
5711
5580static struct platform_driver omap_dsihw_driver = { 5712static struct platform_driver omap_dsihw_driver = {
5581 .probe = omap_dsihw_probe, 5713 .probe = omap_dsihw_probe,
5582 .remove = __exit_p(omap_dsihw_remove), 5714 .remove = __exit_p(omap_dsihw_remove),
@@ -5584,6 +5716,7 @@ static struct platform_driver omap_dsihw_driver = {
5584 .name = "omapdss_dsi", 5716 .name = "omapdss_dsi",
5585 .owner = THIS_MODULE, 5717 .owner = THIS_MODULE,
5586 .pm = &dsi_pm_ops, 5718 .pm = &dsi_pm_ops,
5719 .of_match_table = dsi_of_match,
5587 }, 5720 },
5588}; 5721};
5589 5722
diff --git a/drivers/video/omap2/dss/dss-of.c b/drivers/video/omap2/dss/dss-of.c
new file mode 100644
index 000000000000..a4b20aaf6142
--- /dev/null
+++ b/drivers/video/omap2/dss/dss-of.c
@@ -0,0 +1,159 @@
1/*
2 * Copyright (C) 2013 Texas Instruments
3 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15#include <linux/device.h>
16#include <linux/err.h>
17#include <linux/module.h>
18#include <linux/of.h>
19#include <linux/seq_file.h>
20
21#include <video/omapdss.h>
22
23struct device_node *
24omapdss_of_get_next_port(const struct device_node *parent,
25 struct device_node *prev)
26{
27 struct device_node *port = NULL;
28
29 if (!parent)
30 return NULL;
31
32 if (!prev) {
33 struct device_node *ports;
34 /*
35 * It's the first call, we have to find a port subnode
36 * within this node or within an optional 'ports' node.
37 */
38 ports = of_get_child_by_name(parent, "ports");
39 if (ports)
40 parent = ports;
41
42 port = of_get_child_by_name(parent, "port");
43
44 /* release the 'ports' node */
45 of_node_put(ports);
46 } else {
47 struct device_node *ports;
48
49 ports = of_get_parent(prev);
50 if (!ports)
51 return NULL;
52
53 do {
54 port = of_get_next_child(ports, prev);
55 if (!port) {
56 of_node_put(ports);
57 return NULL;
58 }
59 prev = port;
60 } while (of_node_cmp(port->name, "port") != 0);
61 }
62
63 return port;
64}
65EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
66
67struct device_node *
68omapdss_of_get_next_endpoint(const struct device_node *parent,
69 struct device_node *prev)
70{
71 struct device_node *ep = NULL;
72
73 if (!parent)
74 return NULL;
75
76 do {
77 ep = of_get_next_child(parent, prev);
78 if (!ep)
79 return NULL;
80 prev = ep;
81 } while (of_node_cmp(ep->name, "endpoint") != 0);
82
83 return ep;
84}
85EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
86
87static struct device_node *
88omapdss_of_get_remote_device_node(const struct device_node *node)
89{
90 struct device_node *np;
91 int i;
92
93 np = of_parse_phandle(node, "remote-endpoint", 0);
94
95 if (!np)
96 return NULL;
97
98 np = of_get_next_parent(np);
99
100 for (i = 0; i < 3 && np; ++i) {
101 struct property *prop;
102
103 prop = of_find_property(np, "compatible", NULL);
104
105 if (prop)
106 return np;
107
108 np = of_get_next_parent(np);
109 }
110
111 return NULL;
112}
113
114struct device_node *
115omapdss_of_get_first_endpoint(const struct device_node *parent)
116{
117 struct device_node *port, *ep;
118
119 port = omapdss_of_get_next_port(parent, NULL);
120
121 if (!port)
122 return NULL;
123
124 ep = omapdss_of_get_next_endpoint(port, NULL);
125
126 of_node_put(port);
127
128 return ep;
129}
130EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
131
132struct omap_dss_device *
133omapdss_of_find_source_for_first_ep(struct device_node *node)
134{
135 struct device_node *ep;
136 struct device_node *src_node;
137 struct omap_dss_device *src;
138
139 ep = omapdss_of_get_first_endpoint(node);
140 if (!ep)
141 return ERR_PTR(-EINVAL);
142
143 src_node = omapdss_of_get_remote_device_node(ep);
144
145 of_node_put(ep);
146
147 if (!src_node)
148 return ERR_PTR(-EINVAL);
149
150 src = omap_dss_find_output_by_node(src_node);
151
152 of_node_put(src_node);
153
154 if (!src)
155 return ERR_PTR(-EPROBE_DEFER);
156
157 return src;
158}
159EXPORT_SYMBOL_GPL(omapdss_of_find_source_for_first_ep);
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 96e400c51001..825c019ddee7 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -23,6 +23,7 @@
23#define DSS_SUBSYS_NAME "DSS" 23#define DSS_SUBSYS_NAME "DSS"
24 24
25#include <linux/kernel.h> 25#include <linux/kernel.h>
26#include <linux/module.h>
26#include <linux/io.h> 27#include <linux/io.h>
27#include <linux/export.h> 28#include <linux/export.h>
28#include <linux/err.h> 29#include <linux/err.h>
@@ -33,6 +34,7 @@
33#include <linux/pm_runtime.h> 34#include <linux/pm_runtime.h>
34#include <linux/gfp.h> 35#include <linux/gfp.h>
35#include <linux/sizes.h> 36#include <linux/sizes.h>
37#include <linux/of.h>
36 38
37#include <video/omapdss.h> 39#include <video/omapdss.h>
38 40
@@ -772,6 +774,56 @@ static int __init dss_init_features(struct platform_device *pdev)
772 return 0; 774 return 0;
773} 775}
774 776
777static int __init dss_init_ports(struct platform_device *pdev)
778{
779 struct device_node *parent = pdev->dev.of_node;
780 struct device_node *port;
781 int r;
782
783 if (parent == NULL)
784 return 0;
785
786 port = omapdss_of_get_next_port(parent, NULL);
787 if (!port) {
788#ifdef CONFIG_OMAP2_DSS_DPI
789 dpi_init_port(pdev, parent);
790#endif
791 return 0;
792 }
793
794 do {
795 u32 reg;
796
797 r = of_property_read_u32(port, "reg", &reg);
798 if (r)
799 reg = 0;
800
801#ifdef CONFIG_OMAP2_DSS_DPI
802 if (reg == 0)
803 dpi_init_port(pdev, port);
804#endif
805
806#ifdef CONFIG_OMAP2_DSS_SDI
807 if (reg == 1)
808 sdi_init_port(pdev, port);
809#endif
810
811 } while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
812
813 return 0;
814}
815
816static void dss_uninit_ports(void)
817{
818#ifdef CONFIG_OMAP2_DSS_DPI
819 dpi_uninit_port();
820#endif
821
822#ifdef CONFIG_OMAP2_DSS_SDI
823 sdi_uninit_port();
824#endif
825}
826
775/* DSS HW IP initialisation */ 827/* DSS HW IP initialisation */
776static int __init omap_dsshw_probe(struct platform_device *pdev) 828static int __init omap_dsshw_probe(struct platform_device *pdev)
777{ 829{
@@ -830,6 +882,8 @@ static int __init omap_dsshw_probe(struct platform_device *pdev)
830 dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK; 882 dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK;
831 dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK; 883 dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK;
832 884
885 dss_init_ports(pdev);
886
833 rev = dss_read_reg(DSS_REVISION); 887 rev = dss_read_reg(DSS_REVISION);
834 printk(KERN_INFO "OMAP DSS rev %d.%d\n", 888 printk(KERN_INFO "OMAP DSS rev %d.%d\n",
835 FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0)); 889 FLD_GET(rev, 7, 4), FLD_GET(rev, 3, 0));
@@ -849,6 +903,8 @@ err_setup_clocks:
849 903
850static int __exit omap_dsshw_remove(struct platform_device *pdev) 904static int __exit omap_dsshw_remove(struct platform_device *pdev)
851{ 905{
906 dss_uninit_ports();
907
852 pm_runtime_disable(&pdev->dev); 908 pm_runtime_disable(&pdev->dev);
853 909
854 dss_put_clocks(); 910 dss_put_clocks();
@@ -886,12 +942,22 @@ static const struct dev_pm_ops dss_pm_ops = {
886 .runtime_resume = dss_runtime_resume, 942 .runtime_resume = dss_runtime_resume,
887}; 943};
888 944
945static const struct of_device_id dss_of_match[] = {
946 { .compatible = "ti,omap2-dss", },
947 { .compatible = "ti,omap3-dss", },
948 { .compatible = "ti,omap4-dss", },
949 {},
950};
951
952MODULE_DEVICE_TABLE(of, dss_of_match);
953
889static struct platform_driver omap_dsshw_driver = { 954static struct platform_driver omap_dsshw_driver = {
890 .remove = __exit_p(omap_dsshw_remove), 955 .remove = __exit_p(omap_dsshw_remove),
891 .driver = { 956 .driver = {
892 .name = "omapdss_dss", 957 .name = "omapdss_dss",
893 .owner = THIS_MODULE, 958 .owner = THIS_MODULE,
894 .pm = &dss_pm_ops, 959 .pm = &dss_pm_ops,
960 .of_match_table = dss_of_match,
895 }, 961 },
896}; 962};
897 963
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 570f7ed2bcbc..918fec182424 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -250,6 +250,9 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
250int sdi_init_platform_driver(void) __init; 250int sdi_init_platform_driver(void) __init;
251void sdi_uninit_platform_driver(void) __exit; 251void sdi_uninit_platform_driver(void) __exit;
252 252
253int sdi_init_port(struct platform_device *pdev, struct device_node *port) __init;
254void sdi_uninit_port(void) __exit;
255
253/* DSI */ 256/* DSI */
254 257
255typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint, 258typedef bool (*dsi_pll_calc_func)(int regn, int regm, unsigned long fint,
@@ -361,6 +364,9 @@ static inline bool dsi_pll_calc(struct platform_device *dsidev,
361int dpi_init_platform_driver(void) __init; 364int dpi_init_platform_driver(void) __init;
362void dpi_uninit_platform_driver(void) __exit; 365void dpi_uninit_platform_driver(void) __exit;
363 366
367int dpi_init_port(struct platform_device *pdev, struct device_node *port) __init;
368void dpi_uninit_port(void) __exit;
369
364/* DISPC */ 370/* DISPC */
365int dispc_init_platform_driver(void) __init; 371int dispc_init_platform_driver(void) __init;
366void dispc_uninit_platform_driver(void) __exit; 372void dispc_uninit_platform_driver(void) __exit;
diff --git a/drivers/video/omap2/dss/hdmi4.c b/drivers/video/omap2/dss/hdmi4.c
index 895c252ae0a8..f5f7944a1fd1 100644
--- a/drivers/video/omap2/dss/hdmi4.c
+++ b/drivers/video/omap2/dss/hdmi4.c
@@ -88,15 +88,11 @@ static int hdmi_init_regulator(void)
88 if (hdmi.vdda_hdmi_dac_reg != NULL) 88 if (hdmi.vdda_hdmi_dac_reg != NULL)
89 return 0; 89 return 0;
90 90
91 reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac"); 91 reg = devm_regulator_get(&hdmi.pdev->dev, "vdda");
92
93 /* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */
94 if (IS_ERR(reg))
95 reg = devm_regulator_get(&hdmi.pdev->dev, "VDAC");
96 92
97 if (IS_ERR(reg)) { 93 if (IS_ERR(reg)) {
98 if (PTR_ERR(reg) != -EPROBE_DEFER) 94 if (PTR_ERR(reg) != -EPROBE_DEFER)
99 DSSERR("can't get VDDA_HDMI_DAC regulator\n"); 95 DSSERR("can't get VDDA regulator\n");
100 return PTR_ERR(reg); 96 return PTR_ERR(reg);
101 } 97 }
102 98
@@ -680,6 +676,11 @@ static const struct dev_pm_ops hdmi_pm_ops = {
680 .runtime_resume = hdmi_runtime_resume, 676 .runtime_resume = hdmi_runtime_resume,
681}; 677};
682 678
679static const struct of_device_id hdmi_of_match[] = {
680 { .compatible = "ti,omap4-hdmi", },
681 {},
682};
683
683static struct platform_driver omapdss_hdmihw_driver = { 684static struct platform_driver omapdss_hdmihw_driver = {
684 .probe = omapdss_hdmihw_probe, 685 .probe = omapdss_hdmihw_probe,
685 .remove = __exit_p(omapdss_hdmihw_remove), 686 .remove = __exit_p(omapdss_hdmihw_remove),
@@ -687,6 +688,7 @@ static struct platform_driver omapdss_hdmihw_driver = {
687 .name = "omapdss_hdmi", 688 .name = "omapdss_hdmi",
688 .owner = THIS_MODULE, 689 .owner = THIS_MODULE,
689 .pm = &hdmi_pm_ops, 690 .pm = &hdmi_pm_ops,
691 .of_match_table = hdmi_of_match,
690 }, 692 },
691}; 693};
692 694
diff --git a/drivers/video/omap2/dss/hdmi_wp.c b/drivers/video/omap2/dss/hdmi_wp.c
index cd620c6e43a0..f5f4ccf50d90 100644
--- a/drivers/video/omap2/dss/hdmi_wp.c
+++ b/drivers/video/omap2/dss/hdmi_wp.c
@@ -171,6 +171,8 @@ void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
171 video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444; 171 video_fmt->packing_mode = HDMI_PACK_10b_RGB_YUV444;
172 video_fmt->y_res = param->timings.y_res; 172 video_fmt->y_res = param->timings.y_res;
173 video_fmt->x_res = param->timings.x_res; 173 video_fmt->x_res = param->timings.x_res;
174 if (param->timings.interlace)
175 video_fmt->y_res /= 2;
174 176
175 timings->hbp = param->timings.hbp; 177 timings->hbp = param->timings.hbp;
176 timings->hfp = param->timings.hfp; 178 timings->hfp = param->timings.hfp;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index b679e33adf2d..911dcc9173a6 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -26,6 +26,7 @@
26#include <linux/export.h> 26#include <linux/export.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/string.h> 28#include <linux/string.h>
29#include <linux/of.h>
29 30
30#include <video/omapdss.h> 31#include <video/omapdss.h>
31#include "dss.h" 32#include "dss.h"
@@ -41,6 +42,8 @@ static struct {
41 int datapairs; 42 int datapairs;
42 43
43 struct omap_dss_device output; 44 struct omap_dss_device output;
45
46 bool port_initialized;
44} sdi; 47} sdi;
45 48
46struct sdi_clk_calc_ctx { 49struct sdi_clk_calc_ctx {
@@ -386,3 +389,45 @@ void __exit sdi_uninit_platform_driver(void)
386{ 389{
387 platform_driver_unregister(&omap_sdi_driver); 390 platform_driver_unregister(&omap_sdi_driver);
388} 391}
392
393int __init sdi_init_port(struct platform_device *pdev, struct device_node *port)
394{
395 struct device_node *ep;
396 u32 datapairs;
397 int r;
398
399 ep = omapdss_of_get_next_endpoint(port, NULL);
400 if (!ep)
401 return 0;
402
403 r = of_property_read_u32(ep, "datapairs", &datapairs);
404 if (r) {
405 DSSERR("failed to parse datapairs\n");
406 goto err_datapairs;
407 }
408
409 sdi.datapairs = datapairs;
410
411 of_node_put(ep);
412
413 sdi.pdev = pdev;
414
415 sdi_init_output(pdev);
416
417 sdi.port_initialized = true;
418
419 return 0;
420
421err_datapairs:
422 of_node_put(ep);
423
424 return r;
425}
426
427void __exit sdi_uninit_port(void)
428{
429 if (!sdi.port_initialized)
430 return;
431
432 sdi_uninit_output(sdi.pdev);
433}
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 59ade34bd536..21d81113962b 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -34,6 +34,7 @@
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/regulator/consumer.h> 35#include <linux/regulator/consumer.h>
36#include <linux/pm_runtime.h> 36#include <linux/pm_runtime.h>
37#include <linux/of.h>
37 38
38#include <video/omapdss.h> 39#include <video/omapdss.h>
39 40
@@ -636,7 +637,10 @@ static int venc_init_regulator(void)
636 if (venc.vdda_dac_reg != NULL) 637 if (venc.vdda_dac_reg != NULL)
637 return 0; 638 return 0;
638 639
639 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac"); 640 if (venc.pdev->dev.of_node)
641 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda");
642 else
643 vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac");
640 644
641 if (IS_ERR(vdda_dac)) { 645 if (IS_ERR(vdda_dac)) {
642 if (PTR_ERR(vdda_dac) != -EPROBE_DEFER) 646 if (PTR_ERR(vdda_dac) != -EPROBE_DEFER)
@@ -805,6 +809,48 @@ static void __exit venc_uninit_output(struct platform_device *pdev)
805 omapdss_unregister_output(out); 809 omapdss_unregister_output(out);
806} 810}
807 811
812static int venc_probe_of(struct platform_device *pdev)
813{
814 struct device_node *node = pdev->dev.of_node;
815 struct device_node *ep;
816 u32 channels;
817 int r;
818
819 ep = omapdss_of_get_first_endpoint(node);
820 if (!ep)
821 return 0;
822
823 venc.invert_polarity = of_property_read_bool(ep, "ti,invert-polarity");
824
825 r = of_property_read_u32(ep, "ti,channels", &channels);
826 if (r) {
827 dev_err(&pdev->dev,
828 "failed to read property 'ti,channels': %d\n", r);
829 goto err;
830 }
831
832 switch (channels) {
833 case 1:
834 venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE;
835 break;
836 case 2:
837 venc.type = OMAP_DSS_VENC_TYPE_SVIDEO;
838 break;
839 default:
840 dev_err(&pdev->dev, "bad channel propert '%d'\n", channels);
841 r = -EINVAL;
842 goto err;
843 }
844
845 of_node_put(ep);
846
847 return 0;
848err:
849 of_node_put(ep);
850
851 return 0;
852}
853
808/* VENC HW IP initialisation */ 854/* VENC HW IP initialisation */
809static int omap_venchw_probe(struct platform_device *pdev) 855static int omap_venchw_probe(struct platform_device *pdev)
810{ 856{
@@ -846,12 +892,21 @@ static int omap_venchw_probe(struct platform_device *pdev)
846 892
847 venc_runtime_put(); 893 venc_runtime_put();
848 894
895 if (pdev->dev.of_node) {
896 r = venc_probe_of(pdev);
897 if (r) {
898 DSSERR("Invalid DT data\n");
899 goto err_probe_of;
900 }
901 }
902
849 dss_debugfs_create_file("venc", venc_dump_regs); 903 dss_debugfs_create_file("venc", venc_dump_regs);
850 904
851 venc_init_output(pdev); 905 venc_init_output(pdev);
852 906
853 return 0; 907 return 0;
854 908
909err_probe_of:
855err_runtime_get: 910err_runtime_get:
856 pm_runtime_disable(&pdev->dev); 911 pm_runtime_disable(&pdev->dev);
857 return r; 912 return r;
@@ -895,6 +950,14 @@ static const struct dev_pm_ops venc_pm_ops = {
895 .runtime_resume = venc_runtime_resume, 950 .runtime_resume = venc_runtime_resume,
896}; 951};
897 952
953
954static const struct of_device_id venc_of_match[] = {
955 { .compatible = "ti,omap2-venc", },
956 { .compatible = "ti,omap3-venc", },
957 { .compatible = "ti,omap4-venc", },
958 {},
959};
960
898static struct platform_driver omap_venchw_driver = { 961static struct platform_driver omap_venchw_driver = {
899 .probe = omap_venchw_probe, 962 .probe = omap_venchw_probe,
900 .remove = __exit_p(omap_venchw_remove), 963 .remove = __exit_p(omap_venchw_remove),
@@ -902,6 +965,7 @@ static struct platform_driver omap_venchw_driver = {
902 .name = "omapdss_venc", 965 .name = "omapdss_venc",
903 .owner = THIS_MODULE, 966 .owner = THIS_MODULE,
904 .pm = &venc_pm_ops, 967 .pm = &venc_pm_ops,
968 .of_match_table = venc_of_match,
905 }, 969 },
906}; 970};
907 971
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 8d02f164c8c6..ec2d132c782d 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2417,6 +2417,55 @@ static int omapfb_init_connections(struct omapfb2_device *fbdev,
2417 return 0; 2417 return 0;
2418} 2418}
2419 2419
2420static struct omap_dss_device *
2421omapfb_find_default_display(struct omapfb2_device *fbdev)
2422{
2423 const char *def_name;
2424 int i;
2425
2426 /*
2427 * Search with the display name from the user or the board file,
2428 * comparing to display names and aliases
2429 */
2430
2431 def_name = omapdss_get_default_display_name();
2432
2433 if (def_name) {
2434 for (i = 0; i < fbdev->num_displays; ++i) {
2435 struct omap_dss_device *dssdev;
2436
2437 dssdev = fbdev->displays[i].dssdev;
2438
2439 if (dssdev->name && strcmp(def_name, dssdev->name) == 0)
2440 return dssdev;
2441
2442 if (strcmp(def_name, dssdev->alias) == 0)
2443 return dssdev;
2444 }
2445
2446 /* def_name given but not found */
2447 return NULL;
2448 }
2449
2450 /* then look for DT alias display0 */
2451 for (i = 0; i < fbdev->num_displays; ++i) {
2452 struct omap_dss_device *dssdev;
2453 int id;
2454
2455 dssdev = fbdev->displays[i].dssdev;
2456
2457 if (dssdev->dev->of_node == NULL)
2458 continue;
2459
2460 id = of_alias_get_id(dssdev->dev->of_node, "display");
2461 if (id == 0)
2462 return dssdev;
2463 }
2464
2465 /* return the first display we have in the list */
2466 return fbdev->displays[0].dssdev;
2467}
2468
2420static int omapfb_probe(struct platform_device *pdev) 2469static int omapfb_probe(struct platform_device *pdev)
2421{ 2470{
2422 struct omapfb2_device *fbdev = NULL; 2471 struct omapfb2_device *fbdev = NULL;
@@ -2494,23 +2543,7 @@ static int omapfb_probe(struct platform_device *pdev)
2494 for (i = 0; i < fbdev->num_managers; i++) 2543 for (i = 0; i < fbdev->num_managers; i++)
2495 fbdev->managers[i] = omap_dss_get_overlay_manager(i); 2544 fbdev->managers[i] = omap_dss_get_overlay_manager(i);
2496 2545
2497 def_display = NULL; 2546 def_display = omapfb_find_default_display(fbdev);
2498
2499 for (i = 0; i < fbdev->num_displays; ++i) {
2500 struct omap_dss_device *dssdev;
2501 const char *def_name;
2502
2503 def_name = omapdss_get_default_display_name();
2504
2505 dssdev = fbdev->displays[i].dssdev;
2506
2507 if (def_name == NULL ||
2508 (dssdev->name && strcmp(def_name, dssdev->name) == 0)) {
2509 def_display = dssdev;
2510 break;
2511 }
2512 }
2513
2514 if (def_display == NULL) { 2547 if (def_display == NULL) {
2515 dev_err(fbdev->dev, "failed to find default display\n"); 2548 dev_err(fbdev->dev, "failed to find default display\n");
2516 r = -EPROBE_DEFER; 2549 r = -EPROBE_DEFER;
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 24f3a57022b8..6adb44534606 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -1018,4 +1018,18 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
1018 return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; 1018 return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
1019} 1019}
1020 1020
1021struct device_node *
1022omapdss_of_get_next_port(const struct device_node *parent,
1023 struct device_node *prev);
1024
1025struct device_node *
1026omapdss_of_get_next_endpoint(const struct device_node *parent,
1027 struct device_node *prev);
1028
1029struct device_node *
1030omapdss_of_get_first_endpoint(const struct device_node *parent);
1031
1032struct omap_dss_device *
1033omapdss_of_find_source_for_first_ep(struct device_node *node);
1034
1021#endif 1035#endif