Commit cd4cb1a7dfd7d90fa1de8b51222d96efceb6f3ef

Authored by Olof Johansson

Merge tag 'omap-for-v3.10/dss-signed' of git://git.kernel.org/pub/scm/linux/kern…

…el/git/tmlind/linux-omap into late/cleanup

From Tony Lindgren:
Display related clean-up from Tomi Valkeinen.

These were separated from the DSS driver changes to leave out
a dependency between the driver and arch/arm related code.

* tag 'omap-for-v3.10/dss-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  arm: dss-common: don't use reset_gpio from omap4_panda_dvi_device
  arm: omap boards: Remove unnecessary platform_enable/disable callbacks for VENC devices
  arm: omap: dss-common: use picodlp panel's gpio handling
  arm: omap: board-omap3pandora: use tpo panel's gpio handling
  arm: omap: board-zoom: use NEC panel's gpio handling
  arm: omap: board-rx-51: use acx565akm panel's gpio handling
  arm: omap: board-sdp3430: use sharp panel's gpio handling
  arm: omap: board-omap3evm: use sharp panel's gpio handling
  arm: omap: board-overo: use lb035q02 dpi panel's gpio handling
  arm: omap: board-ldp: use generic dpi panel's gpio handling
  arm: omap: board-am3517: use generic dpi panel's gpio handling
  arm: omap: board-cm-t35: use generic dpi panel's gpio handling
  arm: omap: board-devkit8000: use generic dpi panel's gpio handling
  arm: omap: board-2430: use generic dpi panel's gpio handling
  ARM: OMAP: zoom: Use pwm stack for lcd and keyboard backlight
  OMAPDSS: add fields to panels' platform data
  OMAPDSS: panels: keep platform data of all panels in a single header

Conflicts:
	arch/arm/mach-omap2/board-2430sdp.c
	arch/arm/mach-omap2/board-zoom-display.c

Showing 27 changed files Side-by-side Diff

arch/arm/mach-omap2/board-2430sdp.c
... ... @@ -38,7 +38,7 @@
38 38 #include "gpmc-smc91x.h"
39 39  
40 40 #include <video/omapdss.h>
41   -#include <video/omap-panel-generic-dpi.h>
  41 +#include <video/omap-panel-data.h>
42 42  
43 43 #include "mux.h"
44 44 #include "hsmmc.h"
45 45  
... ... @@ -108,24 +108,13 @@
108 108 #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
109 109 #define SDP2430_LCD_PANEL_ENABLE_GPIO 154
110 110  
111   -static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
112   -{
113   - gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
114   - gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
115   -
116   - return 0;
117   -}
118   -
119   -static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
120   -{
121   - gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
122   - gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
123   -}
124   -
125 111 static struct panel_generic_dpi_data sdp2430_panel_data = {
126 112 .name = "nec_nl2432dr22-11b",
127   - .platform_enable = sdp2430_panel_enable_lcd,
128   - .platform_disable = sdp2430_panel_disable_lcd,
  113 + .num_gpios = 2,
  114 + .gpios = {
  115 + SDP2430_LCD_PANEL_ENABLE_GPIO,
  116 + SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
  117 + },
129 118 };
130 119  
131 120 static struct omap_dss_device sdp2430_lcd_device = {
... ... @@ -146,26 +135,6 @@
146 135 .default_device = &sdp2430_lcd_device,
147 136 };
148 137  
149   -static void __init sdp2430_display_init(void)
150   -{
151   - int r;
152   -
153   - static struct gpio gpios[] __initdata = {
154   - { SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
155   - "LCD reset" },
156   - { SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
157   - "LCD Backlight" },
158   - };
159   -
160   - r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
161   - if (r) {
162   - pr_err("Cannot request LCD GPIOs, error %d\n", r);
163   - return;
164   - }
165   -
166   - omap_display_init(&sdp2430_dss_data);
167   -}
168   -
169 138 #if IS_ENABLED(CONFIG_SMC91X)
170 139  
171 140 static struct omap_smc91x_platform_data board_smc91x_data = {
... ... @@ -273,7 +242,7 @@
273 242 gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
274 243 "Secondary LCD backlight");
275 244  
276   - sdp2430_display_init();
  245 + omap_display_init(&sdp2430_dss_data);
277 246 }
278 247  
279 248 MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
arch/arm/mach-omap2/board-3430sdp.c
... ... @@ -35,7 +35,7 @@
35 35 #include "common.h"
36 36 #include <linux/omap-dma.h>
37 37 #include <video/omapdss.h>
38   -#include <video/omap-panel-tfp410.h>
  38 +#include <video/omap-panel-data.h>
