aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-overo.c
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2011-03-05 08:58:39 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 08:46:30 -0500
commit7b12d7b66bac4ff51aeea0029734b7a921cbe817 (patch)
treeeee0cd92fa2706f9310ca0ec5c6d1cdcb31a56cf /arch/arm/mach-omap2/board-overo.c
parent7654b4d3f4d2e2bc5b60990fc121891b95b33be5 (diff)
OMAP: DSS2: Add DSS2 support for Overo
This patch adds DSS2 support for DVI, S-video, the 480x272 Samsung LTE430WQ-F0C panel, and the 320x240 LG.Philips LB035Q02 panel. Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-overo.c')
-rw-r--r--arch/arm/mach-omap2/board-overo.c237
1 files changed, 200 insertions, 37 deletions
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 60f8db31763c..d621ee8fec0c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -28,6 +28,7 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/i2c/twl.h> 29#include <linux/i2c/twl.h>
30#include <linux/regulator/machine.h> 30#include <linux/regulator/machine.h>
31#include <linux/spi/spi.h>
31 32
32#include <linux/mtd/mtd.h> 33#include <linux/mtd/mtd.h>
33#include <linux/mtd/nand.h> 34#include <linux/mtd/nand.h>
@@ -41,10 +42,14 @@
41 42
42#include <plat/board.h> 43#include <plat/board.h>
43#include <plat/common.h> 44#include <plat/common.h>
45#include <plat/display.h>
46#include <plat/panel-generic-dpi.h>
44#include <mach/gpio.h> 47#include <mach/gpio.h>
45#include <plat/gpmc.h> 48#include <plat/gpmc.h>
46#include <mach/hardware.h> 49#include <mach/hardware.h>
47#include <plat/nand.h> 50#include <plat/nand.h>
51#include <plat/mcspi.h>
52#include <plat/mux.h>
48#include <plat/usb.h> 53#include <plat/usb.h>
49 54
50#include "mux.h" 55#include "mux.h"
@@ -68,8 +73,6 @@
68#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 73#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
69 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 74 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
70 75
71#include <plat/mcspi.h>
72#include <linux/spi/spi.h>
73#include <linux/spi/ads7846.h> 76#include <linux/spi/ads7846.h>
74 77
75static struct omap2_mcspi_device_config ads7846_mcspi_config = { 78static struct omap2_mcspi_device_config ads7846_mcspi_config = {
@@ -94,18 +97,6 @@ static struct ads7846_platform_data ads7846_config = {
94 .keep_vref_on = 1, 97 .keep_vref_on = 1,
95}; 98};
96 99
97static struct spi_board_info overo_spi_board_info[] __initdata = {
98 {
99 .modalias = "ads7846",
100 .bus_num = 1,
101 .chip_select = 0,
102 .max_speed_hz = 1500000,
103 .controller_data = &ads7846_mcspi_config,
104 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
105 .platform_data = &ads7846_config,
106 }
107};
108
109static void __init overo_ads7846_init(void) 100static void __init overo_ads7846_init(void)
110{ 101{
111 if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && 102 if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
@@ -115,9 +106,6 @@ static void __init overo_ads7846_init(void)
115 printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); 106 printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
116 return; 107 return;
117 } 108 }
118
119 spi_register_board_info(overo_spi_board_info,
120 ARRAY_SIZE(overo_spi_board_info));
121} 109}
122 110
123#else 111#else
@@ -233,6 +221,137 @@ static inline void __init overo_init_smsc911x(void)
233static inline void __init overo_init_smsc911x(void) { return; } 221static inline void __init overo_init_smsc911x(void) { return; }
234#endif 222#endif
235 223
224/* DSS */
225static int lcd_enabled;
226static int dvi_enabled;
227
228#define OVERO_GPIO_LCD_EN 144
229#define OVERO_GPIO_LCD_BL 145
230
231static void __init overo_display_init(void)
232{
233 if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
234 (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
235 gpio_export(OVERO_GPIO_LCD_EN, 0);
236 else
237 printk(KERN_ERR "could not obtain gpio for "
238 "OVERO_GPIO_LCD_EN\n");
239
240 if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
241 (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
242 gpio_export(OVERO_GPIO_LCD_BL, 0);
243 else
244 printk(KERN_ERR "could not obtain gpio for "
245 "OVERO_GPIO_LCD_BL\n");
246}
247
248static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
249{
250 if (lcd_enabled) {
251 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
252 return -EINVAL;
253 }
254 dvi_enabled = 1;
255
256 return 0;
257}
258
259static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
260{
261 dvi_enabled = 0;
262}
263
264static struct panel_generic_dpi_data dvi_panel = {
265 .name = "generic",
266 .platform_enable = overo_panel_enable_dvi,
267 .platform_disable = overo_panel_disable_dvi,
268};
269
270static struct omap_dss_device overo_dvi_device = {
271 .name = "dvi",
272 .type = OMAP_DISPLAY_TYPE_DPI,
273 .driver_name = "generic_dpi_panel",
274 .data = &dvi_panel,
275 .phy.dpi.data_lines = 24,
276};
277
278static struct omap_dss_device overo_tv_device = {
279 .name = "tv",
280 .driver_name = "venc",
281 .type = OMAP_DISPLAY_TYPE_VENC,
282 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
283};
284
285static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
286{
287 if (dvi_enabled) {
288 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
289 return -EINVAL;
290 }
291
292 gpio_set_value(OVERO_GPIO_LCD_EN, 1);
293 gpio_set_value(OVERO_GPIO_LCD_BL, 1);
294 lcd_enabled = 1;
295 return 0;
296}
297
298static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
299{
300 gpio_set_value(OVERO_GPIO_LCD_EN, 0);
301 gpio_set_value(OVERO_GPIO_LCD_BL, 0);
302 lcd_enabled = 0;
303}
304
305static struct panel_generic_dpi_data lcd43_panel = {
306 .name = "samsung_lte430wq_f0c",
307 .platform_enable = overo_panel_enable_lcd,
308 .platform_disable = overo_panel_disable_lcd,
309};
310
311static struct omap_dss_device overo_lcd43_device = {
312 .name = "lcd43",
313 .type = OMAP_DISPLAY_TYPE_DPI,
314 .driver_name = "generic_dpi_panel",
315 .data = &lcd43_panel,
316 .phy.dpi.data_lines = 24,
317};
318
319#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
320 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
321static struct omap_dss_device overo_lcd35_device = {
322 .type = OMAP_DISPLAY_TYPE_DPI,
323 .name = "lcd35",
324 .driver_name = "lgphilips_lb035q02_panel",
325 .phy.dpi.data_lines = 24,
326 .platform_enable = overo_panel_enable_lcd,
327 .platform_disable = overo_panel_disable_lcd,
328};
329#endif
330
331static struct omap_dss_device *overo_dss_devices[] = {
332 &overo_dvi_device,
333 &overo_tv_device,
334#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
335 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
336 &overo_lcd35_device,
337#endif
338 &overo_lcd43_device,
339};
340
341static struct omap_dss_board_info overo_dss_data = {
342 .num_devices = ARRAY_SIZE(overo_dss_devices),
343 .devices = overo_dss_devices,
344 .default_device = &overo_dvi_device,
345};
346
347static struct regulator_consumer_supply overo_vdda_dac_supply =
348 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
349
350static struct regulator_consumer_supply overo_vdds_dsi_supply[] = {
351 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
352 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
353};
354
236static struct mtd_partition overo_nand_partitions[] = { 355static struct mtd_partition overo_nand_partitions[] = {
237 { 356 {
238 .name = "xloader", 357 .name = "xloader",
@@ -358,6 +477,35 @@ static struct regulator_init_data overo_vmmc1 = {
358 .consumer_supplies = &overo_vmmc1_supply, 477 .consumer_supplies = &overo_vmmc1_supply,
359}; 478};
360 479
480/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
481static struct regulator_init_data overo_vdac = {
482 .constraints = {
483 .min_uV = 1800000,
484 .max_uV = 1800000,
485 .valid_modes_mask = REGULATOR_MODE_NORMAL
486 | REGULATOR_MODE_STANDBY,
487 .valid_ops_mask = REGULATOR_CHANGE_MODE
488 | REGULATOR_CHANGE_STATUS,
489 },
490 .num_consumer_supplies = 1,
491 .consumer_supplies = &overo_vdda_dac_supply,
492};
493
494/* VPLL2 for digital video outputs */
495static struct regulator_init_data overo_vpll2 = {
496 .constraints = {
497 .name = "VDVI",
498 .min_uV = 1800000,
499 .max_uV = 1800000,
500 .valid_modes_mask = REGULATOR_MODE_NORMAL
501 | REGULATOR_MODE_STANDBY,
502 .valid_ops_mask = REGULATOR_CHANGE_MODE
503 | REGULATOR_CHANGE_STATUS,
504 },
505 .num_consumer_supplies = ARRAY_SIZE(overo_vdds_dsi_supply),
506 .consumer_supplies = overo_vdds_dsi_supply,
507};
508
361static struct twl4030_codec_audio_data overo_audio_data; 509static struct twl4030_codec_audio_data overo_audio_data;
362 510
363static struct twl4030_codec_data overo_codec_data = { 511static struct twl4030_codec_data overo_codec_data = {
@@ -365,8 +513,6 @@ static struct twl4030_codec_data overo_codec_data = {
365 .audio = &overo_audio_data, 513 .audio = &overo_audio_data,
366}; 514};
367 515
368/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
369
370static struct twl4030_platform_data overo_twldata = { 516static struct twl4030_platform_data overo_twldata = {
371 .irq_base = TWL4030_IRQ_BASE, 517 .irq_base = TWL4030_IRQ_BASE,
372 .irq_end = TWL4030_IRQ_END, 518 .irq_end = TWL4030_IRQ_END,
@@ -374,6 +520,8 @@ static struct twl4030_platform_data overo_twldata = {
374 .usb = &overo_usb_data, 520 .usb = &overo_usb_data,
375 .codec = &overo_codec_data, 521 .codec = &overo_codec_data,
376 .vmmc1 = &overo_vmmc1, 522 .vmmc1 = &overo_vmmc1,
523 .vdac = &overo_vdac,
524 .vpll2 = &overo_vpll2,
377}; 525};
378 526
379static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { 527static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
@@ -394,18 +542,38 @@ static int __init overo_i2c_init(void)
394 return 0; 542 return 0;
395} 543}
396 544
397static struct platform_device overo_lcd_device = { 545static struct spi_board_info overo_spi_board_info[] __initdata = {
398 .name = "overo_lcd", 546#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
399 .id = -1, 547 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
400}; 548 {
401 549 .modalias = "ads7846",
402static struct omap_lcd_config overo_lcd_config __initdata = { 550 .bus_num = 1,
403 .ctrl_name = "internal", 551 .chip_select = 0,
552 .max_speed_hz = 1500000,
553 .controller_data = &ads7846_mcspi_config,
554 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
555 .platform_data = &ads7846_config,
556 },
557#endif
558#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
559 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
560 {
561 .modalias = "lgphilips_lb035q02_panel-spi",
562 .bus_num = 1,
563 .chip_select = 1,
564 .max_speed_hz = 500000,
565 .mode = SPI_MODE_3,
566 },
567#endif
404}; 568};
405 569
406static struct omap_board_config_kernel overo_config[] __initdata = { 570static int __init overo_spi_init(void)
407 { OMAP_TAG_LCD, &overo_lcd_config }, 571{
408}; 572 overo_ads7846_init();
573 spi_register_board_info(overo_spi_board_info,
574 ARRAY_SIZE(overo_spi_board_info));
575 return 0;
576}
409 577
410static void __init overo_init_early(void) 578static void __init overo_init_early(void)
411{ 579{
@@ -414,10 +582,6 @@ static void __init overo_init_early(void)
414 mt46h32m32lf6_sdrc_params); 582 mt46h32m32lf6_sdrc_params);
415} 583}
416 584
417static struct platform_device *overo_devices[] __initdata = {
418 &overo_lcd_device,
419};
420
421static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 585static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
422 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 586 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
423 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 587 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
@@ -444,16 +608,15 @@ static struct omap_musb_board_data musb_board_data = {
444static void __init overo_init(void) 608static void __init overo_init(void)
445{ 609{
446 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 610 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
447 omap_board_config = overo_config;
448 omap_board_config_size = ARRAY_SIZE(overo_config);
449 overo_i2c_init(); 611 overo_i2c_init();
450 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); 612 omap_display_init(&overo_dss_data);
451 omap_serial_init(); 613 omap_serial_init();
452 overo_flash_init(); 614 overo_flash_init();
453 usb_musb_init(&musb_board_data); 615 usb_musb_init(&musb_board_data);
454 usb_ehci_init(&ehci_pdata); 616 usb_ehci_init(&ehci_pdata);
455 overo_ads7846_init(); 617 overo_spi_init();
456 overo_init_smsc911x(); 618 overo_init_smsc911x();
619 overo_display_init();
457 620
458 /* Ensure SDRC pins are mux'd for self-refresh */ 621 /* Ensure SDRC pins are mux'd for self-refresh */
459 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 622 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);