]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/board-overo.c
HSMMC: Build fixes for earlier patches
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-overo.c
index 175a444089c527b05a5b9bbb696669ceb33e3467..a45a44029cd8492a52c04d49ae6c2ad3ca849eb3 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/i2c/twl4030.h>
+
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <mach/gpio.h>
 #include <mach/gpmc.h>
 #include <mach/hardware.h>
-#include <mach/hsmmc.h>
+#include <mach/mmc.h>
 #include <mach/nand.h>
 #include <mach/usb-ehci.h>
 #include <mach/usb-musb.h>
 
 #include "sdram-micron-mt46h32m32lf-6.h"
+#include "twl4030-generic-scripts.h"
+#include "mmc-twl4030.h"
 
 #define NAND_BLOCK_SIZE SZ_128K
 #define GPMC_CS0_BASE  0x60
@@ -143,9 +147,37 @@ static struct omap_uart_config overo_uart_config __initdata = {
        .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
 };
 
+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,
+};
+
+static struct twl4030_usb_data overo_usb_data = {
+       .usb_mode       = T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_platform_data overo_twldata = {
+       .irq_base       = TWL4030_IRQ_BASE,
+       .irq_end        = TWL4030_IRQ_END,
+       .gpio           = &overo_gpio_data,
+       .usb            = &overo_usb_data,
+       .power          = &generic3430_t2scripts_data,
+};
+
+static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
+       {
+               I2C_BOARD_INFO("twl4030", 0x48),
+               .flags = I2C_CLIENT_WAKE,
+               .irq = INT_34XX_SYS_NIRQ,
+               .platform_data = &overo_twldata,
+       },
+};
+
 static int __init overo_i2c_init(void)
 {
-       omap_register_i2c_bus(1, 2600, NULL, 0);
+       omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo,
+                       ARRAY_SIZE(overo_i2c_boardinfo));
        /* i2c2 pins are used for gpio */
        omap_register_i2c_bus(3, 400, NULL, 0);
        return 0;
@@ -158,22 +190,6 @@ static void __init overo_init_irq(void)
        omap_gpio_init();
 }
 
-static struct omap_mmc_config overo_mmc_config __initdata = {
-       .mmc[0] = {
-               .enabled        = 1,
-               .wire4          = 1,
-       },
-       .mmc[1] = {
-               .enabled        = 1,
-               .wire4          = 1,
-       },
-};
-
-static struct platform_device overo_twl4030rtc_device = {
-       .name           = "twl4030_rtc",
-       .id             = -1,
-};
-
 static struct platform_device overo_lcd_device = {
        .name           = "overo_lcd",
        .id             = -1,
@@ -185,15 +201,25 @@ static struct omap_lcd_config overo_lcd_config __initdata = {
 
 static struct omap_board_config_kernel overo_config[] __initdata = {
        { OMAP_TAG_UART,        &overo_uart_config },
-       { OMAP_TAG_MMC,         &overo_mmc_config },
        { OMAP_TAG_LCD,         &overo_lcd_config },
 };
 
 static struct platform_device *overo_devices[] __initdata = {
        &overo_lcd_device,
-#ifdef CONFIG_RTC_DRV_TWL4030
-       &overo_twl4030rtc_device,
-#endif
+};
+
+static struct twl4030_hsmmc_info mmc[] __initdata = {
+       {
+               .mmc            = 1,
+               .wires          = 4,
+               .gpio_cd        = -EINVAL,
+       },
+       {
+               .mmc            = 2,
+               .wires          = 4,
+               .gpio_cd        = -EINVAL,
+       },
+       {}      /* Terminator */
 };
 
 static void __init overo_init(void)
@@ -203,7 +229,7 @@ static void __init overo_init(void)
        omap_board_config = overo_config;
        omap_board_config_size = ARRAY_SIZE(overo_config);
        omap_serial_init();
-       hsmmc_init();
+       hsmmc_init(mmc);
        usb_musb_init();
        usb_ehci_init();
        overo_flash_init();
@@ -216,9 +242,16 @@ 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");
+               printk(KERN_ERR "could not obtain gpio for "
+                                       "OVERO_GPIO_W2W_NRESET\n");
        }
 
+       if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) &&
+           (gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0))
+               gpio_export(OVERO_GPIO_BT_XGATE, 0);
+       else
+               printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n");
+
        if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) &&
            (gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) {
                gpio_export(OVERO_GPIO_BT_NRESET, 0);
@@ -226,21 +259,24 @@ static void __init overo_init(void)
                mdelay(6);
                gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
        } else {
-               printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_NRESET\n");
+               printk(KERN_ERR "could not obtain gpio for "
+                                       "OVERO_GPIO_BT_NRESET\n");
        }
 
        if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) &&
            (gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0))
                gpio_export(OVERO_GPIO_USBH_CPEN, 0);
        else
-               printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_USBH_CPEN\n");
+               printk(KERN_ERR "could not obtain gpio for "
+                                       "OVERO_GPIO_USBH_CPEN\n");
 
        if ((gpio_request(OVERO_GPIO_USBH_NRESET,
                          "OVERO_GPIO_USBH_NRESET") == 0) &&
            (gpio_direction_output(OVERO_GPIO_USBH_NRESET, 1) == 0))
                gpio_export(OVERO_GPIO_USBH_NRESET, 0);
        else
-               printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_USBH_NRESET\n");
+               printk(KERN_ERR "could not obtain gpio for "
+                                       "OVERO_GPIO_USBH_NRESET\n");
 }
 
 static void __init overo_map_io(void)