From patchwork Fri Oct 15 16:56:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 67983 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 2931CB70E6 for ; Sat, 16 Oct 2010 03:56:59 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1P6naK-0000Yb-Br; Fri, 15 Oct 2010 17:56:48 +0100 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1P6naG-0000YN-Vp for kernel-team@lists.ubuntu.com; Fri, 15 Oct 2010 17:56:45 +0100 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1P6naG-0005Py-RN for ; Fri, 15 Oct 2010 17:56:44 +0100 Received: from s0106002369de4dac.cg.shawcable.net ([70.73.24.112] helo=[192.168.1.100]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P6naG-0003JM-BM for kernel-team@lists.ubuntu.com; Fri, 15 Oct 2010 17:56:44 +0100 Subject: [Maverick SRU][PATCH] UBUNTU: SAUCE - ARM: Add DSS2 support for Overo board From: Mathieu Poirier To: kernel-team@lists.ubuntu.com Date: Fri, 15 Oct 2010 10:56:42 -0600 Message-ID: <1287161802.24653.9.camel@black> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com SRU Justification Impact: A power regulator named "vdds_sdi" is missing from the board setup file, preventing the display sudbsystem from initializing properly, something that impacts omapfb and yields a blank screen. DSS2 related platform data are also missing. Fix: The fix consist in adding a "vdds_sdi" regulator declaration and DSS2 platform device declaration and linking them to the twl4030_platform data. Testcase: There is no dvi output if the patch isn't applied. >From c40d340579a97b25f29358e4f1557e3c81d675d2 Mon Sep 17 00:00:00 2001 From: Mathieu J. Poirier Date: Fri, 15 Oct 2010 10:15:55 -0600 Subject: [PATCH] UBUNTU - ARM: Add DSS2 support for Overo board Like the Beagle, EVM and IGEPv2 boads, the omapdss can't find the "vdds_sdi" regulator, causing omapfb to exit prematurely and yield a blank screen. This is based on the work found here, adjusted to leave out the SPI mofications and apply/compile: http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=shortlog;h=refs/heads/omap3-2.6.35 BugLink: https://bugs.launchpad.net/bugs/660811 Signed-off-by: Mathieu J Poirier --- arch/arm/mach-omap2/board-overo.c | 134 +++++++++++++++++++++++++++++------- 1 files changed, 108 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 79ac414..1100d0e 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 @@ -139,16 +140,6 @@ static struct resource overo_smsc911x_resources[] = { }, }; -static struct resource overo_smsc911x2_resources[] = { - { - .name = "smsc911x2-memory", - .flags = IORESOURCE_MEM, - }, - { - .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, - }, -}; - static struct smsc911x_platform_config overo_smsc911x_config = { .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, @@ -196,6 +187,81 @@ 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 +#define OVERO_GPIO_LCD_BL 145 + +static void __init overo_display_init(void) +{ + if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) && + (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0)) + gpio_export(OVERO_GPIO_LCD_EN, 0); + else + printk(KERN_ERR "could not obtain gpio for " + "OVERO_GPIO_LCD_EN\n"); + + if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) && + (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0)) + gpio_export(OVERO_GPIO_LCD_BL, 0); + else + printk(KERN_ERR "could not obtain gpio for " + "OVERO_GPIO_LCD_BL\n"); +} + +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; + + return 0; +} + +static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) +{ + 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 struct omap_dss_device *overo_dss_devices[] = { + &overo_dvi_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 = + REGULATOR_SUPPLY("vdda_dac", "omapdss"); + +static struct regulator_consumer_supply overo_vdds_supplies[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss"), + REGULATOR_SUPPLY("vdds_sdi", "omapdss"), +}; + static struct mtd_partition overo_nand_partitions[] = { { .name = "xloader", @@ -341,6 +407,34 @@ 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 = { + .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 = ARRAY_SIZE(overo_vdds_supplies), + .consumer_supplies = overo_vdds_supplies, +}; + static struct twl4030_codec_audio_data overo_audio_data = { .audio_mclk = 26000000, }; @@ -359,6 +453,8 @@ static struct twl4030_platform_data overo_twldata = { .usb = &overo_usb_data, .codec = &overo_codec_data, .vmmc1 = &overo_vmmc1, + .vdac = &overo_vdac, + .vpll2 = &overo_vpll2, }; static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { @@ -379,23 +475,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(); @@ -403,7 +484,7 @@ static void __init overo_init_irq(void) } static struct platform_device *overo_devices[] __initdata = { - &overo_lcd_device, + &overo_dss_device, }; static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { @@ -442,6 +523,7 @@ static void __init overo_init(void) usb_ehci_init(&ehci_pdata); overo_ads7846_init(); overo_init_smsc911x(); + overo_display_init(); /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);