Merge tag 'dt-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[linux-3.10.git] / arch / arm / mach-omap2 / board-overo.c
index 60a61ea..f910140 100644 (file)
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mmc/host.h>
+#include <linux/usb/phy.h>
+
+#include <linux/platform_data/mtd-nand-omap2.h>
+#include <linux/platform_data/spi-omap2-mcspi.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 
-#include <plat/board.h>
-#include "common.h"
 #include <video/omapdss.h>
-#include <video/omap-panel-generic-dpi.h>
-#include <video/omap-panel-dvi.h>
-#include <plat/gpmc.h>
-#include <mach/hardware.h>
-#include <plat/nand.h>
-#include <plat/mcspi.h>
-#include <plat/mux.h>
-#include <plat/usb.h>
+#include <video/omap-panel-data.h>
 
+#include "common.h"
 #include "mux.h"
 #include "sdram-micron-mt46h32m32lf-6.h"
+#include "gpmc.h"
 #include "hsmmc.h"
+#include "board-flash.h"
 #include "common-board-devices.h"
 
+#define        NAND_CS                 0
+
 #define OVERO_GPIO_BT_XGATE    15
 #define OVERO_GPIO_W2W_NRESET  16
 #define OVERO_GPIO_PENDOWN     114
@@ -116,7 +116,7 @@ static inline void __init overo_ads7846_init(void) { return; }
 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
 
 #include <linux/smsc911x.h>
-#include <plat/gpmc-smsc911x.h>
+#include "gpmc-smsc911x.h"
 
 static struct omap_smsc911x_platform_data smsc911x_cfg = {
        .id             = 0,
@@ -167,32 +167,15 @@ static void __init overo_display_init(void)
        gpio_export(OVERO_GPIO_LCD_BL, 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;
-
-       return 0;
-}
-
-static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
-{
-       dvi_enabled = 0;
-}
-
-static struct panel_dvi_platform_data dvi_panel = {
-       .platform_enable        = overo_panel_enable_dvi,
-       .platform_disable       = overo_panel_disable_dvi,
+static struct tfp410_platform_data dvi_panel = {
        .i2c_bus_num            = 3,
+       .power_down_gpio        = -1,
 };
 
 static struct omap_dss_device overo_dvi_device = {
        .name                   = "dvi",
        .type                   = OMAP_DISPLAY_TYPE_DPI,
-       .driver_name            = "dvi",
+       .driver_name            = "tfp410",
        .data                   = &dvi_panel,
        .phy.dpi.data_lines     = 24,
 };
@@ -407,8 +390,6 @@ static inline void __init overo_init_keys(void) { return; }
 static int overo_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
 {
-       omap2_hsmmc_init(mmc);
-
 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
        /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
        gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -418,9 +399,6 @@ static int overo_twl_gpio_setup(struct device *dev,
 }
 
 static struct twl4030_gpio_platform_data overo_gpio_data = {
-       .gpio_base      = OMAP_MAX_GPIO_LINES,
-       .irq_base       = TWL4030_GPIO_IRQ_BASE,
-       .irq_end        = TWL4030_GPIO_IRQ_END,
        .use_leds       = true,
        .setup          = overo_twl_gpio_setup,
 };
@@ -479,14 +457,16 @@ static int __init overo_spi_init(void)
        return 0;
 }
 
-static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
-       .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
+static struct usbhs_phy_data phy_data[] __initdata = {
+       {
+               .port = 2,
+               .reset_gpio = OVERO_GPIO_USBH_NRESET,
+               .vcc_gpio = -EINVAL,
+       },
+};
+
+static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
        .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-       .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-       .phy_reset  = true,
-       .reset_gpio_port[0]  = -EINVAL,
-       .reset_gpio_port[1]  = OVERO_GPIO_USBH_NRESET,
-       .reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -500,25 +480,38 @@ static struct gpio overo_bt_gpios[] __initdata = {
        { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH,    "lcd bl enable" },
 };
 
+static struct regulator_consumer_supply dummy_supplies[] = {
+       REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
+       REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
+       REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
+};
+
 static void __init overo_init(void)
 {
        int ret;
 
+       regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        overo_i2c_init();
+       omap_hsmmc_init(mmc);
        omap_display_init(&overo_dss_data);
        omap_serial_init();
        omap_sdrc_init(mt46h32m32lf6_sdrc_params,
                                  mt46h32m32lf6_sdrc_params);
-       omap_nand_flash_init(0, overo_nand_partitions,
-                            ARRAY_SIZE(overo_nand_partitions));
+       board_nand_init(overo_nand_partitions,
+                       ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
+       usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
        usb_musb_init(NULL);
+
+       usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
        usbhs_init(&usbhs_bdata);
        overo_spi_init();
        overo_init_smsc911x();
        overo_display_init();
        overo_init_led();
        overo_init_keys();
+       omap_twl4030_audio_init("overo", NULL);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -532,8 +525,7 @@ static void __init overo_init(void)
                udelay(10);
                gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
        } else {
-               printk(KERN_ERR "could not obtain gpio for "
-                                       "OVERO_GPIO_W2W_NRESET\n");
+               pr_err("could not obtain gpio for OVERO_GPIO_W2W_NRESET\n");
        }
 
        ret = gpio_request_array(overo_bt_gpios, ARRAY_SIZE(overo_bt_gpios));
@@ -552,8 +544,7 @@ static void __init overo_init(void)
        if (ret == 0)
                gpio_export(OVERO_GPIO_USBH_CPEN, 0);
        else
-               printk(KERN_ERR "could not obtain gpio for "
-                                       "OVERO_GPIO_USBH_CPEN\n");
+               pr_err("could not obtain gpio for OVERO_GPIO_USBH_CPEN\n");
 }
 
 MACHINE_START(OVERO, "Gumstix Overo")
@@ -564,5 +555,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
        .init_irq       = omap3_init_irq,
        .handle_irq     = omap3_intc_handle_irq,
        .init_machine   = overo_init,
-       .timer          = &omap3_timer,
+       .init_late      = omap35xx_init_late,
+       .init_time      = omap3_sync32k_timer_init,
+       .restart        = omap3xxx_restart,
 MACHINE_END