From 1ccb690cf0a478e3bbbf9bf1ee0f03a33918b87e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 1 Jun 2009 20:17:40 +0300 Subject: [PATCH 096/146] DSS2: Overo: add vdac/dsi regulators, fix panel names --- arch/arm/mach-omap2/board-overo.c | 224 ++++++++++++++++++++++--------------- 1 files changed, 132 insertions(+), 92 deletions(-) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 39f95f5..07868f9 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -183,9 +183,110 @@ static inline void __init overo_init_smsc911x(void) static inline void __init overo_init_smsc911x(void) { return; } #endif +/* DSS */ static int lcd_enabled; static int dvi_enabled; +#define OVERO_GPIO_LCD_EN 144 + +static void __init overo_display_init(void) +{ + int r; + + r = gpio_request(OVERO_GPIO_LCD_EN, "display enable"); + if (r) + printk("fail1\n"); + r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1); + if (r) + printk("fail2\n"); + gpio_export(OVERO_GPIO_LCD_EN, 0); +} + +static int overo_panel_enable_dvi(struct omap_dss_device *dssdev) +{ + if (lcd_enabled) { + printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); + return -EINVAL; + } + dvi_enabled = 1; + + gpio_set_value(OVERO_GPIO_LCD_EN, 1); + + return 0; +} + +static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) +{ + gpio_set_value(OVERO_GPIO_LCD_EN, 0); + + dvi_enabled = 0; +} + +static struct omap_dss_device overo_dvi_device = { + .type = OMAP_DISPLAY_TYPE_DPI, + .name = "dvi", + .driver_name = "generic_panel", + .phy.dpi.data_lines = 24, + .platform_enable = overo_panel_enable_dvi, + .platform_disable = overo_panel_disable_dvi, +}; + +static int overo_panel_enable_lcd(struct omap_dss_device *dssdev) +{ + if (dvi_enabled) { + printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); + return -EINVAL; + } + + gpio_set_value(OVERO_GPIO_LCD_EN, 1); + lcd_enabled = 1; + return 0; +} + +static void overo_panel_disable_lcd(struct omap_dss_device *dssdev) +{ + gpio_set_value(OVERO_GPIO_LCD_EN, 0); + lcd_enabled = 0; +} + +static struct omap_dss_device overo_lcd_device = { + .type = OMAP_DISPLAY_TYPE_DPI, + .name = "lcd", + .driver_name = "samsung_lte_panel", + .phy.dpi.data_lines = 24, + .platform_enable = overo_panel_enable_lcd, + .platform_disable = overo_panel_disable_lcd, +}; + +static struct omap_dss_device *overo_dss_devices[] = { + &overo_dvi_device, + &overo_lcd_device, +}; + +static struct omap_dss_board_info overo_dss_data = { + .num_devices = ARRAY_SIZE(overo_dss_devices), + .devices = overo_dss_devices, + .default_device = &overo_dvi_device, +}; + +static struct platform_device overo_dss_device = { + .name = "omapdss", + .id = -1, + .dev = { + .platform_data = &overo_dss_data, + }, +}; + +static struct regulator_consumer_supply overo_vdda_dac_supply = { + .supply = "vdda_dac", + .dev = &overo_dss_device.dev, +}; + +static struct regulator_consumer_supply overo_vdds_dsi_supply = { + .supply = "vdds_dsi", + .dev = &overo_dss_device.dev, +}; + static struct mtd_partition overo_nand_partitions[] = { { .name = "xloader", @@ -235,7 +336,6 @@ static struct platform_device overo_nand_device = { .resource = &overo_nand_resource, }; - static void __init overo_flash_init(void) { u8 cs = 0; @@ -334,6 +434,35 @@ static struct regulator_init_data overo_vmmc1 = { .consumer_supplies = &overo_vmmc1_supply, }; +/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +static struct regulator_init_data overo_vdac = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &overo_vdda_dac_supply, +}; + +/* VPLL2 for digital video outputs */ +static struct regulator_init_data overo_vpll2 = { + .constraints = { + .name = "VDVI", + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &overo_vdds_dsi_supply, +}; + /* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */ static struct twl4030_platform_data overo_twldata = { @@ -342,6 +471,8 @@ static struct twl4030_platform_data overo_twldata = { .gpio = &overo_gpio_data, .usb = &overo_usb_data, .vmmc1 = &overo_vmmc1, + .vdac = &overo_vdac, + .vpll2 = &overo_vpll2, }; static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { @@ -369,97 +500,6 @@ static void __init overo_init_irq(void) omap_gpio_init(); } -/* DSS */ - -#define OVERO_GPIO_LCD_EN 144 - -static void __init overo_display_init(void) -{ - int r; - - r = gpio_request(OVERO_GPIO_LCD_EN, "display enable"); - if (r) - printk("fail1\n"); - r = gpio_direction_output(OVERO_GPIO_LCD_EN, 1); - if (r) - printk("fail2\n"); - gpio_export(OVERO_GPIO_LCD_EN, 0); -} - -static int overo_panel_enable_dvi(struct omap_dss_device *dssdev) -{ - if (lcd_enabled) { - printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); - return -EINVAL; - } - dvi_enabled = 1; - - gpio_set_value(OVERO_GPIO_LCD_EN, 1); - - return 0; -} - -static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) -{ - gpio_set_value(OVERO_GPIO_LCD_EN, 0); - - dvi_enabled = 0; -} - -static struct omap_dss_device overo_dvi_device = { - .type = OMAP_DISPLAY_TYPE_DPI, - .name = "dvi", - .driver_name = "panel_generic", - .phy.dpi.data_lines = 24, - .platform_enable = overo_panel_enable_dvi, - .platform_disable = overo_panel_disable_dvi, -}; - -static int overo_panel_enable_lcd(struct omap_dss_device *dssdev) -{ - if (dvi_enabled) { - printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); - return -EINVAL; - } - - gpio_set_value(OVERO_GPIO_LCD_EN, 1); - lcd_enabled = 1; - return 0; -} - -static void overo_panel_disable_lcd(struct omap_dss_device *dssdev) -{ - gpio_set_value(OVERO_GPIO_LCD_EN, 0); - lcd_enabled = 0; -} - -static struct omap_dss_device overo_lcd_device = { - .type = OMAP_DISPLAY_TYPE_DPI, - .name = "lcd", - .driver_name = "samsung-lte430wq-f0c", - .phy.dpi.data_lines = 24, - .platform_enable = overo_panel_enable_lcd, - .platform_disable = overo_panel_disable_lcd, -}; - -static struct omap_dss_device *overo_dss_devices[] = { - &overo_dvi_device, - &overo_lcd_device, -}; - -static struct omap_dss_board_info overo_dss_data = { - .num_devices = ARRAY_SIZE(overo_dss_devices), - .devices = overo_dss_devices, - .default_device = &overo_dvi_device, -}; - -static struct platform_device overo_dss_device = { - .name = "omapdss", - .id = -1, - .dev = { - .platform_data = &overo_dss_data, - }, -}; static struct omap_board_config_kernel overo_config[] __initdata = { { OMAP_TAG_UART, &overo_uart_config }, -- 1.6.2.4