39 39  
40 40 #include "gpmc.h"
41 41 #include "gpmc-smc91x.h"
42 42  
43 43  
44 44  
45 45  
46 46  
... ... @@ -108,53 +108,38 @@
108 108 #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
109 109 #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
110 110  
111   -static struct gpio sdp3430_dss_gpios[] __initdata = {
112   - {SDP3430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD reset" },
113   - {SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
114   -};
115   -
116 111 static void __init sdp3430_display_init(void)
117 112 {
118 113 int r;
119 114  
120   - r = gpio_request_array(sdp3430_dss_gpios,
121   - ARRAY_SIZE(sdp3430_dss_gpios));
  115 + /*
  116 + * the backlight GPIO doesn't directly go to the panel, it enables
  117 + * an internal circuit on 3430sdp to create the signal V_BKL_28V,
  118 + * this is connected to LED+ pin of the sharp panel. This GPIO
  119 + * is left enabled in the board file, and not passed to the panel
  120 + * as platform_data.
  121 + */
  122 + r = gpio_request_one(SDP3430_LCD_PANEL_BACKLIGHT_GPIO,
  123 + GPIOF_OUT_INIT_HIGH, "LCD Backlight");
122 124 if (r)
123   - printk(KERN_ERR "failed to get LCD control GPIOs\n");
  125 + pr_err("failed to get LCD Backlight GPIO\n");
124 126  
125 127 }
126 128  
127   -static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
128   -{
129   - gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
130   - gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
  129 +static struct panel_sharp_ls037v7dw01_data sdp3430_lcd_data = {
  130 + .resb_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO,
  131 + .ini_gpio = -1,
  132 + .mo_gpio = -1,
  133 + .lr_gpio = -1,
  134 + .ud_gpio = -1,
  135 +};
131 136  
132   - return 0;
133   -}
134   -
135   -static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
136   -{
137   - gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
138   - gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
139   -}
140   -
141   -static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
142   -{
143   - return 0;
144   -}
145   -
146   -static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
147   -{
148   -}
149   -
150   -
151 137 static struct omap_dss_device sdp3430_lcd_device = {
152 138 .name = "lcd",
153 139 .driver_name = "sharp_ls_panel",
154 140 .type = OMAP_DISPLAY_TYPE_DPI,
155 141 .phy.dpi.data_lines = 16,
156   - .platform_enable = sdp3430_panel_enable_lcd,
157   - .platform_disable = sdp3430_panel_disable_lcd,
  142 + .data = &sdp3430_lcd_data,
158 143 };
159 144  
160 145 static struct tfp410_platform_data dvi_panel = {
... ... @@ -175,8 +160,6 @@
175 160 .driver_name = "venc",
176 161 .type = OMAP_DISPLAY_TYPE_VENC,
177 162 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
178   - .platform_enable = sdp3430_panel_enable_tv,
179   - .platform_disable = sdp3430_panel_disable_tv,
180 163 };
181 164  
182 165  
arch/arm/mach-omap2/board-am3517evm.c
... ... @@ -35,8 +35,7 @@
35 35  
36 36 #include "common.h"
37 37 #include <video/omapdss.h>
38   -#include <video/omap-panel-generic-dpi.h>
39   -#include <video/omap-panel-tfp410.h>
  38 +#include <video/omap-panel-data.h>
40 39  
41 40 #include "am35xx-emac.h"
42 41 #include "mux.h"
43 42  
... ... @@ -121,63 +120,14 @@
121 120 return 0;
122 121 }
123 122  
124   -static int lcd_enabled;
125   -static int dvi_enabled;
126   -
127   -#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
128   - defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
129   -static struct gpio am3517_evm_dss_gpios[] __initdata = {
130   - /* GPIO 182 = LCD Backlight Power */
131   - { LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
132   - /* GPIO 181 = LCD Panel PWM */
133   - { LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
134   - /* GPIO 176 = LCD Panel Power enable pin */
135   - { LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, "dvi enable" },
136   -};
137   -
138   -static void __init am3517_evm_display_init(void)
139   -{
140   - int r;
141   -
142   - omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
143   - omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
144   - omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
145   -
146   - r = gpio_request_array(am3517_evm_dss_gpios,
147   - ARRAY_SIZE(am3517_evm_dss_gpios));
148   - if (r) {
149   - printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
150   - return;
151   - }
152   -
153   - printk(KERN_INFO "Display initialized successfully\n");
154   -}
155   -#else
156   -static void __init am3517_evm_display_init(void) {}
157   -#endif
158   -
159   -static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
160   -{
161   - if (dvi_enabled) {
162   - printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
163   - return -EINVAL;
164   - }
165   - gpio_set_value(LCD_PANEL_PWR, 1);
166   - lcd_enabled = 1;
167   -
168   - return 0;
169   -}
170   -
171   -static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
172   -{
173   - gpio_set_value(LCD_PANEL_PWR, 0);
174   - lcd_enabled = 0;
175   -}
176   -
177 123 static struct panel_generic_dpi_data lcd_panel = {
178 124 .name = "sharp_lq",
179   - .platform_enable = am3517_evm_panel_enable_lcd,
180   - .platform_disable = am3517_evm_panel_disable_lcd,
  125 + .num_gpios = 3,
  126 + .gpios = {
  127 + LCD_PANEL_PWR,
  128 + LCD_PANEL_BKLIGHT_PWR,
  129 + LCD_PANEL_PWM,
  130 + },
181 131 };
182 132  
183 133 static struct omap_dss_device am3517_evm_lcd_device = {
184 134  
... ... @@ -188,22 +138,11 @@
188 138 .phy.dpi.data_lines = 16,
189 139 };
190 140  
191   -static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
192   -{
193   - return 0;
194   -}
195   -
196   -static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
197   -{
198   -}
199   -
200 141 static struct omap_dss_device am3517_evm_tv_device = {
201 142 .type = OMAP_DISPLAY_TYPE_VENC,
202 143 .name = "tv",
203 144 .driver_name = "venc",
204 145 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
205   - .platform_enable = am3517_evm_panel_enable_tv,
206   - .platform_disable = am3517_evm_panel_disable_tv,
207 146 };
208 147  
209 148 static struct tfp410_platform_data dvi_panel = {
... ... @@ -363,8 +302,6 @@
363 302 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
364 303 usbhs_init(&usbhs_bdata);
365 304 am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
366   - /* DSS */
367   - am3517_evm_display_init();
368 305  
369 306 /* RTC - S35390A */
370 307 am3517_evm_rtc_init();
arch/arm/mach-omap2/board-cm-t35.c
... ... @@ -41,8 +41,7 @@
41 41  
42 42 #include <linux/platform_data/mtd-nand-omap2.h>
43 43 #include <video/omapdss.h>
44   -#include <video/omap-panel-generic-dpi.h>
45   -#include <video/omap-panel-tfp410.h>
  44 +#include <video/omap-panel-data.h>
46 45 #include <linux/platform_data/spi-omap2-mcspi.h>
47 46  
48 47 #include "common.h"
49 48  
... ... @@ -191,45 +190,12 @@
191 190 #define CM_T35_LCD_BL_GPIO 58
192 191 #define CM_T35_DVI_EN_GPIO 54
193 192  
194   -static int lcd_enabled;
195   -static int dvi_enabled;
196   -
197   -static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
198   -{
199   - if (dvi_enabled) {
200   - printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
201   - return -EINVAL;
202   - }
203   -
204   - gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
205   - gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
206   -
207   - lcd_enabled = 1;
208   -
209   - return 0;
210   -}
211   -
212   -static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
213   -{
214   - lcd_enabled = 0;
215   -
216   - gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
217   - gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
218   -}
219   -
220   -static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
221   -{
222   - return 0;
223   -}
224   -
225   -static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
226   -{
227   -}
228   -
229 193 static struct panel_generic_dpi_data lcd_panel = {
230 194 .name = "toppoly_tdo35s",
231   - .platform_enable = cm_t35_panel_enable_lcd,
232   - .platform_disable = cm_t35_panel_disable_lcd,
  195 + .num_gpios = 1,
  196 + .gpios = {
  197 + CM_T35_LCD_BL_GPIO,
  198 + },
233 199 };
234 200  
235 201 static struct omap_dss_device cm_t35_lcd_device = {
... ... @@ -258,8 +224,6 @@
258 224 .driver_name = "venc",
259 225 .type = OMAP_DISPLAY_TYPE_VENC,
260 226 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
261   - .platform_enable = cm_t35_panel_enable_tv,
262   - .platform_disable = cm_t35_panel_disable_tv,
263 227 };
264 228  
265 229 static struct omap_dss_device *cm_t35_dss_devices[] = {
... ... @@ -293,11 +257,6 @@
293 257 },
294 258 };
295 259  
296   -static struct gpio cm_t35_dss_gpios[] __initdata = {
297   - { CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
298   - { CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
299   -};
300   -
301 260 static void __init cm_t35_init_display(void)
302 261 {
303 262 int err;
304 263  
305 264  
306 265  
... ... @@ -305,23 +264,21 @@
305 264 spi_register_board_info(cm_t35_lcd_spi_board_info,
306 265 ARRAY_SIZE(cm_t35_lcd_spi_board_info));
307 266  
308   - err = gpio_request_array(cm_t35_dss_gpios,
309   - ARRAY_SIZE(cm_t35_dss_gpios));
  267 +
  268 + err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
  269 + "lcd bl enable");
310 270 if (err) {
311   - pr_err("CM-T35: failed to request DSS control GPIOs\n");
  271 + pr_err("CM-T35: failed to request LCD EN GPIO\n");
312 272 return;
313 273 }
314 274  
315   - gpio_export(CM_T35_LCD_EN_GPIO, 0);
316   - gpio_export(CM_T35_LCD_BL_GPIO, 0);
317   -
318 275 msleep(50);
319 276 gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
320 277  
321 278 err = omap_display_init(&cm_t35_dss_data);
322 279 if (err) {
323 280 pr_err("CM-T35: failed to register DSS device\n");
324   - gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios));
  281 + gpio_free(CM_T35_LCD_EN_GPIO);
325 282 }
326 283 }
327 284  
arch/arm/mach-omap2/board-devkit8000.c
... ... @@ -43,8 +43,7 @@
43 43 #include "gpmc.h"
44 44 #include <linux/platform_data/mtd-nand-omap2.h>
45 45 #include <video/omapdss.h>
46   -#include <video/omap-panel-generic-dpi.h>
47   -#include <video/omap-panel-tfp410.h>
  46 +#include <video/omap-panel-data.h>
48 47  
49 48 #include <linux/platform_data/spi-omap2-mcspi.h>
50 49 #include <linux/input/matrix_keypad.h>
... ... @@ -104,19 +103,6 @@
104 103 {} /* Terminator */
105 104 };
106 105  
107   -static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
108   -{
109   - if (gpio_is_valid(dssdev->reset_gpio))
110   - gpio_set_value_cansleep(dssdev->reset_gpio, 1);
111   - return 0;
112   -}
113   -
114   -static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
115   -{
116   - if (gpio_is_valid(dssdev->reset_gpio))
117   - gpio_set_value_cansleep(dssdev->reset_gpio, 0);
118   -}
119   -
120 106 static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
121 107 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
122 108 };
... ... @@ -128,8 +114,7 @@
128 114  
129 115 static struct panel_generic_dpi_data lcd_panel = {
130 116 .name = "innolux_at070tn83",
131   - .platform_enable = devkit8000_panel_enable_lcd,
132   - .platform_disable = devkit8000_panel_disable_lcd,
  117 + /* gpios filled in code */
133 118 };
134 119  
135 120 static struct omap_dss_device devkit8000_lcd_device = {
... ... @@ -211,8 +196,6 @@
211 196 static int devkit8000_twl_gpio_setup(struct device *dev,
212 197 unsigned gpio, unsigned ngpio)
213 198 {
214   - int ret;
215   -
216 199 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
217 200 mmc[0].gpio_cd = gpio + 0;
218 201 omap_hsmmc_late_init(mmc);
... ... @@ -221,13 +204,8 @@
221 204 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
222 205  
223 206 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
224   - devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
225   - ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
226   - GPIOF_OUT_INIT_LOW, "LCD_PWREN");
227   - if (ret < 0) {
228   - devkit8000_lcd_device.reset_gpio = -EINVAL;
229   - printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
230   - }
  207 + lcd_panel.num_gpios = 1;
  208 + lcd_panel.gpios[0] = gpio + TWL4030_GPIO_MAX + 0;
231 209  
232 210 /* gpio + 7 is "DVI_PD" (out, active low) */
233 211 dvi_panel.power_down_gpio = gpio + 7;
arch/arm/mach-omap2/board-h4.c
... ... @@ -34,7 +34,7 @@
34 34 #include <asm/mach/map.h>
35 35  
36 36 #include <video/omapdss.h>
37   -#include <video/omap-panel-generic-dpi.h>
  37 +#include <video/omap-panel-data.h>
38 38  
39 39 #include "common.h"
40 40 #include "mux.h"
arch/arm/mach-omap2/board-igep0020.c
... ... @@ -31,7 +31,7 @@
31 31 #include <asm/mach/arch.h>
32 32  
33 33 #include <video/omapdss.h>
34   -#include <video/omap-panel-tfp410.h>
  34 +#include <video/omap-panel-data.h>
35 35 #include <linux/platform_data/mtd-onenand-omap2.h>
36 36  
37 37 #include "common.h"
arch/arm/mach-omap2/board-ldp.c
... ... @@ -41,7 +41,7 @@
41 41 #include "gpmc-smsc911x.h"
42 42  
43 43 #include <video/omapdss.h>
44   -#include <video/omap-panel-generic-dpi.h>
  44 +#include <video/omap-panel-data.h>
45 45  
46 46 #include "board-flash.h"
47 47 #include "mux.h"
48 48  
49 49  
... ... @@ -181,34 +181,13 @@
181 181  
182 182 /* LCD */
183 183  
184   -static int ldp_backlight_gpio;
185   -static int ldp_lcd_enable_gpio;
186   -
187 184 #define LCD_PANEL_RESET_GPIO 55
188 185 #define LCD_PANEL_QVGA_GPIO 56
189 186  
190   -static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
191   -{
192   - if (gpio_is_valid(ldp_lcd_enable_gpio))
193   - gpio_direction_output(ldp_lcd_enable_gpio, 1);
194   - if (gpio_is_valid(ldp_backlight_gpio))
195   - gpio_direction_output(ldp_backlight_gpio, 1);
196   -
197   - return 0;
198   -}
199   -
200   -static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
201   -{
202   - if (gpio_is_valid(ldp_lcd_enable_gpio))
203   - gpio_direction_output(ldp_lcd_enable_gpio, 0);
204   - if (gpio_is_valid(ldp_backlight_gpio))
205   - gpio_direction_output(ldp_backlight_gpio, 0);
206   -}
207   -
208 187 static struct panel_generic_dpi_data ldp_panel_data = {
209 188 .name = "nec_nl2432dr22-11b",
210   - .platform_enable = ldp_panel_enable_lcd,
211   - .platform_disable = ldp_panel_disable_lcd,
  189 + .num_gpios = 4,
  190 + /* gpios filled in code */
212 191 };
213 192  
214 193 static struct omap_dss_device ldp_lcd_device = {
215 194  
216 195  
217 196  
... ... @@ -231,41 +210,19 @@
231 210  
232 211 static void __init ldp_display_init(void)
233 212 {
234   - int r;
  213 + ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO;
  214 + ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO;
235 215  
236   - static struct gpio gpios[] __initdata = {
237   - {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
238   - {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
239   - };
240   -
241   - r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
242   - if (r) {
243   - pr_err("Cannot request LCD GPIOs, error %d\n", r);
244   - return;
245   - }
246   -
247 216 omap_display_init(&ldp_dss_data);
248 217 }
249 218  
250 219 static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
251 220 {
252   - int r;
  221 + ldp_panel_data.gpios[0] = gpio + 7;
  222 + ldp_panel_data.gpio_invert[0] = true;
253 223  
254   - struct gpio gpios[] = {
255   - {gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
256   - {gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
257   - };
258   -
259   - r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
260   - if (r) {
261   - pr_err("Cannot request LCD GPIOs, error %d\n", r);
262   - ldp_backlight_gpio = -EINVAL;
263   - ldp_lcd_enable_gpio = -EINVAL;
264   - return r;
265   - }
266   -
267   - ldp_backlight_gpio = gpio + 15;
268   - ldp_lcd_enable_gpio = gpio + 7;
  224 + ldp_panel_data.gpios[1] = gpio + 15;
  225 + ldp_panel_data.gpio_invert[1] = true;
269 226  
270 227 return 0;
271 228 }
arch/arm/mach-omap2/board-omap3beagle.c
... ... @@ -43,7 +43,7 @@
43 43 #include <asm/mach/flash.h>
44 44  
45 45 #include <video/omapdss.h>
46   -#include <video/omap-panel-tfp410.h>
  46 +#include <video/omap-panel-data.h>
47 47 #include <linux/platform_data/mtd-nand-omap2.h>
48 48  
49 49 #include "common.h"
arch/arm/mach-omap2/board-omap3evm.c
... ... @@ -51,7 +51,7 @@
51 51 #include "common.h"
52 52 #include <linux/platform_data/spi-omap2-mcspi.h>
53 53 #include <video/omapdss.h>
54   -#include <video/omap-panel-tfp410.h>
  54 +#include <video/omap-panel-data.h>
55 55  
56 56 #include "soc.h"
57 57 #include "mux.h"
58 58  
59 59  
60 60  
61 61  
62 62  
63 63  
64 64  
65 65  
66 66  
67 67  
68 68  
69 69  
... ... @@ -155,88 +155,58 @@
155 155 #define OMAP3EVM_LCD_PANEL_LR 2
156 156 #define OMAP3EVM_LCD_PANEL_UD 3
157 157 #define OMAP3EVM_LCD_PANEL_INI 152
158   -#define OMAP3EVM_LCD_PANEL_ENVDD 153
159 158 #define OMAP3EVM_LCD_PANEL_QVGA 154
160 159 #define OMAP3EVM_LCD_PANEL_RESB 155
  160 +
  161 +#define OMAP3EVM_LCD_PANEL_ENVDD 153
161 162 #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
  163 +
  164 +/*
  165 + * OMAP3EVM DVI control signals
  166 + */
162 167 #define OMAP3EVM_DVI_PANEL_EN_GPIO 199
163 168  
164   -static struct gpio omap3_evm_dss_gpios[] __initdata = {
165   - { OMAP3EVM_LCD_PANEL_RESB, GPIOF_OUT_INIT_HIGH, "lcd_panel_resb" },
166   - { OMAP3EVM_LCD_PANEL_INI, GPIOF_OUT_INIT_HIGH, "lcd_panel_ini" },
167   - { OMAP3EVM_LCD_PANEL_QVGA, GPIOF_OUT_INIT_LOW, "lcd_panel_qvga" },
168   - { OMAP3EVM_LCD_PANEL_LR, GPIOF_OUT_INIT_HIGH, "lcd_panel_lr" },
169   - { OMAP3EVM_LCD_PANEL_UD, GPIOF_OUT_INIT_HIGH, "lcd_panel_ud" },
170   - { OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, "lcd_panel_envdd" },
  169 +static struct panel_sharp_ls037v7dw01_data omap3_evm_lcd_data = {
  170 + .resb_gpio = OMAP3EVM_LCD_PANEL_RESB,
  171 + .ini_gpio = OMAP3EVM_LCD_PANEL_INI,
  172 + .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA,
  173 + .lr_gpio = OMAP3EVM_LCD_PANEL_LR,
  174 + .ud_gpio = OMAP3EVM_LCD_PANEL_UD,
171 175 };
172 176  
173   -static int lcd_enabled;
174   -static int dvi_enabled;
175   -
176 177 static void __init omap3_evm_display_init(void)
177 178 {
178 179 int r;
179 180  
180   - r = gpio_request_array(omap3_evm_dss_gpios,
181   - ARRAY_SIZE(omap3_evm_dss_gpios));
  181 + r = gpio_request_one(OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW,
  182 + "lcd_panel_envdd");
182 183 if (r)
183   - printk(KERN_ERR "failed to get lcd_panel_* gpios\n");
184   -}
  184 + pr_err("failed to get lcd_panel_envdd GPIO\n");
185 185  
186   -static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
187   -{
188   - if (dvi_enabled) {
189   - printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
190   - return -EINVAL;
191   - }
192   - gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
  186 + r = gpio_request_one(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO,
  187 + GPIOF_OUT_INIT_LOW, "lcd_panel_bklight");
  188 + if (r)
  189 + pr_err("failed to get lcd_panel_bklight GPIO\n");
193 190  
194 191 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
195 192 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
196 193 else
197 194 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
198   -
199   - lcd_enabled = 1;
200   - return 0;
201 195 }
202 196  
203   -static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
204   -{
205   - gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
206   -
207   - if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
208   - gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
209   - else
210   - gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
211   -
212   - lcd_enabled = 0;
213   -}
214   -
215 197 static struct omap_dss_device omap3_evm_lcd_device = {
216 198 .name = "lcd",
217 199 .driver_name = "sharp_ls_panel",
218 200 .type = OMAP_DISPLAY_TYPE_DPI,
219 201 .phy.dpi.data_lines = 18,
220   - .platform_enable = omap3_evm_enable_lcd,
221   - .platform_disable = omap3_evm_disable_lcd,
  202 + .data = &omap3_evm_lcd_data,
222 203 };
223 204  
224   -static int omap3_evm_enable_tv(struct omap_dss_device *dssdev)
225   -{
226   - return 0;
227   -}
228   -
229   -static void omap3_evm_disable_tv(struct omap_dss_device *dssdev)
230   -{
231   -}
232   -
233 205 static struct omap_dss_device omap3_evm_tv_device = {
234 206 .name = "tv",
235 207 .driver_name = "venc",
236 208 .type = OMAP_DISPLAY_TYPE_VENC,
237 209 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
238   - .platform_enable = omap3_evm_enable_tv,
239   - .platform_disable = omap3_evm_disable_tv,
240 210 };
241 211  
242 212 static struct tfp410_platform_data dvi_panel = {
arch/arm/mach-omap2/board-omap3pandora.c
... ... @@ -44,6 +44,7 @@
44 44  
45 45 #include "common.h"
46 46 #include <video/omapdss.h>
  47 +#include <video/omap-panel-data.h>
47 48 #include <linux/platform_data/mtd-nand-omap2.h>
48 49  
49 50 #include "mux.h"
50 51  
... ... @@ -230,12 +231,16 @@
230 231 .rep = 1,
231 232 };
232 233  
  234 +static struct panel_tpo_td043_data lcd_data = {
  235 + .nreset_gpio = 157,
  236 +};
  237 +
233 238 static struct omap_dss_device pandora_lcd_device = {
234 239 .name = "lcd",
235 240 .driver_name = "tpo_td043mtea1_panel",
236 241 .type = OMAP_DISPLAY_TYPE_DPI,
237 242 .phy.dpi.data_lines = 24,
238   - .reset_gpio = 157,
  243 + .data = &lcd_data,
239 244 };
240 245  
241 246 static struct omap_dss_device pandora_tv_device = {
arch/arm/mach-omap2/board-omap3stalker.c
... ... @@ -44,8 +44,7 @@
44 44 #include "gpmc.h"
45 45 #include <linux/platform_data/mtd-nand-omap2.h>
46 46 #include <video/omapdss.h>
47   -#include <video/omap-panel-generic-dpi.h>
48   -#include <video/omap-panel-tfp410.h>
  47 +#include <video/omap-panel-data.h>
49 48  
50 49 #include <linux/platform_data/spi-omap2-mcspi.h>
51 50  
... ... @@ -95,15 +94,6 @@
95 94 return;
96 95 }
97 96  
98   -static int omap3_stalker_enable_tv(struct omap_dss_device *dssdev)
99   -{
100   - return 0;
101   -}
102   -
103   -static void omap3_stalker_disable_tv(struct omap_dss_device *dssdev)
104   -{
105   -}
106   -
107 97 static struct omap_dss_device omap3_stalker_tv_device = {
108 98 .name = "tv",
109 99 .driver_name = "venc",
... ... @@ -113,8 +103,6 @@
113 103 #elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE)
114 104 .u.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
115 105 #endif
116   - .platform_enable = omap3_stalker_enable_tv,
117   - .platform_disable = omap3_stalker_disable_tv,
118 106 };
119 107  
120 108 static struct tfp410_platform_data dvi_panel = {
arch/arm/mach-omap2/board-overo.c
... ... @@ -47,8 +47,7 @@
47 47 #include <asm/mach/map.h>
48 48  
49 49 #include <video/omapdss.h>
50   -#include <video/omap-panel-generic-dpi.h>
51   -#include <video/omap-panel-tfp410.h>
  50 +#include <video/omap-panel-data.h>
52 51  
53 52 #include "common.h"
54 53 #include "mux.h"
55 54  
... ... @@ -146,28 +145,9 @@
146 145 #endif
147 146  
148 147 /* DSS */
149   -static int lcd_enabled;
150   -static int dvi_enabled;
151   -
152 148 #define OVERO_GPIO_LCD_EN 144
153 149 #define OVERO_GPIO_LCD_BL 145
154 150  
155   -static struct gpio overo_dss_gpios[] __initdata = {
156   - { OVERO_GPIO_LCD_EN, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_EN" },
157   - { OVERO_GPIO_LCD_BL, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_BL" },
158   -};
159   -
160   -static void __init overo_display_init(void)
161   -{
162   - if (gpio_request_array(overo_dss_gpios, ARRAY_SIZE(overo_dss_gpios))) {
163   - printk(KERN_ERR "could not obtain DSS control GPIOs\n");
164   - return;
165   - }
166   -
167   - gpio_export(OVERO_GPIO_LCD_EN, 0);
168   - gpio_export(OVERO_GPIO_LCD_BL, 0);
169   -}
170   -
171 151 static struct tfp410_platform_data dvi_panel = {
172 152 .i2c_bus_num = 3,
173 153 .power_down_gpio = -1,
174 154  
... ... @@ -188,30 +168,13 @@
188 168 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
189 169 };
190 170  
191   -static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
192   -{
193   - if (dvi_enabled) {
194   - printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
195   - return -EINVAL;
196   - }
197   -
198   - gpio_set_value(OVERO_GPIO_LCD_EN, 1);
199   - gpio_set_value(OVERO_GPIO_LCD_BL, 1);
200   - lcd_enabled = 1;
201   - return 0;
202   -}
203   -
204   -static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
205   -{
206   - gpio_set_value(OVERO_GPIO_LCD_EN, 0);
207   - gpio_set_value(OVERO_GPIO_LCD_BL, 0);
208   - lcd_enabled = 0;
209   -}
210   -
211 171 static struct panel_generic_dpi_data lcd43_panel = {
212 172 .name = "samsung_lte430wq_f0c",
213   - .platform_enable = overo_panel_enable_lcd,
214   - .platform_disable = overo_panel_disable_lcd,
  173 + .num_gpios = 2,
  174 + .gpios = {
  175 + OVERO_GPIO_LCD_EN,
  176 + OVERO_GPIO_LCD_BL
  177 + },
215 178 };
216 179  
217 180 static struct omap_dss_device overo_lcd43_device = {
218 181  
... ... @@ -224,13 +187,20 @@
224 187  
225 188 #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
226 189 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
  190 +static struct panel_generic_dpi_data lcd35_panel = {
  191 + .num_gpios = 2,
  192 + .gpios = {
  193 + OVERO_GPIO_LCD_EN,
  194 + OVERO_GPIO_LCD_BL
  195 + },
  196 +};
  197 +
227 198 static struct omap_dss_device overo_lcd35_device = {
228 199 .type = OMAP_DISPLAY_TYPE_DPI,
229 200 .name = "lcd35",
230 201 .driver_name = "lgphilips_lb035q02_panel",
231 202 .phy.dpi.data_lines = 24,
232   - .platform_enable = overo_panel_enable_lcd,
233   - .platform_disable = overo_panel_disable_lcd,
  203 + .data = &lcd35_panel,
234 204 };
235 205 #endif
236 206  
... ... @@ -505,7 +475,6 @@
505 475 usbhs_init(&usbhs_bdata);
506 476 overo_spi_init();
507 477 overo_init_smsc911x();
508   - overo_display_init();
509 478 overo_init_led();
510 479 overo_init_keys();
511 480 omap_twl4030_audio_init("overo", NULL);
arch/arm/mach-omap2/board-rx51-video.c
... ... @@ -16,6 +16,8 @@
16 16 #include <linux/mm.h>
17 17 #include <asm/mach-types.h>
18 18 #include <video/omapdss.h>
  19 +#include <video/omap-panel-data.h>
  20 +
19 21 #include <linux/platform_data/spi-omap2-mcspi.h>
20 22  
21 23 #include "soc.h"
22 24  
23 25  
... ... @@ -27,25 +29,16 @@
27 29  
28 30 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
29 31  
30   -static int rx51_lcd_enable(struct omap_dss_device *dssdev)
31   -{
32   - gpio_set_value(dssdev->reset_gpio, 1);
33   - return 0;
34   -}
  32 +static struct panel_acx565akm_data lcd_data = {
  33 + .reset_gpio = RX51_LCD_RESET_GPIO,
  34 +};
35 35  
36   -static void rx51_lcd_disable(struct omap_dss_device *dssdev)
37   -{
38   - gpio_set_value(dssdev->reset_gpio, 0);
39   -}
40   -
41 36 static struct omap_dss_device rx51_lcd_device = {
42 37 .name = "lcd",
43 38 .driver_name = "panel-acx565akm",
44 39 .type = OMAP_DISPLAY_TYPE_SDI,
45 40 .phy.sdi.datapairs = 2,
46   - .reset_gpio = RX51_LCD_RESET_GPIO,
47   - .platform_enable = rx51_lcd_enable,
48   - .platform_disable = rx51_lcd_disable,
  41 + .data = &lcd_data,
49 42 };
50 43  
51 44 static struct omap_dss_device rx51_tv_device = {
52 45  
... ... @@ -76,13 +69,8 @@
76 69 return 0;
77 70 }
78 71  
79   - if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
80   - "LCD ACX565AKM reset")) {
81   - pr_err("%s failed to get LCD Reset GPIO\n", __func__);
82   - return 0;
83   - }
84   -
85 72 omap_display_init(&rx51_dss_board_info);
  73 +
86 74 return 0;
87 75 }
88 76  
arch/arm/mach-omap2/board-zoom-display.c
... ... @@ -15,8 +15,9 @@
15 15 #include <linux/spi/spi.h>
16 16 #include <linux/platform_data/spi-omap2-mcspi.h>
17 17 #include <video/omapdss.h>
18   -#include "board-zoom.h"
  18 +#include <video/omap-panel-data.h>
19 19  
  20 +#include "board-zoom.h"
20 21 #include "soc.h"
21 22 #include "common.h"
22 23  
23 24  
24 25  
... ... @@ -24,37 +25,17 @@
24 25 #define LCD_PANEL_RESET_GPIO_PILOT 55
25 26 #define LCD_PANEL_QVGA_GPIO 56
26 27  
27   -static struct gpio zoom_lcd_gpios[] __initdata = {
28   - { -EINVAL, GPIOF_OUT_INIT_HIGH, "lcd reset" },
29   - { LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "lcd qvga" },
  28 +static struct panel_nec_nl8048_data zoom_lcd_data = {
  29 + /* res_gpio filled in code */
  30 + .qvga_gpio = LCD_PANEL_QVGA_GPIO,
30 31 };
31 32  
32   -static void __init zoom_lcd_panel_init(void)
33   -{
34   - zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
35   - LCD_PANEL_RESET_GPIO_PROD :
36   - LCD_PANEL_RESET_GPIO_PILOT;
37   -
38   - if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
39   - pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
40   -}
41   -
42   -static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
43   -{
44   - return 0;
45   -}
46   -
47   -static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
48   -{
49   -}
50   -
51 33 static struct omap_dss_device zoom_lcd_device = {
52 34 .name = "lcd",
53 35 .driver_name = "NEC_8048_panel",
54 36 .type = OMAP_DISPLAY_TYPE_DPI,
55 37 .phy.dpi.data_lines = 24,
56   - .platform_enable = zoom_panel_enable_lcd,
57   - .platform_disable = zoom_panel_disable_lcd,
  38 + .data = &zoom_lcd_data,
58 39 };
59 40  
60 41 static struct omap_dss_device *zoom_dss_devices[] = {
... ... @@ -66,6 +47,13 @@
66 47 .devices = zoom_dss_devices,
67 48 .default_device = &zoom_lcd_device,
68 49 };
  50 +
  51 +static void __init zoom_lcd_panel_init(void)
  52 +{
  53 + zoom_lcd_data.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
  54 + LCD_PANEL_RESET_GPIO_PROD :
  55 + LCD_PANEL_RESET_GPIO_PILOT;
  56 +}
69 57  
70 58 static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
71 59 .turbo_mode = 1,
arch/arm/mach-omap2/dss-common.c
... ... @@ -27,9 +27,7 @@
27 27 #include <linux/gpio.h>
28 28  
29 29 #include <video/omapdss.h>
30   -#include <video/omap-panel-tfp410.h>
31   -#include <video/omap-panel-nokia-dsi.h>
32   -#include <video/omap-panel-picodlp.h>
  30 +#include <video/omap-panel-data.h>
33 31  
34 32 #include "soc.h"
35 33 #include "dss-common.h"
... ... @@ -54,7 +52,6 @@
54 52 .driver_name = "tfp410",
55 53 .data = &omap4_dvi_panel,
56 54 .phy.dpi.data_lines = 24,
57   - .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
58 55 .channel = OMAP_DSS_CHANNEL_LCD2,
59 56 };
60 57  
61 58  
... ... @@ -179,45 +176,12 @@
179 176 .pwrgood_gpio = 45,
180 177 };
181 178  
182   -static void sdp4430_picodlp_init(void)
183   -{
184   - int r;
185   - const struct gpio picodlp_gpios[] = {
186   - {DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
187   - "DLP POWER ON"},
188   - {sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
189   - "DLP EMU DONE"},
190   - {sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
191   - "DLP PWRGOOD"},
192   - };
193   -
194   - r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
195   - if (r)
196   - pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
197   -}
198   -
199   -static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
200   -{
201   - gpio_set_value(DISPLAY_SEL_GPIO, 0);
202   - gpio_set_value(DLP_POWER_ON_GPIO, 1);
203   -
204   - return 0;
205   -}
206   -
207   -static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
208   -{
209   - gpio_set_value(DLP_POWER_ON_GPIO, 0);
210   - gpio_set_value(DISPLAY_SEL_GPIO, 1);
211   -}
212   -
213 179 static struct omap_dss_device sdp4430_picodlp_device = {
214 180 .name = "picodlp",
215 181 .driver_name = "picodlp_panel",
216 182 .type = OMAP_DISPLAY_TYPE_DPI,
217 183 .phy.dpi.data_lines = 24,
218 184 .channel = OMAP_DSS_CHANNEL_LCD2,
219   - .platform_enable = sdp4430_panel_enable_picodlp,
220   - .platform_disable = sdp4430_panel_disable_picodlp,
221 185 .data = &sdp4430_picodlp_pdata,
222 186 };
223 187  
224 188  
225 189  
... ... @@ -234,17 +198,26 @@
234 198 .default_device = &sdp4430_lcd_device,
235 199 };
236 200  
  201 +/*
  202 + * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
  203 + * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
  204 + * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
  205 + * selected by default
  206 + */
237 207 void __init omap_4430sdp_display_init(void)
238 208 {
239 209 int r;
240 210  
241   - /* Enable LCD2 by default (instead of Pico DLP) */
242 211 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
243 212 "display_sel");
244 213 if (r)
245 214 pr_err("%s: Could not get display_sel GPIO\n", __func__);
246 215  
247   - sdp4430_picodlp_init();
  216 + r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
  217 + "DLP POWER ON");
  218 + if (r)
  219 + pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
  220 +
248 221 omap_display_init(&sdp4430_dss_data);
249 222 /*
250 223 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
251 224  
... ... @@ -264,13 +237,16 @@
264 237 {
265 238 int r;
266 239  
267   - /* Enable LCD2 by default (instead of Pico DLP) */
268 240 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
269 241 "display_sel");
270 242 if (r)
271 243 pr_err("%s: Could not get display_sel GPIO\n", __func__);
272 244  
273   - sdp4430_picodlp_init();
  245 + r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
  246 + "DLP POWER ON");
  247 + if (r)
  248 + pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
  249 +
274 250 omap_display_init(&sdp4430_dss_data);
275 251 }
drivers/video/omap2/displays/panel-generic-dpi.c
... ... @@ -35,7 +35,7 @@
35 35 #include <linux/slab.h>
36 36 #include <video/omapdss.h>
37 37  
38   -#include <video/omap-panel-generic-dpi.h>
  38 +#include <video/omap-panel-data.h>
39 39  
40 40 struct panel_config {
41 41 struct omap_video_timings timings;
drivers/video/omap2/displays/panel-n8x0.c
... ... @@ -9,7 +9,7 @@
9 9 #include <linux/fb.h>
10 10  
11 11 #include <video/omapdss.h>
12   -#include <video/omap-panel-n8x0.h>
  12 +#include <video/omap-panel-data.h>
13 13  
14 14 #define BLIZZARD_REV_CODE 0x00
15 15 #define BLIZZARD_CONFIG 0x02
drivers/video/omap2/displays/panel-picodlp.c
... ... @@ -31,7 +31,7 @@
31 31 #include <linux/gpio.h>
32 32  
33 33 #include <video/omapdss.h>
34   -#include <video/omap-panel-picodlp.h>
  34 +#include <video/omap-panel-data.h>
35 35  
36 36 #include "panel-picodlp.h"
37 37  
drivers/video/omap2/displays/panel-taal.c
... ... @@ -33,7 +33,7 @@
33 33 #include <linux/mutex.h>
34 34  
35 35 #include <video/omapdss.h>
36   -#include <video/omap-panel-nokia-dsi.h>
  36 +#include <video/omap-panel-data.h>
37 37 #include <video/mipi_display.h>
38 38  
39 39 /* DSI Virtual channel. Hardcoded for now. */
drivers/video/omap2/displays/panel-tfp410.c
... ... @@ -24,7 +24,7 @@
24 24 #include <linux/gpio.h>
25 25 #include <drm/drm_edid.h>
26 26  
27   -#include <video/omap-panel-tfp410.h>
  27 +#include <video/omap-panel-data.h>
28 28  
29 29 static const struct omap_video_timings tfp410_default_timings = {
30 30 .x_res = 640,
include/video/omap-panel-data.h
  1 +/*
  2 + * Header containing platform_data structs for omap panels
  3 + *
  4 + * Copyright (C) 2013 Texas Instruments
  5 + * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
  6 + * Archit Taneja <archit@ti.com>
  7 + *
  8 + * Copyright (C) 2011 Texas Instruments
  9 + * Author: Mayuresh Janorkar <mayur@ti.com>
  10 + *
  11 + * Copyright (C) 2010 Canonical Ltd.
  12 + * Author: Bryan Wu <bryan.wu@canonical.com>
  13 + *
  14 + * This program is free software; you can redistribute it and/or modify it
  15 + * under the terms of the GNU General Public License version 2 as published by
  16 + * the Free Software Foundation.
  17 + *
  18 + * This program is distributed in the hope that it will be useful, but WITHOUT
  19 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  20 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  21 + * more details.
  22 + *
  23 + * You should have received a copy of the GNU General Public License along with
  24 + * this program. If not, see <http://www.gnu.org/licenses/>.
  25 + */
  26 +
  27 +#ifndef __OMAP_PANEL_DATA_H
  28 +#define __OMAP_PANEL_DATA_H
  29 +
  30 +struct omap_dss_device;
  31 +
  32 +/**
  33 + * struct panel_generic_dpi_data - panel driver configuration data
  34 + * @name: panel name
  35 + * @platform_enable: platform specific panel enable function
  36 + * @platform_disable: platform specific panel disable function
  37 + * @num_gpios: number of gpios connected to panel
  38 + * @gpios: gpio numbers on the platform
  39 + * @gpio_invert: configure gpio as active high or low
  40 + */
  41 +struct panel_generic_dpi_data {
  42 + const char *name;
  43 + int (*platform_enable)(struct omap_dss_device *dssdev);
  44 + void (*platform_disable)(struct omap_dss_device *dssdev);
  45 +
  46 + int num_gpios;
  47 + int gpios[10];
  48 + bool gpio_invert[10];
  49 +};
  50 +
  51 +/**
  52 + * struct panel_n8x0_data - N800 panel driver configuration data
  53 + */
  54 +struct panel_n8x0_data {
  55 + int (*platform_enable)(struct omap_dss_device *dssdev);
  56 + void (*platform_disable)(struct omap_dss_device *dssdev);
  57 + int panel_reset;
  58 + int ctrl_pwrdown;
  59 +
  60 + int (*set_backlight)(struct omap_dss_device *dssdev, int level);
  61 +};
  62 +
  63 +/**
  64 + * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration data
  65 + * @name: panel name
  66 + * @use_ext_te: use external TE
  67 + * @ext_te_gpio: external TE GPIO
  68 + * @esd_interval: interval of ESD checks, 0 = disabled (ms)
  69 + * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
  70 + * @use_dsi_backlight: true if panel uses DSI command to control backlight
  71 + * @pin_config: DSI pin configuration
  72 + */
  73 +
  74 +struct nokia_dsi_panel_data {
  75 + const char *name;
  76 +
  77 + int reset_gpio;
  78 +
  79 + bool use_ext_te;
  80 + int ext_te_gpio;
  81 +
  82 + unsigned esd_interval;
  83 + unsigned ulps_timeout;
  84 +
  85 + bool use_dsi_backlight;
  86 +
  87 + struct omap_dsi_pin_config pin_config;
  88 +};
  89 +
  90 +/**
  91 + * struct picodlp_panel_data - picodlp panel driver configuration data
  92 + * @picodlp_adapter_id: i2c_adapter number for picodlp
  93 + */
  94 +struct picodlp_panel_data {
  95 + int picodlp_adapter_id;
  96 + int emu_done_gpio;
  97 + int pwrgood_gpio;
  98 +};
  99 +
  100 +/**
  101 + * struct tfp410_platform_data - tfp410 panel driver configuration data
  102 + * @i2c_bus_num: i2c bus id for the panel
  103 + * @power_down_gpio: gpio number for PD pin (or -1 if not available)
  104 + */
  105 +struct tfp410_platform_data {
  106 + int i2c_bus_num;
  107 + int power_down_gpio;
  108 +};
  109 +
  110 +/**
  111 + * sharp ls panel driver configuration data
  112 + * @resb_gpio: reset signal
  113 + * @ini_gpio: power on control
  114 + * @mo_gpio: selection for resolution(VGA/QVGA)
  115 + * @lr_gpio: selection for horizontal scanning direction
  116 + * @ud_gpio: selection for vertical scanning direction
  117 + */
  118 +struct panel_sharp_ls037v7dw01_data {
  119 + int resb_gpio;
  120 + int ini_gpio;
  121 + int mo_gpio;
  122 + int lr_gpio;
  123 + int ud_gpio;
  124 +};
  125 +
  126 +/**
  127 + * acx565akm panel driver configuration data
  128 + * @reset_gpio: reset signal
  129 + */
  130 +struct panel_acx565akm_data {
  131 + int reset_gpio;
  132 +};
  133 +
  134 +/**
  135 + * nec nl8048 panel driver configuration data
  136 + * @res_gpio: reset signal
  137 + * @qvga_gpio: selection for resolution(QVGA/WVGA)
  138 + */
  139 +struct panel_nec_nl8048_data {
  140 + int res_gpio;
  141 + int qvga_gpio;
  142 +};
  143 +
  144 +/**
  145 + * tpo td043 panel driver configuration data
  146 + * @nreset_gpio: reset signal
  147 + */
  148 +struct panel_tpo_td043_data {
  149 + int nreset_gpio;
  150 +};
  151 +
  152 +#endif /* __OMAP_PANEL_DATA_H */
include/video/omap-panel-generic-dpi.h
1   -/*
2   - * Header for generic DPI panel driver
3   - *
4   - * Copyright (C) 2010 Canonical Ltd.
5   - * Author: Bryan Wu <bryan.wu@canonical.com>
6   - *
7   - * This program is free software; you can redistribute it and/or modify it
8   - * under the terms of the GNU General Public License version 2 as published by
9   - * the Free Software Foundation.
10   - *
11   - * This program is distributed in the hope that it will be useful, but WITHOUT
12   - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14   - * more details.
15   - *
16   - * You should have received a copy of the GNU General Public License along with
17   - * this program. If not, see <http://www.gnu.org/licenses/>.
18   - */
19   -
20   -#ifndef __OMAP_PANEL_GENERIC_DPI_H
21   -#define __OMAP_PANEL_GENERIC_DPI_H
22   -
23   -struct omap_dss_device;
24   -
25   -/**
26   - * struct panel_generic_dpi_data - panel driver configuration data
27   - * @name: panel name
28   - * @platform_enable: platform specific panel enable function
29   - * @platform_disable: platform specific panel disable function
30   - */
31   -struct panel_generic_dpi_data {
32   - const char *name;
33   - int (*platform_enable)(struct omap_dss_device *dssdev);
34   - void (*platform_disable)(struct omap_dss_device *dssdev);
35   -};
36   -
37   -#endif /* __OMAP_PANEL_GENERIC_DPI_H */
include/video/omap-panel-n8x0.h
1   -#ifndef __OMAP_PANEL_N8X0_H
2   -#define __OMAP_PANEL_N8X0_H
3   -
4   -struct omap_dss_device;
5   -
6   -struct panel_n8x0_data {
7   - int (*platform_enable)(struct omap_dss_device *dssdev);
8   - void (*platform_disable)(struct omap_dss_device *dssdev);
9   - int panel_reset;
10   - int ctrl_pwrdown;
11   -
12   - int (*set_backlight)(struct omap_dss_device *dssdev, int level);
13   -};
14   -
15   -#endif
include/video/omap-panel-nokia-dsi.h
1   -#ifndef __OMAP_NOKIA_DSI_PANEL_H
2   -#define __OMAP_NOKIA_DSI_PANEL_H
3   -
4   -struct omap_dss_device;
5   -
6   -/**
7   - * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration
8   - * @name: panel name
9   - * @use_ext_te: use external TE
10   - * @ext_te_gpio: external TE GPIO
11   - * @esd_interval: interval of ESD checks, 0 = disabled (ms)
12   - * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
13   - * @use_dsi_backlight: true if panel uses DSI command to control backlight
14   - * @pin_config: DSI pin configuration
15   - */
16   -struct nokia_dsi_panel_data {
17   - const char *name;
18   -
19   - int reset_gpio;
20   -
21   - bool use_ext_te;
22   - int ext_te_gpio;
23   -
24   - unsigned esd_interval;
25   - unsigned ulps_timeout;
26   -
27   - bool use_dsi_backlight;
28   -
29   - struct omap_dsi_pin_config pin_config;
30   -};
31   -
32   -#endif /* __OMAP_NOKIA_DSI_PANEL_H */
include/video/omap-panel-picodlp.h
1   -/*
2   - * panel data for picodlp panel
3   - *
4   - * Copyright (C) 2011 Texas Instruments
5   - *
6   - * Author: Mayuresh Janorkar <mayur@ti.com>
7   - *
8   - * This program is free software; you can redistribute it and/or modify
9   - * it under the terms of the GNU General Public License version 2 as
10   - * published by the Free Software Foundation.
11   - */
12   -#ifndef __PANEL_PICODLP_H
13   -#define __PANEL_PICODLP_H
14   -/**
15   - * struct : picodlp panel data
16   - * picodlp_adapter_id: i2c_adapter number for picodlp
17   - */
18   -struct picodlp_panel_data {
19   - int picodlp_adapter_id;
20   - int emu_done_gpio;
21   - int pwrgood_gpio;
22   -};
23   -#endif /* __PANEL_PICODLP_H */
include/video/omap-panel-tfp410.h
1   -/*
2   - * Header for TFP410 chip driver
3   - *
4   - * Copyright (C) 2011 Texas Instruments Inc
5   - * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
6   - *
7   - * This program is free software; you can redistribute it and/or modify it
8   - * under the terms of the GNU General Public License version 2 as published by
9   - * the Free Software Foundation.
10   - *
11   - * This program is distributed in the hope that it will be useful, but WITHOUT
12   - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14   - * more details.
15   - *
16   - * You should have received a copy of the GNU General Public License along with
17   - * this program. If not, see <http://www.gnu.org/licenses/>.
18   - */
19   -
20   -#ifndef __OMAP_PANEL_TFP410_H
21   -#define __OMAP_PANEL_TFP410_H
22   -
23   -struct omap_dss_device;
24   -
25   -/**
26   - * struct tfp410_platform_data - panel driver configuration data
27   - * @i2c_bus_num: i2c bus id for the panel
28   - * @power_down_gpio: gpio number for PD pin (or -1 if not available)
29   - */
30   -struct tfp410_platform_data {
31   - int i2c_bus_num;
32   - int power_down_gpio;
33   -};
34   -
35   -#endif /* __OMAP_PANEL_TFP410_H */