From patchwork Wed Nov 25 21:30:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 62999 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAPLTwIV020907 for ; Wed, 25 Nov 2009 21:29:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758963AbZKYV3u (ORCPT ); Wed, 25 Nov 2009 16:29:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758957AbZKYV3u (ORCPT ); Wed, 25 Nov 2009 16:29:50 -0500 Received: from lixom.net ([66.141.50.11]:44789 "EHLO mail.lixom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758906AbZKYV3t (ORCPT ); Wed, 25 Nov 2009 16:29:49 -0500 Received: by mail.lixom.net (Postfix, from userid 999) id CFE84B78B7; Wed, 25 Nov 2009 15:30:58 -0600 (CST) Date: Wed, 25 Nov 2009 15:30:58 -0600 From: Olof Johansson To: Tomi Valkeinen Cc: linux-omap@vger.kernel.org, sakoman@gmail.com, tony@atomide.com Subject: [PATCH] omap: dss2: Reintroduce Overo display support (DVI/HDMI) Message-ID: <20091125213058.GA4698@lixom.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 52dfd51..b09dab2 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -184,6 +185,120 @@ 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 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 = { + .name = "dvi", + .driver_name = "generic_panel", + .type = OMAP_DISPLAY_TYPE_DPI, + .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 = { + .name = "lcd", + .driver_name = "samsung_lte_panel", + .type = OMAP_DISPLAY_TYPE_DPI, + .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_vpll2_supplies[] = { + { + .supply = "vdvi", + .dev = &overo_lcd_device.dev, + }, + { + .supply = "vdds_dsi", + .dev = &overo_dss_device.dev, + } +}; + +static struct regulator_init_data overo_vpll2 = { + .constraints = { + .name = "VDVI", + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(overo_vpll2_supplies), + .consumer_supplies = overo_vpll2_supplies, +}; + + static struct mtd_partition overo_nand_partitions[] = { { .name = "xloader", @@ -347,6 +462,7 @@ static struct twl4030_platform_data overo_twldata = { .usb = &overo_usb_data, .codec = &overo_codec_data, .vmmc1 = &overo_vmmc1, + .vpll2 = &overo_vpll2, }; static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { @@ -367,23 +483,8 @@ static int __init overo_i2c_init(void) return 0; } -static struct platform_device overo_lcd_device = { - .name = "overo_lcd", - .id = -1, -}; - -static struct omap_lcd_config overo_lcd_config __initdata = { - .ctrl_name = "internal", -}; - -static struct omap_board_config_kernel overo_config[] __initdata = { - { OMAP_TAG_LCD, &overo_lcd_config }, -}; - static void __init overo_init_irq(void) { - omap_board_config = overo_config; - omap_board_config_size = ARRAY_SIZE(overo_config); omap2_init_common_hw(mt46h32m32lf6_sdrc_params, mt46h32m32lf6_sdrc_params); omap_init_irq(); @@ -391,7 +492,7 @@ static void __init overo_init_irq(void) } static struct platform_device *overo_devices[] __initdata = { - &overo_lcd_device, + &overo_dss_device, }; static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {