aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-09-17 05:55:19 -0400
committerDave Airlie <airlied@redhat.com>2014-09-18 07:53:47 -0400
commit8337486a8fda53e5f46b3cb2b4eb3272608348cb (patch)
treed5dea7742b6335be4a78de8a788d00c23706fb82
parent109ab90974995a06aeabab1535b0ce00f26dd24a (diff)
parent96c026911890ceacee238da00a0b140ad634cc43 (diff)
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
Commit "drm/rcar-du: Use struct videomode in platform data" touches board code in arch/arm/mach-shmobile. There is, to the best of my knowledge, no risk of conflict for v3.18. Simon, are you fine with getting those changes merged through Dave's tree (and could you confirm that no conflict should occur) ? Simon acked the merge: Acked-by: Simon Horman <horms+renesas@verge.net.au> * 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev: drm/rcar-du: Add OF support drm/rcar-du: Use struct videomode in platform data video: Add DT bindings for the R-Car Display Unit video: Add THC63LVDM83D DT bindings documentation video: Add ADV7123 DT bindings documentation video: Add DT binding documentation for VGA connector devicetree: Add vendor prefix "thine" to vendor-prefixes.txt devicetree: Add vendor prefix "mitsubishi" to vendor-prefixes.txt drm/shmob: Update copyright notice drm/rcar-du: Update copyright notice
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt2
-rw-r--r--Documentation/devicetree/bindings/video/adi,adv7123.txt50
-rw-r--r--Documentation/devicetree/bindings/video/renesas,du.txt84
-rw-r--r--Documentation/devicetree/bindings/video/thine,thc63lvdm83d50
-rw-r--r--Documentation/devicetree/bindings/video/vga-connector.txt36
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c19
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c19
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c19
-rw-r--r--arch/arm/mach-shmobile/board-lager.c19
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c19
-rw-r--r--drivers/gpu/drm/rcar-du/Kconfig1
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_crtc.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_crtc.h2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_drv.c172
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_drv.h4
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_encoder.c13
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_encoder.h5
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_group.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_group.h2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_kms.c233
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_kms.h2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c45
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h5
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_plane.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_plane.h2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_vgacon.c2
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_vgacon.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_backlight.c2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_backlight.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_crtc.c2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_crtc.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_drv.c2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_drv.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_kms.c2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_kms.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_plane.c2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_plane.h2
-rw-r--r--drivers/gpu/drm/shmobile/shmob_drm_regs.h2
-rw-r--r--include/linux/platform_data/rcar-du.h4
41 files changed, 645 insertions, 198 deletions
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index ac7269f90764..2b5648b1ce1d 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -83,6 +83,7 @@ maxim Maxim Integrated Products
83mediatek MediaTek Inc. 83mediatek MediaTek Inc.
84micrel Micrel Inc. 84micrel Micrel Inc.
85microchip Microchip Technology Inc. 85microchip Microchip Technology Inc.
86mitsubishi Mitsubishi Electric Corporation
86mosaixtech Mosaix Technologies, Inc. 87mosaixtech Mosaix Technologies, Inc.
87moxa Moxa 88moxa Moxa
88mpl MPL AG 89mpl MPL AG
@@ -133,6 +134,7 @@ st STMicroelectronics
133ste ST-Ericsson 134ste ST-Ericsson
134stericsson ST-Ericsson 135stericsson ST-Ericsson
135synology Synology, Inc. 136synology Synology, Inc.
137thine THine Electronics, Inc.
136ti Texas Instruments 138ti Texas Instruments
137tlm Trusted Logic Mobility 139tlm Trusted Logic Mobility
138toradex Toradex AG 140toradex Toradex AG
diff --git a/Documentation/devicetree/bindings/video/adi,adv7123.txt b/Documentation/devicetree/bindings/video/adi,adv7123.txt
new file mode 100644
index 000000000000..a6b2b2b8f3d9
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/adi,adv7123.txt
@@ -0,0 +1,50 @@
1Analog Device ADV7123 Video DAC
2-------------------------------
3
4The ADV7123 is a digital-to-analog converter that outputs VGA signals from a
5parallel video input.
6
7Required properties:
8
9- compatible: Should be "adi,adv7123"
10
11Optional properties:
12
13- psave-gpios: Power save control GPIO
14
15Required nodes:
16
17The ADV7123 has two video ports. Their connections are modeled using the OF
18graph bindings specified in Documentation/devicetree/bindings/graph.txt.
19
20- Video port 0 for DPI input
21- Video port 1 for VGA output
22
23
24Example
25-------
26
27 adv7123: encoder@0 {
28 compatible = "adi,adv7123";
29
30 ports {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 port@0 {
35 reg = <0>;
36
37 adv7123_in: endpoint@0 {
38 remote-endpoint = <&dpi_out>;
39 };
40 };
41
42 port@1 {
43 reg = <1>;
44
45 adv7123_out: endpoint@0 {
46 remote-endpoint = <&vga_connector_in>;
47 };
48 };
49 };
50 };
diff --git a/Documentation/devicetree/bindings/video/renesas,du.txt b/Documentation/devicetree/bindings/video/renesas,du.txt
new file mode 100644
index 000000000000..5102830f2760
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/renesas,du.txt
@@ -0,0 +1,84 @@
1* Renesas R-Car Display Unit (DU)
2
3Required Properties:
4
5 - compatible: must be one of the following.
6 - "renesas,du-r8a7779" for R8A7779 (R-Car H1) compatible DU
7 - "renesas,du-r8a7790" for R8A7790 (R-Car H2) compatible DU
8 - "renesas,du-r8a7791" for R8A7791 (R-Car M2) compatible DU
9
10 - reg: A list of base address and length of each memory resource, one for
11 each entry in the reg-names property.
12 - reg-names: Name of the memory resources. The DU requires one memory
13 resource for the DU core (named "du") and one memory resource for each
14 LVDS encoder (named "lvds.x" with "x" being the LVDS controller numerical
15 index).
16
17 - interrupt-parent: phandle of the parent interrupt controller.
18 - interrupts: Interrupt specifiers for the DU interrupts.
19
20 - clocks: A list of phandles + clock-specifier pairs, one for each entry in
21 the clock-names property.
22 - clock-names: Name of the clocks. This property is model-dependent.
23 - R8A7779 uses a single functional clock. The clock doesn't need to be
24 named.
25 - R8A7790 and R8A7791 use one functional clock per channel and one clock
26 per LVDS encoder. The functional clocks must be named "du.x" with "x"
27 being the channel numerical index. The LVDS clocks must be named
28 "lvds.x" with "x" being the LVDS encoder numerical index.
29
30Required nodes:
31
32The connections to the DU output video ports are modeled using the OF graph
33bindings specified in Documentation/devicetree/bindings/graph.txt.
34
35The following table lists for each supported model the port number
36corresponding to each DU output.
37
38 Port 0 Port1 Port2
39-----------------------------------------------------------------------------
40 R8A7779 (H1) DPAD 0 DPAD 1 -
41 R8A7790 (H2) DPAD LVDS 0 LVDS 1
42 R8A7791 (M2) DPAD LVDS 0 -
43
44
45Example: R8A7790 (R-Car H2) DU
46
47 du: du@feb00000 {
48 compatible = "renesas,du-r8a7790";
49 reg = <0 0xfeb00000 0 0x70000>,
50 <0 0xfeb90000 0 0x1c>,
51 <0 0xfeb94000 0 0x1c>;
52 reg-names = "du", "lvds.0", "lvds.1";
53 interrupt-parent = <&gic>;
54 interrupts = <0 256 IRQ_TYPE_LEVEL_HIGH>,
55 <0 268 IRQ_TYPE_LEVEL_HIGH>,
56 <0 269 IRQ_TYPE_LEVEL_HIGH>;
57 clocks = <&mstp7_clks R8A7790_CLK_DU0>,
58 <&mstp7_clks R8A7790_CLK_DU1>,
59 <&mstp7_clks R8A7790_CLK_DU2>,
60 <&mstp7_clks R8A7790_CLK_LVDS0>,
61 <&mstp7_clks R8A7790_CLK_LVDS1>;
62 clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1";
63
64 ports {
65 #address-cells = <1>;
66 #size-cells = <0>;
67
68 port@0 {
69 reg = <0>;
70 du_out_rgb: endpoint {
71 };
72 };
73 port@1 {
74 reg = <1>;
75 du_out_lvds0: endpoint {
76 };
77 };
78 port@2 {
79 reg = <2>;
80 du_out_lvds1: endpoint {
81 };
82 };
83 };
84 };
diff --git a/Documentation/devicetree/bindings/video/thine,thc63lvdm83d b/Documentation/devicetree/bindings/video/thine,thc63lvdm83d
new file mode 100644
index 000000000000..527e236e9a2a
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/thine,thc63lvdm83d
@@ -0,0 +1,50 @@
1THine Electronics THC63LVDM83D LVDS serializer
2----------------------------------------------
3
4The THC63LVDM83D is an LVDS serializer designed to support pixel data
5transmission between a host and a flat panel.
6
7Required properties:
8
9- compatible: Should be "thine,thc63lvdm83d"
10
11Optional properties:
12
13- pwdn-gpios: Power down control GPIO
14
15Required nodes:
16
17The THC63LVDM83D has two video ports. Their connections are modeled using the
18OFgraph bindings specified in Documentation/devicetree/bindings/graph.txt.
19
20- Video port 0 for CMOS/TTL input
21- Video port 1 for LVDS output
22
23
24Example
25-------
26
27 lvds_enc: encoder@0 {
28 compatible = "thine,thc63lvdm83d";
29
30 ports {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 port@0 {
35 reg = <0>;
36
37 lvds_enc_in: endpoint@0 {
38 remote-endpoint = <&rgb_out>;
39 };
40 };
41
42 port@1 {
43 reg = <1>;
44
45 lvds_enc_out: endpoint@0 {
46 remote-endpoint = <&panel_in>;
47 };
48 };
49 };
50 };
diff --git a/Documentation/devicetree/bindings/video/vga-connector.txt b/Documentation/devicetree/bindings/video/vga-connector.txt
new file mode 100644
index 000000000000..c727f298e7ad
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/vga-connector.txt
@@ -0,0 +1,36 @@
1VGA Connector
2=============
3
4Required properties:
5
6- compatible: "vga-connector"
7
8Optional properties:
9
10- label: a symbolic name for the connector corresponding to a hardware label
11- ddc-i2c-bus: phandle to the I2C bus that is connected to VGA DDC
12
13Required nodes:
14
15The VGA connector internal connections are modeled using the OF graph bindings
16specified in Documentation/devicetree/bindings/graph.txt.
17
18The VGA connector has a single port that must be connected to a video source
19port.
20
21
22Example
23-------
24
25vga0: connector@0 {
26 compatible = "vga-connector";
27 label = "vga";
28
29 ddc-i2c-bus = <&i2c3>;
30
31 port {
32 vga_connector_in: endpoint {
33 remote-endpoint = <&adv7123_out>;
34 };
35 };
36};
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 3ff88c138896..364e69bf85d4 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -41,16 +41,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = {
41 .width_mm = 210, 41 .width_mm = 210,
42 .height_mm = 158, 42 .height_mm = 158,
43 .mode = { 43 .mode = {
44 .clock = 65000, 44 .pixelclock = 65000000,
45 .hdisplay = 1024, 45 .hactive = 1024,
46 .hsync_start = 1048, 46 .hfront_porch = 20,
47 .hsync_end = 1184, 47 .hback_porch = 160,
48 .htotal = 1344, 48 .hsync_len = 136,
49 .vdisplay = 768, 49 .vactive = 768,
50 .vsync_start = 771, 50 .vfront_porch = 3,
51 .vsync_end = 777, 51 .vback_porch = 29,
52 .vtotal = 806, 52 .vsync_len = 6,
53 .flags = 0,
54 }, 53 },
55 }, 54 },
56 }, 55 },
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index b7d5bc7659cd..ad10ddb6a321 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -63,16 +63,15 @@ static struct rcar_du_encoder_data koelsch_du_encoders[] = {
63 .width_mm = 210, 63 .width_mm = 210,
64 .height_mm = 158, 64 .height_mm = 158,
65 .mode = { 65 .mode = {
66 .clock = 65000, 66 .pixelclock = 65000000,
67 .hdisplay = 1024, 67 .hactive = 1024,
68 .hsync_start = 1048, 68 .hfront_porch = 20,
69 .hsync_end = 1184, 69 .hback_porch = 160,
70 .htotal = 1344, 70 .hsync_len = 136,
71 .vdisplay = 768, 71 .vactive = 768,
72 .vsync_start = 771, 72 .vfront_porch = 3,
73 .vsync_end = 777, 73 .vback_porch = 29,
74 .vtotal = 806, 74 .vsync_len = 6,
75 .flags = 0,
76 }, 75 },
77 }, 76 },
78 }, 77 },
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 41c808e56005..12a53a1c3d02 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -43,16 +43,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = {
43 .width_mm = 210, 43 .width_mm = 210,
44 .height_mm = 158, 44 .height_mm = 158,
45 .mode = { 45 .mode = {
46 .clock = 65000, 46 .pixelclock = 65000000,
47 .hdisplay = 1024, 47 .hactive = 1024,
48 .hsync_start = 1048, 48 .hfront_porch = 20,
49 .hsync_end = 1184, 49 .hback_porch = 160,
50 .htotal = 1344, 50 .hsync_len = 136,
51 .vdisplay = 768, 51 .vactive = 768,
52 .vsync_start = 771, 52 .vfront_porch = 3,
53 .vsync_end = 777, 53 .vback_porch = 29,
54 .vtotal = 806, 54 .vsync_len = 6,
55 .flags = 0,
56 }, 55 },
57 }, 56 },
58 }, 57 },
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index e1d8215da0b0..80576c2ee668 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -99,16 +99,15 @@ static struct rcar_du_encoder_data lager_du_encoders[] = {
99 .width_mm = 210, 99 .width_mm = 210,
100 .height_mm = 158, 100 .height_mm = 158,
101 .mode = { 101 .mode = {
102 .clock = 65000, 102 .pixelclock = 65000000,
103 .hdisplay = 1024, 103 .hactive = 1024,
104 .hsync_start = 1048, 104 .hfront_porch = 20,
105 .hsync_end = 1184, 105 .hback_porch = 160,
106 .htotal = 1344, 106 .hsync_len = 136,
107 .vdisplay = 768, 107 .vactive = 768,
108 .vsync_start = 771, 108 .vfront_porch = 3,
109 .vsync_end = 777, 109 .vback_porch = 29,
110 .vtotal = 806, 110 .vsync_len = 6,
111 .flags = 0,
112 }, 111 },
113 }, 112 },
114 }, 113 },
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index e5cf4201e769..ce33d7825c49 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -192,16 +192,15 @@ static struct rcar_du_encoder_data du_encoders[] = {
192 .width_mm = 210, 192 .width_mm = 210,
193 .height_mm = 158, 193 .height_mm = 158,
194 .mode = { 194 .mode = {
195 .clock = 65000, 195 .pixelclock = 65000000,
196 .hdisplay = 1024, 196 .hactive = 1024,
197 .hsync_start = 1048, 197 .hfront_porch = 20,
198 .hsync_end = 1184, 198 .hback_porch = 160,
199 .htotal = 1344, 199 .hsync_len = 136,
200 .vdisplay = 768, 200 .vactive = 768,
201 .vsync_start = 771, 201 .vfront_porch = 3,
202 .vsync_end = 777, 202 .vback_porch = 29,
203 .vtotal = 806, 203 .vsync_len = 6,
204 .flags = 0,
205 }, 204 },
206 }, 205 },
207 }, 206 },
diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
index 2e3d7b5b0ad7..c96f6089f8bf 100644
--- a/drivers/gpu/drm/rcar-du/Kconfig
+++ b/drivers/gpu/drm/rcar-du/Kconfig
@@ -6,6 +6,7 @@ config DRM_RCAR_DU
6 select DRM_KMS_CMA_HELPER 6 select DRM_KMS_CMA_HELPER
7 select DRM_GEM_CMA_HELPER 7 select DRM_GEM_CMA_HELPER
8 select DRM_KMS_FB_HELPER 8 select DRM_KMS_FB_HELPER
9 select VIDEOMODE_HELPERS
9 help 10 help
10 Choose this option if you have an R-Car chipset. 11 Choose this option if you have an R-Car chipset.
11 If M is selected the module will be called rcar-du-drm. 12 If M is selected the module will be called rcar-du-drm.
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 299267db2898..148b50589181 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_crtc.c -- R-Car Display Unit CRTCs 2 * rcar_du_crtc.c -- R-Car Display Unit CRTCs
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
index 43e7575c700c..e97ae502dec5 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_crtc.h -- R-Car Display Unit CRTCs 2 * rcar_du_crtc.h -- R-Car Display Unit CRTCs
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 672d2fcba009..d212efa6a495 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_drv.c -- R-Car Display Unit DRM driver 2 * rcar_du_drv.c -- R-Car Display Unit DRM driver
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -15,6 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/of_device.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/pm.h> 20#include <linux/pm.h>
20#include <linux/slab.h> 21#include <linux/slab.h>
@@ -30,6 +31,97 @@
30#include "rcar_du_regs.h" 31#include "rcar_du_regs.h"
31 32
32/* ----------------------------------------------------------------------------- 33/* -----------------------------------------------------------------------------
34 * Device Information
35 */
36
37static const struct rcar_du_device_info rcar_du_r8a7779_info = {
38 .features = 0,
39 .num_crtcs = 2,
40 .routes = {
41 /* R8A7779 has two RGB outputs and one (currently unsupported)
42 * TCON output.
43 */
44 [RCAR_DU_OUTPUT_DPAD0] = {
45 .possible_crtcs = BIT(0),
46 .encoder_type = DRM_MODE_ENCODER_NONE,
47 .port = 0,
48 },
49 [RCAR_DU_OUTPUT_DPAD1] = {
50 .possible_crtcs = BIT(1) | BIT(0),
51 .encoder_type = DRM_MODE_ENCODER_NONE,
52 .port = 1,
53 },
54 },
55 .num_lvds = 0,
56};
57
58static const struct rcar_du_device_info rcar_du_r8a7790_info = {
59 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8,
60 .quirks = RCAR_DU_QUIRK_ALIGN_128B | RCAR_DU_QUIRK_LVDS_LANES,
61 .num_crtcs = 3,
62 .routes = {
63 /* R8A7790 has one RGB output, two LVDS outputs and one
64 * (currently unsupported) TCON output.
65 */
66 [RCAR_DU_OUTPUT_DPAD0] = {
67 .possible_crtcs = BIT(2) | BIT(1) | BIT(0),
68 .encoder_type = DRM_MODE_ENCODER_NONE,
69 .port = 0,
70 },
71 [RCAR_DU_OUTPUT_LVDS0] = {
72 .possible_crtcs = BIT(0),
73 .encoder_type = DRM_MODE_ENCODER_LVDS,
74 .port = 1,
75 },
76 [RCAR_DU_OUTPUT_LVDS1] = {
77 .possible_crtcs = BIT(2) | BIT(1),
78 .encoder_type = DRM_MODE_ENCODER_LVDS,
79 .port = 2,
80 },
81 },
82 .num_lvds = 2,
83};
84
85static const struct rcar_du_device_info rcar_du_r8a7791_info = {
86 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8,
87 .num_crtcs = 2,
88 .routes = {
89 /* R8A7791 has one RGB output, one LVDS output and one
90 * (currently unsupported) TCON output.
91 */
92 [RCAR_DU_OUTPUT_DPAD0] = {
93 .possible_crtcs = BIT(1),
94 .encoder_type = DRM_MODE_ENCODER_NONE,
95 .port = 0,
96 },
97 [RCAR_DU_OUTPUT_LVDS0] = {
98 .possible_crtcs = BIT(0),
99 .encoder_type = DRM_MODE_ENCODER_LVDS,
100 .port = 1,
101 },
102 },
103 .num_lvds = 1,
104};
105
106static const struct platform_device_id rcar_du_id_table[] = {
107 { "rcar-du-r8a7779", (kernel_ulong_t)&rcar_du_r8a7779_info },
108 { "rcar-du-r8a7790", (kernel_ulong_t)&rcar_du_r8a7790_info },
109 { "rcar-du-r8a7791", (kernel_ulong_t)&rcar_du_r8a7791_info },
110 { }
111};
112
113MODULE_DEVICE_TABLE(platform, rcar_du_id_table);
114
115static const struct of_device_id rcar_du_of_table[] = {
116 { .compatible = "renesas,du-r8a7779", .data = &rcar_du_r8a7779_info },
117 { .compatible = "renesas,du-r8a7790", .data = &rcar_du_r8a7790_info },
118 { .compatible = "renesas,du-r8a7791", .data = &rcar_du_r8a7791_info },
119 { }
120};
121
122MODULE_DEVICE_TABLE(of, rcar_du_of_table);
123
124/* -----------------------------------------------------------------------------
33 * DRM operations 125 * DRM operations
34 */ 126 */
35 127
@@ -53,12 +145,13 @@ static int rcar_du_unload(struct drm_device *dev)
53static int rcar_du_load(struct drm_device *dev, unsigned long flags) 145static int rcar_du_load(struct drm_device *dev, unsigned long flags)
54{ 146{
55 struct platform_device *pdev = dev->platformdev; 147 struct platform_device *pdev = dev->platformdev;
148 struct device_node *np = pdev->dev.of_node;
56 struct rcar_du_platform_data *pdata = pdev->dev.platform_data; 149 struct rcar_du_platform_data *pdata = pdev->dev.platform_data;
57 struct rcar_du_device *rcdu; 150 struct rcar_du_device *rcdu;
58 struct resource *mem; 151 struct resource *mem;
59 int ret; 152 int ret;
60 153
61 if (pdata == NULL) { 154 if (pdata == NULL && np == NULL) {
62 dev_err(dev->dev, "no platform data\n"); 155 dev_err(dev->dev, "no platform data\n");
63 return -ENODEV; 156 return -ENODEV;
64 } 157 }
@@ -71,7 +164,8 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags)
71 164
72 rcdu->dev = &pdev->dev; 165 rcdu->dev = &pdev->dev;
73 rcdu->pdata = pdata; 166 rcdu->pdata = pdata;
74 rcdu->info = (struct rcar_du_device_info *)pdev->id_entry->driver_data; 167 rcdu->info = np ? of_match_device(rcar_du_of_table, rcdu->dev)->data
168 : (void *)platform_get_device_id(pdev)->driver_data;
75 rcdu->ddev = dev; 169 rcdu->ddev = dev;
76 dev->dev_private = rcdu; 170 dev->dev_private = rcdu;
77 171
@@ -232,77 +326,6 @@ static int rcar_du_remove(struct platform_device *pdev)
232 return 0; 326 return 0;
233} 327}
234 328
235static const struct rcar_du_device_info rcar_du_r8a7779_info = {
236 .features = 0,
237 .num_crtcs = 2,
238 .routes = {
239 /* R8A7779 has two RGB outputs and one (currently unsupported)
240 * TCON output.
241 */
242 [RCAR_DU_OUTPUT_DPAD0] = {
243 .possible_crtcs = BIT(0),
244 .encoder_type = DRM_MODE_ENCODER_NONE,
245 },
246 [RCAR_DU_OUTPUT_DPAD1] = {
247 .possible_crtcs = BIT(1) | BIT(0),
248 .encoder_type = DRM_MODE_ENCODER_NONE,
249 },
250 },
251 .num_lvds = 0,
252};
253
254static const struct rcar_du_device_info rcar_du_r8a7790_info = {
255 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8,
256 .quirks = RCAR_DU_QUIRK_ALIGN_128B | RCAR_DU_QUIRK_LVDS_LANES,
257 .num_crtcs = 3,
258 .routes = {
259 /* R8A7790 has one RGB output, two LVDS outputs and one
260 * (currently unsupported) TCON output.
261 */
262 [RCAR_DU_OUTPUT_DPAD0] = {
263 .possible_crtcs = BIT(2) | BIT(1) | BIT(0),
264 .encoder_type = DRM_MODE_ENCODER_NONE,
265 },
266 [RCAR_DU_OUTPUT_LVDS0] = {
267 .possible_crtcs = BIT(0),
268 .encoder_type = DRM_MODE_ENCODER_LVDS,
269 },
270 [RCAR_DU_OUTPUT_LVDS1] = {
271 .possible_crtcs = BIT(2) | BIT(1),
272 .encoder_type = DRM_MODE_ENCODER_LVDS,
273 },
274 },
275 .num_lvds = 2,
276};
277
278static const struct rcar_du_device_info rcar_du_r8a7791_info = {
279 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK | RCAR_DU_FEATURE_DEFR8,
280 .num_crtcs = 2,
281 .routes = {
282 /* R8A7791 has one RGB output, one LVDS output and one
283 * (currently unsupported) TCON output.
284 */
285 [RCAR_DU_OUTPUT_DPAD0] = {
286 .possible_crtcs = BIT(1),
287 .encoder_type = DRM_MODE_ENCODER_NONE,
288 },
289 [RCAR_DU_OUTPUT_LVDS0] = {
290 .possible_crtcs = BIT(0),
291 .encoder_type = DRM_MODE_ENCODER_LVDS,
292 },
293 },
294 .num_lvds = 1,
295};
296
297static const struct platform_device_id rcar_du_id_table[] = {
298 { "rcar-du-r8a7779", (kernel_ulong_t)&rcar_du_r8a7779_info },
299 { "rcar-du-r8a7790", (kernel_ulong_t)&rcar_du_r8a7790_info },
300 { "rcar-du-r8a7791", (kernel_ulong_t)&rcar_du_r8a7791_info },
301 { }
302};
303
304MODULE_DEVICE_TABLE(platform, rcar_du_id_table);
305
306static struct platform_driver rcar_du_platform_driver = { 329static struct platform_driver rcar_du_platform_driver = {
307 .probe = rcar_du_probe, 330 .probe = rcar_du_probe,
308 .remove = rcar_du_remove, 331 .remove = rcar_du_remove,
@@ -310,6 +333,7 @@ static struct platform_driver rcar_du_platform_driver = {
310 .owner = THIS_MODULE, 333 .owner = THIS_MODULE,
311 .name = "rcar-du", 334 .name = "rcar-du",
312 .pm = &rcar_du_pm_ops, 335 .pm = &rcar_du_pm_ops,
336 .of_match_table = rcar_du_of_table,
313 }, 337 },
314 .id_table = rcar_du_id_table, 338 .id_table = rcar_du_id_table,
315}; 339};
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
index e31b735d3f25..8e494633c3b3 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_drv.h -- R-Car Display Unit DRM driver 2 * rcar_du_drv.h -- R-Car Display Unit DRM driver
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -37,6 +37,7 @@ struct rcar_du_lvdsenc;
37 * struct rcar_du_output_routing - Output routing specification 37 * struct rcar_du_output_routing - Output routing specification
38 * @possible_crtcs: bitmask of possible CRTCs for the output 38 * @possible_crtcs: bitmask of possible CRTCs for the output
39 * @encoder_type: DRM type of the internal encoder associated with the output 39 * @encoder_type: DRM type of the internal encoder associated with the output
40 * @port: device tree port number corresponding to this output route
40 * 41 *
41 * The DU has 5 possible outputs (DPAD0/1, LVDS0/1, TCON). Output routing data 42 * The DU has 5 possible outputs (DPAD0/1, LVDS0/1, TCON). Output routing data
42 * specify the valid SoC outputs, which CRTCs can drive the output, and the type 43 * specify the valid SoC outputs, which CRTCs can drive the output, and the type
@@ -45,6 +46,7 @@ struct rcar_du_lvdsenc;
45struct rcar_du_output_routing { 46struct rcar_du_output_routing {
46 unsigned int possible_crtcs; 47 unsigned int possible_crtcs;
47 unsigned int encoder_type; 48 unsigned int encoder_type;
49 unsigned int port;
48}; 50};
49 51
50/* 52/*
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index 3daa7a168dc6..7c0ec95915ef 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_encoder.c -- R-Car Display Unit Encoder 2 * rcar_du_encoder.c -- R-Car Display Unit Encoder
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -142,7 +142,8 @@ static const struct drm_encoder_funcs encoder_funcs = {
142int rcar_du_encoder_init(struct rcar_du_device *rcdu, 142int rcar_du_encoder_init(struct rcar_du_device *rcdu,
143 enum rcar_du_encoder_type type, 143 enum rcar_du_encoder_type type,
144 enum rcar_du_output output, 144 enum rcar_du_output output,
145 const struct rcar_du_encoder_data *data) 145 const struct rcar_du_encoder_data *data,
146 struct device_node *np)
146{ 147{
147 struct rcar_du_encoder *renc; 148 struct rcar_du_encoder *renc;
148 unsigned int encoder_type; 149 unsigned int encoder_type;
@@ -189,9 +190,11 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
189 drm_encoder_helper_add(&renc->encoder, &encoder_helper_funcs); 190 drm_encoder_helper_add(&renc->encoder, &encoder_helper_funcs);
190 191
191 switch (encoder_type) { 192 switch (encoder_type) {
192 case DRM_MODE_ENCODER_LVDS: 193 case DRM_MODE_ENCODER_LVDS: {
193 return rcar_du_lvds_connector_init(rcdu, renc, 194 const struct rcar_du_panel_data *pdata =
194 &data->connector.lvds.panel); 195 data ? &data->connector.lvds.panel : NULL;
196 return rcar_du_lvds_connector_init(rcdu, renc, pdata, np);
197 }
195 198
196 case DRM_MODE_ENCODER_DAC: 199 case DRM_MODE_ENCODER_DAC:
197 return rcar_du_vga_connector_init(rcdu, renc); 200 return rcar_du_vga_connector_init(rcdu, renc);
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
index 0e5a65e45d0e..bd624135ef1f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_encoder.h -- R-Car Display Unit Encoder 2 * rcar_du_encoder.h -- R-Car Display Unit Encoder
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -44,6 +44,7 @@ rcar_du_connector_best_encoder(struct drm_connector *connector);
44int rcar_du_encoder_init(struct rcar_du_device *rcdu, 44int rcar_du_encoder_init(struct rcar_du_device *rcdu,
45 enum rcar_du_encoder_type type, 45 enum rcar_du_encoder_type type,
46 enum rcar_du_output output, 46 enum rcar_du_output output,
47 const struct rcar_du_encoder_data *data); 47 const struct rcar_du_encoder_data *data,
48 struct device_node *np);
48 49
49#endif /* __RCAR_DU_ENCODER_H__ */ 50#endif /* __RCAR_DU_ENCODER_H__ */
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.c b/drivers/gpu/drm/rcar-du/rcar_du_group.c
index eb53cd97e8c6..4e7614b145db 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_group.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_group.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_group.c -- R-Car Display Unit Channels Pair 2 * rcar_du_group.c -- R-Car Display Unit Channels Pair
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_group.h b/drivers/gpu/drm/rcar-du/rcar_du_group.h
index 5025930972ec..0c38cdcda4ca 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_group.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_group.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_group.c -- R-Car Display Unit Planes and CRTCs Group 2 * rcar_du_group.c -- R-Car Display Unit Planes and CRTCs Group
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 76026104d000..6c24ad7d03ef 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_kms.c -- R-Car Display Unit Mode Setting 2 * rcar_du_kms.c -- R-Car Display Unit Mode Setting
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -17,6 +17,8 @@
17#include <drm/drm_fb_cma_helper.h> 17#include <drm/drm_fb_cma_helper.h>
18#include <drm/drm_gem_cma_helper.h> 18#include <drm/drm_gem_cma_helper.h>
19 19
20#include <linux/of_graph.h>
21
20#include "rcar_du_crtc.h" 22#include "rcar_du_crtc.h"
21#include "rcar_du_drv.h" 23#include "rcar_du_drv.h"
22#include "rcar_du_encoder.h" 24#include "rcar_du_encoder.h"
@@ -188,6 +190,205 @@ static const struct drm_mode_config_funcs rcar_du_mode_config_funcs = {
188 .output_poll_changed = rcar_du_output_poll_changed, 190 .output_poll_changed = rcar_du_output_poll_changed,
189}; 191};
190 192
193static int rcar_du_encoders_init_pdata(struct rcar_du_device *rcdu)
194{
195 unsigned int num_encoders = 0;
196 unsigned int i;
197 int ret;
198
199 for (i = 0; i < rcdu->pdata->num_encoders; ++i) {
200 const struct rcar_du_encoder_data *pdata =
201 &rcdu->pdata->encoders[i];
202 const struct rcar_du_output_routing *route =
203 &rcdu->info->routes[pdata->output];
204
205 if (pdata->type == RCAR_DU_ENCODER_UNUSED)
206 continue;
207
208 if (pdata->output >= RCAR_DU_OUTPUT_MAX ||
209 route->possible_crtcs == 0) {
210 dev_warn(rcdu->dev,
211 "encoder %u references unexisting output %u, skipping\n",
212 i, pdata->output);
213 continue;
214 }
215
216 ret = rcar_du_encoder_init(rcdu, pdata->type, pdata->output,
217 pdata, NULL);
218 if (ret < 0)
219 return ret;
220
221 num_encoders++;
222 }
223
224 return num_encoders;
225}
226
227static int rcar_du_encoders_init_dt_one(struct rcar_du_device *rcdu,
228 enum rcar_du_output output,
229 struct of_endpoint *ep)
230{
231 static const struct {
232 const char *compatible;
233 enum rcar_du_encoder_type type;
234 } encoders[] = {
235 { "adi,adv7123", RCAR_DU_ENCODER_VGA },
236 { "thine,thc63lvdm83d", RCAR_DU_ENCODER_LVDS },
237 };
238
239 enum rcar_du_encoder_type enc_type = RCAR_DU_ENCODER_NONE;
240 struct device_node *connector = NULL;
241 struct device_node *encoder = NULL;
242 struct device_node *prev = NULL;
243 struct device_node *entity_ep_node;
244 struct device_node *entity;
245 int ret;
246
247 /*
248 * Locate the connected entity and infer its type from the number of
249 * endpoints.
250 */
251 entity = of_graph_get_remote_port_parent(ep->local_node);
252 if (!entity) {
253 dev_dbg(rcdu->dev, "unconnected endpoint %s, skipping\n",
254 ep->local_node->full_name);
255 return 0;
256 }
257
258 entity_ep_node = of_parse_phandle(ep->local_node, "remote-endpoint", 0);
259
260 while (1) {
261 struct device_node *ep_node;
262
263 ep_node = of_graph_get_next_endpoint(entity, prev);
264 of_node_put(prev);
265 prev = ep_node;
266
267 if (!ep_node)
268 break;
269
270 if (ep_node == entity_ep_node)
271 continue;
272
273 /*
274 * We've found one endpoint other than the input, this must
275 * be an encoder. Locate the connector.
276 */
277 encoder = entity;
278 connector = of_graph_get_remote_port_parent(ep_node);
279 of_node_put(ep_node);
280
281 if (!connector) {
282 dev_warn(rcdu->dev,
283 "no connector for encoder %s, skipping\n",
284 encoder->full_name);
285 of_node_put(entity_ep_node);
286 of_node_put(encoder);
287 return 0;
288 }
289
290 break;
291 }
292
293 of_node_put(entity_ep_node);
294
295 if (encoder) {
296 /*
297 * If an encoder has been found, get its type based on its
298 * compatible string.
299 */
300 unsigned int i;
301
302 for (i = 0; i < ARRAY_SIZE(encoders); ++i) {
303 if (of_device_is_compatible(encoder,
304 encoders[i].compatible)) {
305 enc_type = encoders[i].type;
306 break;
307 }
308 }
309
310 if (i == ARRAY_SIZE(encoders)) {
311 dev_warn(rcdu->dev,
312 "unknown encoder type for %s, skipping\n",
313 encoder->full_name);
314 of_node_put(encoder);
315 of_node_put(connector);
316 return 0;
317 }
318 } else {
319 /*
320 * If no encoder has been found the entity must be the
321 * connector.
322 */
323 connector = entity;
324 }
325
326 ret = rcar_du_encoder_init(rcdu, enc_type, output, NULL, connector);
327 of_node_put(encoder);
328 of_node_put(connector);
329
330 return ret < 0 ? ret : 1;
331}
332
333static int rcar_du_encoders_init_dt(struct rcar_du_device *rcdu)
334{
335 struct device_node *np = rcdu->dev->of_node;
336 struct device_node *prev = NULL;
337 unsigned int num_encoders = 0;
338
339 /*
340 * Iterate over the endpoints and create one encoder for each output
341 * pipeline.
342 */
343 while (1) {
344 struct device_node *ep_node;
345 enum rcar_du_output output;
346 struct of_endpoint ep;
347 unsigned int i;
348 int ret;
349
350 ep_node = of_graph_get_next_endpoint(np, prev);
351 of_node_put(prev);
352 prev = ep_node;
353
354 if (ep_node == NULL)
355 break;
356
357 ret = of_graph_parse_endpoint(ep_node, &ep);
358 if (ret < 0) {
359 of_node_put(ep_node);
360 return ret;
361 }
362
363 /* Find the output route corresponding to the port number. */
364 for (i = 0; i < RCAR_DU_OUTPUT_MAX; ++i) {
365 if (rcdu->info->routes[i].possible_crtcs &&
366 rcdu->info->routes[i].port == ep.port) {
367 output = i;
368 break;
369 }
370 }
371
372 if (i == RCAR_DU_OUTPUT_MAX) {
373 dev_warn(rcdu->dev,
374 "port %u references unexisting output, skipping\n",
375 ep.port);
376 continue;
377 }
378
379 /* Process the output pipeline. */
380 ret = rcar_du_encoders_init_dt_one(rcdu, output, &ep);
381 if (ret < 0) {
382 of_node_put(ep_node);
383 return ret;
384 }
385
386 num_encoders += ret;
387 }
388
389 return num_encoders;
390}
391
191int rcar_du_modeset_init(struct rcar_du_device *rcdu) 392int rcar_du_modeset_init(struct rcar_du_device *rcdu)
192{ 393{
193 static const unsigned int mmio_offsets[] = { 394 static const unsigned int mmio_offsets[] = {
@@ -197,6 +398,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
197 struct drm_device *dev = rcdu->ddev; 398 struct drm_device *dev = rcdu->ddev;
198 struct drm_encoder *encoder; 399 struct drm_encoder *encoder;
199 struct drm_fbdev_cma *fbdev; 400 struct drm_fbdev_cma *fbdev;
401 unsigned int num_encoders;
200 unsigned int num_groups; 402 unsigned int num_groups;
201 unsigned int i; 403 unsigned int i;
202 int ret; 404 int ret;
@@ -240,28 +442,15 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
240 if (ret < 0) 442 if (ret < 0)
241 return ret; 443 return ret;
242 444
243 for (i = 0; i < rcdu->pdata->num_encoders; ++i) { 445 if (rcdu->pdata)
244 const struct rcar_du_encoder_data *pdata = 446 ret = rcar_du_encoders_init_pdata(rcdu);
245 &rcdu->pdata->encoders[i]; 447 else
246 const struct rcar_du_output_routing *route = 448 ret = rcar_du_encoders_init_dt(rcdu);
247 &rcdu->info->routes[pdata->output];
248
249 if (pdata->type == RCAR_DU_ENCODER_UNUSED)
250 continue;
251 449
252 if (pdata->output >= RCAR_DU_OUTPUT_MAX || 450 if (ret < 0)
253 route->possible_crtcs == 0) { 451 return ret;
254 dev_warn(rcdu->dev,
255 "encoder %u references unexisting output %u, skipping\n",
256 i, pdata->output);
257 continue;
258 }
259 452
260 ret = rcar_du_encoder_init(rcdu, pdata->type, pdata->output, 453 num_encoders = ret;
261 pdata);
262 if (ret < 0)
263 return ret;
264 }
265 454
266 /* Set the possible CRTCs and possible clones. There's always at least 455 /* Set the possible CRTCs and possible clones. There's always at least
267 * one way for all encoders to clone each other, set all bits in the 456 * one way for all encoders to clone each other, set all bits in the
@@ -273,7 +462,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
273 &rcdu->info->routes[renc->output]; 462 &rcdu->info->routes[renc->output];
274 463
275 encoder->possible_crtcs = route->possible_crtcs; 464 encoder->possible_crtcs = route->possible_crtcs;
276 encoder->possible_clones = (1 << rcdu->pdata->num_encoders) - 1; 465 encoder->possible_clones = (1 << num_encoders) - 1;
277 } 466 }
278 467
279 /* Now that the CRTCs have been initialized register the planes. */ 468 /* Now that the CRTCs have been initialized register the planes. */
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.h b/drivers/gpu/drm/rcar-du/rcar_du_kms.h
index 5750e6af5655..07951d5fe38b 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_kms.h -- R-Car Display Unit Mode Setting 2 * rcar_du_kms.h -- R-Car Display Unit Mode Setting
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
index 21426bd234eb..115eed20db12 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_lvdscon.c -- R-Car Display Unit LVDS Connector 2 * rcar_du_lvdscon.c -- R-Car Display Unit LVDS Connector
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -15,6 +15,10 @@
15#include <drm/drm_crtc.h> 15#include <drm/drm_crtc.h>
16#include <drm/drm_crtc_helper.h> 16#include <drm/drm_crtc_helper.h>
17 17
18#include <video/display_timing.h>
19#include <video/of_display_timing.h>
20#include <video/videomode.h>
21
18#include "rcar_du_drv.h" 22#include "rcar_du_drv.h"
19#include "rcar_du_encoder.h" 23#include "rcar_du_encoder.h"
20#include "rcar_du_kms.h" 24#include "rcar_du_kms.h"
@@ -23,7 +27,7 @@
23struct rcar_du_lvds_connector { 27struct rcar_du_lvds_connector {
24 struct rcar_du_connector connector; 28 struct rcar_du_connector connector;
25 29
26 const struct rcar_du_panel_data *panel; 30 struct rcar_du_panel_data panel;
27}; 31};
28 32
29#define to_rcar_lvds_connector(c) \ 33#define to_rcar_lvds_connector(c) \
@@ -40,18 +44,9 @@ static int rcar_du_lvds_connector_get_modes(struct drm_connector *connector)
40 return 0; 44 return 0;
41 45
42 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; 46 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
43 mode->clock = lvdscon->panel->mode.clock; 47
44 mode->hdisplay = lvdscon->panel->mode.hdisplay; 48 drm_display_mode_from_videomode(&lvdscon->panel.mode, mode);
45 mode->hsync_start = lvdscon->panel->mode.hsync_start; 49
46 mode->hsync_end = lvdscon->panel->mode.hsync_end;
47 mode->htotal = lvdscon->panel->mode.htotal;
48 mode->vdisplay = lvdscon->panel->mode.vdisplay;
49 mode->vsync_start = lvdscon->panel->mode.vsync_start;
50 mode->vsync_end = lvdscon->panel->mode.vsync_end;
51 mode->vtotal = lvdscon->panel->mode.vtotal;
52 mode->flags = lvdscon->panel->mode.flags;
53
54 drm_mode_set_name(mode);
55 drm_mode_probed_add(connector, mode); 50 drm_mode_probed_add(connector, mode);
56 51
57 return 1; 52 return 1;
@@ -83,7 +78,8 @@ static const struct drm_connector_funcs connector_funcs = {
83 78
84int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu, 79int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
85 struct rcar_du_encoder *renc, 80 struct rcar_du_encoder *renc,
86 const struct rcar_du_panel_data *panel) 81 const struct rcar_du_panel_data *panel,
82 /* TODO const */ struct device_node *np)
87{ 83{
88 struct rcar_du_lvds_connector *lvdscon; 84 struct rcar_du_lvds_connector *lvdscon;
89 struct drm_connector *connector; 85 struct drm_connector *connector;
@@ -93,11 +89,24 @@ int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
93 if (lvdscon == NULL) 89 if (lvdscon == NULL)
94 return -ENOMEM; 90 return -ENOMEM;
95 91
96 lvdscon->panel = panel; 92 if (panel) {
93 lvdscon->panel = *panel;
94 } else {
95 struct display_timing timing;
96
97 ret = of_get_display_timing(np, "panel-timing", &timing);
98 if (ret < 0)
99 return ret;
100
101 videomode_from_timing(&timing, &lvdscon->panel.mode);
102
103 of_property_read_u32(np, "width-mm", &lvdscon->panel.width_mm);
104 of_property_read_u32(np, "height-mm", &lvdscon->panel.height_mm);
105 }
97 106
98 connector = &lvdscon->connector.connector; 107 connector = &lvdscon->connector.connector;
99 connector->display_info.width_mm = panel->width_mm; 108 connector->display_info.width_mm = lvdscon->panel.width_mm;
100 connector->display_info.height_mm = panel->height_mm; 109 connector->display_info.height_mm = lvdscon->panel.height_mm;
101 110
102 ret = drm_connector_init(rcdu->ddev, connector, &connector_funcs, 111 ret = drm_connector_init(rcdu->ddev, connector, &connector_funcs,
103 DRM_MODE_CONNECTOR_LVDS); 112 DRM_MODE_CONNECTOR_LVDS);
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h
index bff8683699ca..d11424d537f9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_lvdscon.h -- R-Car Display Unit LVDS Connector 2 * rcar_du_lvdscon.h -- R-Car Display Unit LVDS Connector
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
@@ -20,6 +20,7 @@ struct rcar_du_panel_data;
20 20
21int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu, 21int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
22 struct rcar_du_encoder *renc, 22 struct rcar_du_encoder *renc,
23 const struct rcar_du_panel_data *panel); 23 const struct rcar_du_panel_data *panel,
24 struct device_node *np);
24 25
25#endif /* __RCAR_DU_LVDSCON_H__ */ 26#endif /* __RCAR_DU_LVDSCON_H__ */
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
index df30a075d793..7cfb48ce1791 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_lvdsenc.c -- R-Car Display Unit LVDS Encoder 2 * rcar_du_lvdsenc.c -- R-Car Display Unit LVDS Encoder
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h
index 7051c6de19ae..3303a55cec79 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_lvdsenc.h -- R-Car Display Unit LVDS Encoder 2 * rcar_du_lvdsenc.h -- R-Car Display Unit LVDS Encoder
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index 3fb69d9ae61b..72a7cb47bd9f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_plane.c -- R-Car Display Unit Planes 2 * rcar_du_plane.c -- R-Car Display Unit Planes
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h
index f94f9ce84998..3021288b1a89 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_plane.h -- R-Car Display Unit Planes 2 * rcar_du_plane.h -- R-Car Display Unit Planes
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
index 8af3944d31b9..564a723ede03 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_vgacon.c -- R-Car Display Unit VGA Connector 2 * rcar_du_vgacon.c -- R-Car Display Unit VGA Connector
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.h b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.h
index b12b0cf7f117..112f50316e01 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vgacon.h
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vgacon.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * rcar_du_vgacon.h -- R-Car Display Unit VGA Connector 2 * rcar_du_vgacon.h -- R-Car Display Unit VGA Connector
3 * 3 *
4 * Copyright (C) 2013 Renesas Corporation 4 * Copyright (C) 2013-2014 Renesas Electronics Corporation
5 * 5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c
index 463aee18f774..33dd41afea0e 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_backlight.c -- SH Mobile DRM Backlight 2 * shmob_drm_backlight.c -- SH Mobile DRM Backlight
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_backlight.h b/drivers/gpu/drm/shmobile/shmob_drm_backlight.h
index 9477595d2ff3..bac719ecc301 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_backlight.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_backlight.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_backlight.h -- SH Mobile DRM Backlight 2 * shmob_drm_backlight.h -- SH Mobile DRM Backlight
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
index 47875de89010..0ddce4d046d9 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_crtc.c -- SH Mobile DRM CRTCs 2 * shmob_drm_crtc.c -- SH Mobile DRM CRTCs
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.h b/drivers/gpu/drm/shmobile/shmob_drm_crtc.h
index e5bd109c4c38..eddad6dcc88a 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_crtc.h -- SH Mobile DRM CRTCs 2 * shmob_drm_crtc.h -- SH Mobile DRM CRTCs
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 873d12f851bf..e62cbde81e50 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_drv.c -- SH Mobile DRM driver 2 * shmob_drm_drv.c -- SH Mobile DRM driver
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.h b/drivers/gpu/drm/shmobile/shmob_drm_drv.h
index 4d46b811b5a7..02ea315ba69a 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm.h -- SH Mobile DRM driver 2 * shmob_drm.h -- SH Mobile DRM driver
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_kms.c b/drivers/gpu/drm/shmobile/shmob_drm_kms.c
index fc0ef0ca7d04..aaf98ace4a90 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_kms.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_kms.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_kms.c -- SH Mobile DRM Mode Setting 2 * shmob_drm_kms.c -- SH Mobile DRM Mode Setting
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_kms.h b/drivers/gpu/drm/shmobile/shmob_drm_kms.h
index 9495c9111308..06d5b7caa026 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_kms.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_kms.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_kms.h -- SH Mobile DRM Mode Setting 2 * shmob_drm_kms.h -- SH Mobile DRM Mode Setting
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_plane.c b/drivers/gpu/drm/shmobile/shmob_drm_plane.c
index 060ae03e5f9b..1805bb23b113 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_plane.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_plane.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_plane.c -- SH Mobile DRM Planes 2 * shmob_drm_plane.c -- SH Mobile DRM Planes
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_plane.h b/drivers/gpu/drm/shmobile/shmob_drm_plane.h
index 99623d05e3b0..a58cc1fc3240 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_plane.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_plane.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_plane.h -- SH Mobile DRM Planes 2 * shmob_drm_plane.h -- SH Mobile DRM Planes
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_regs.h b/drivers/gpu/drm/shmobile/shmob_drm_regs.h
index 7923cdd6368e..ea17d4415b9e 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_regs.h
+++ b/drivers/gpu/drm/shmobile/shmob_drm_regs.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * shmob_drm_regs.h -- SH Mobile DRM registers 2 * shmob_drm_regs.h -- SH Mobile DRM registers
3 * 3 *
4 * Copyright (C) 2012 Renesas Corporation 4 * Copyright (C) 2012 Renesas Electronics Corporation
5 * 5 *
6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com) 6 * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 * 7 *
diff --git a/include/linux/platform_data/rcar-du.h b/include/linux/platform_data/rcar-du.h
index 1a2e9901a22e..a5f045e1d8fe 100644
--- a/include/linux/platform_data/rcar-du.h
+++ b/include/linux/platform_data/rcar-du.h
@@ -14,7 +14,7 @@
14#ifndef __RCAR_DU_H__ 14#ifndef __RCAR_DU_H__
15#define __RCAR_DU_H__ 15#define __RCAR_DU_H__
16 16
17#include <drm/drm_mode.h> 17#include <video/videomode.h>
18 18
19enum rcar_du_output { 19enum rcar_du_output {
20 RCAR_DU_OUTPUT_DPAD0, 20 RCAR_DU_OUTPUT_DPAD0,
@@ -35,7 +35,7 @@ enum rcar_du_encoder_type {
35struct rcar_du_panel_data { 35struct rcar_du_panel_data {
36 unsigned int width_mm; /* Panel width in mm */ 36 unsigned int width_mm; /* Panel width in mm */
37 unsigned int height_mm; /* Panel height in mm */ 37 unsigned int height_mm; /* Panel height in mm */
38 struct drm_mode_modeinfo mode; 38 struct videomode mode;
39}; 39};
40 40
41struct rcar_du_connector_lvds_data { 41struct rcar_du_connector_lvds_data {