aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-ldp.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-05-31 04:38:50 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-28 03:23:20 -0400
commitf23248d4b751edc60f5982be142aca671793d08d (patch)
tree2bb254324607fedda3e3beb28877357fb60de4ee /arch/arm/mach-omap2/board-ldp.c
parent09bc6ff2d7c2c64b5ef16a72248c0ecd43adb67d (diff)
ARM: OMAP: LDP: use new display drivers
Use new display drivers for LDP board. The new OMAP display drivers were merged for 3.11, and we can now change the board files to use the new ones and phase out the old ones. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-ldp.c')
-rw-r--r--arch/arm/mach-omap2/board-ldp.c68
1 files changed, 47 insertions, 21 deletions
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 62e4f701b63b..dd8da2c5399f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -184,45 +184,70 @@ static inline void __init ldp_init_smsc911x(void)
184#define LCD_PANEL_RESET_GPIO 55 184#define LCD_PANEL_RESET_GPIO 55
185#define LCD_PANEL_QVGA_GPIO 56 185#define LCD_PANEL_QVGA_GPIO 56
186 186
187static struct panel_generic_dpi_data ldp_panel_data = { 187static const struct display_timing ldp_lcd_videomode = {
188 .name = "nec_nl2432dr22-11b", 188 .pixelclock = { 0, 5400000, 0 },
189 .num_gpios = 4, 189
190 /* gpios filled in code */ 190 .hactive = { 0, 240, 0 },
191 .hfront_porch = { 0, 3, 0 },
192 .hback_porch = { 0, 39, 0 },
193 .hsync_len = { 0, 3, 0 },
194
195 .vactive = { 0, 320, 0 },
196 .vfront_porch = { 0, 2, 0 },
197 .vback_porch = { 0, 7, 0 },
198 .vsync_len = { 0, 1, 0 },
199
200 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
201 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
191}; 202};
192 203
193static struct omap_dss_device ldp_lcd_device = { 204static struct panel_dpi_platform_data ldp_lcd_pdata = {
194 .name = "lcd", 205 .name = "lcd",
195 .driver_name = "generic_dpi_panel", 206 .source = "dpi.0",
196 .type = OMAP_DISPLAY_TYPE_DPI, 207
197 .phy.dpi.data_lines = 18, 208 .data_lines = 18,
198 .data = &ldp_panel_data, 209
210 .display_timing = &ldp_lcd_videomode,
211
212 .enable_gpio = -1, /* filled in code */
213 .backlight_gpio = -1, /* filled in code */
199}; 214};
200 215
201static struct omap_dss_device *ldp_dss_devices[] = { 216static struct platform_device ldp_lcd_device = {
202 &ldp_lcd_device, 217 .name = "panel-dpi",
218 .id = 0,
219 .dev.platform_data = &ldp_lcd_pdata,
203}; 220};
204 221
205static struct omap_dss_board_info ldp_dss_data = { 222static struct omap_dss_board_info ldp_dss_data = {
206 .num_devices = ARRAY_SIZE(ldp_dss_devices), 223 .default_display_name = "lcd",
207 .devices = ldp_dss_devices,
208 .default_device = &ldp_lcd_device,
209}; 224};
210 225
211static void __init ldp_display_init(void) 226static void __init ldp_display_init(void)
212{ 227{
213 ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO; 228 int r;
214 ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO; 229
230 static struct gpio gpios[] __initdata = {
231 {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
232 {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
233 };
234
235 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
236 if (r) {
237 pr_err("Cannot request LCD GPIOs, error %d\n", r);
238 return;
239 }
215 240
216 omap_display_init(&ldp_dss_data); 241 omap_display_init(&ldp_dss_data);
217} 242}
218 243
219static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) 244static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
220{ 245{
221 ldp_panel_data.gpios[0] = gpio + 7; 246 /* LCD enable GPIO */
222 ldp_panel_data.gpio_invert[0] = true; 247 ldp_lcd_pdata.enable_gpio = gpio + 7;
223 248
224 ldp_panel_data.gpios[1] = gpio + 15; 249 /* Backlight enable GPIO */
225 ldp_panel_data.gpio_invert[1] = true; 250 ldp_lcd_pdata.backlight_gpio = gpio + 15;
226 251
227 return 0; 252 return 0;
228} 253}
@@ -322,6 +347,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
322 347
323static struct platform_device *ldp_devices[] __initdata = { 348static struct platform_device *ldp_devices[] __initdata = {
324 &ldp_gpio_keys_device, 349 &ldp_gpio_keys_device,
350 &ldp_lcd_device,
325}; 351};
326 352
327#ifdef CONFIG_OMAP_MUX 353#ifdef CONFIG_OMAP_MUX