]> git.karo-electronics.de Git - linux-beck.git/blobdiff - arch/arm/mach-omap2/board-cm-t35.c
Merge branch 'next/fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux...
[linux-beck.git] / arch / arm / mach-omap2 / board-cm-t35.c
index 77456dec93ea9640c60a7b48f7dcf3db4b68e568..f0749215df115087d27a6cf9b1b3c774138273ce 100644 (file)
@@ -1,8 +1,9 @@
 /*
  * board-cm-t35.c (CompuLab CM-T35 module)
  *
- * Copyright (C) 2009 CompuLab, Ltd.
- * Author: Mike Rapoport <mike@compulab.co.il>
+ * Copyright (C) 2009-2011 CompuLab, Ltd.
+ * Authors: Mike Rapoport <mike@compulab.co.il>
+ *         Igor Grinberg <grinberg@compulab.co.il>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
  */
 
 #include <linux/kernel.h>
@@ -149,12 +145,12 @@ static struct mtd_partition cm_t35_nand_partitions[] = {
        },
        {
                .name           = "linux",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x2A0000 */
                .size           = 32 * NAND_BLOCK_SIZE,
        },
        {
                .name           = "rootfs",
-               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x6A0000 */
                .size           = MTDPART_SIZ_FULL,
        },
 };
@@ -162,9 +158,7 @@ static struct mtd_partition cm_t35_nand_partitions[] = {
 static struct omap_nand_platform_data cm_t35_nand_data = {
        .parts                  = cm_t35_nand_partitions,
        .nr_parts               = ARRAY_SIZE(cm_t35_nand_partitions),
-       .dma_channel            = -1,   /* disable DMA in OMAP NAND driver */
        .cs                     = 0,
-
 };
 
 static void __init cm_t35_init_nand(void)
@@ -337,19 +331,17 @@ static void __init cm_t35_init_display(void)
        }
 }
 
-static struct regulator_consumer_supply cm_t35_vmmc1_supply = {
-       .supply                 = "vmmc",
+static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = {
+       REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
 };
 
-static struct regulator_consumer_supply cm_t35_vsim_supply = {
-       .supply                 = "vmmc_aux",
+static struct regulator_consumer_supply cm_t35_vsim_supply[] = {
+       REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
 };
 
-static struct regulator_consumer_supply cm_t35_vdac_supply =
-       REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
-
-static struct regulator_consumer_supply cm_t35_vdvi_supply =
-       REGULATOR_SUPPLY("vdvi", "omapdss");
+static struct regulator_consumer_supply cm_t35_vdvi_supply[] = {
+       REGULATOR_SUPPLY("vdvi", "omapdss"),
+};
 
 /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
 static struct regulator_init_data cm_t35_vmmc1 = {
@@ -362,8 +354,8 @@ static struct regulator_init_data cm_t35_vmmc1 = {
                                        | REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
-       .num_consumer_supplies  = 1,
-       .consumer_supplies      = &cm_t35_vmmc1_supply,
+       .num_consumer_supplies  = ARRAY_SIZE(cm_t35_vmmc1_supply),
+       .consumer_supplies      = cm_t35_vmmc1_supply,
 };
 
 /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
@@ -377,41 +369,8 @@ static struct regulator_init_data cm_t35_vsim = {
                                        | REGULATOR_CHANGE_MODE
                                        | REGULATOR_CHANGE_STATUS,
        },
-       .num_consumer_supplies  = 1,
-       .consumer_supplies      = &cm_t35_vsim_supply,
-};
-
-/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
-static struct regulator_init_data cm_t35_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      = &cm_t35_vdac_supply,
-};
-
-/* VPLL2 for digital video outputs */
-static struct regulator_init_data cm_t35_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      = &cm_t35_vdvi_supply,
-};
-
-static struct twl4030_usb_data cm_t35_usb_data = {
-       .usb_mode       = T2_USB_MODE_ULPI,
+       .num_consumer_supplies  = ARRAY_SIZE(cm_t35_vsim_supply),
+       .consumer_supplies      = cm_t35_vsim_supply,
 };
 
 static uint32_t cm_t35_keymap[] = {
@@ -470,9 +429,9 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
        if (gpio_request_one(wlan_rst, GPIOF_OUT_INIT_HIGH, "WLAN RST") == 0) {
                gpio_export(wlan_rst, 0);
                udelay(10);
-               gpio_set_value(wlan_rst, 0);
+               gpio_set_value_cansleep(wlan_rst, 0);
                udelay(10);
-               gpio_set_value(wlan_rst, 1);
+               gpio_set_value_cansleep(wlan_rst, 1);
        } else {
                pr_err("CM-T35: could not obtain gpio for WiFi reset\n");
        }
@@ -481,10 +440,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,
        mmc[0].gpio_cd = gpio + 0;
        omap2_hsmmc_init(mmc);
 
-       /* link regulators to MMC adapters */
-       cm_t35_vmmc1_supply.dev = mmc[0].dev;
-       cm_t35_vsim_supply.dev = mmc[0].dev;
-
        return 0;
 }
 
@@ -496,21 +451,23 @@ static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
 };
 
 static struct twl4030_platform_data cm_t35_twldata = {
-       .irq_base       = TWL4030_IRQ_BASE,
-       .irq_end        = TWL4030_IRQ_END,
-
        /* platform_data for children goes here */
        .keypad         = &cm_t35_kp_data,
-       .usb            = &cm_t35_usb_data,
        .gpio           = &cm_t35_gpio_data,
        .vmmc1          = &cm_t35_vmmc1,
        .vsim           = &cm_t35_vsim,
-       .vdac           = &cm_t35_vdac,
-       .vpll2          = &cm_t35_vpll2,
 };
 
 static void __init cm_t35_init_i2c(void)
 {
+       omap3_pmic_get_config(&cm_t35_twldata, TWL_COMMON_PDATA_USB,
+                       TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2);
+
+       cm_t35_twldata.vpll2->constraints.name = "VDVI";
+       cm_t35_twldata.vpll2->num_consumer_supplies =
+                                               ARRAY_SIZE(cm_t35_vdvi_supply);
+       cm_t35_twldata.vpll2->consumer_supplies = cm_t35_vdvi_supply;
+
        omap3_pmic_init("tps65930", &cm_t35_twldata);
 }
 
@@ -646,7 +603,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
        .reserve        = omap_reserve,
        .map_io         = omap3_map_io,
        .init_early     = cm_t35_init_early,
-       .init_irq       = omap_init_irq,
+       .init_irq       = omap3_init_irq,
        .init_machine   = cm_t35_init,
-       .timer          = &omap_timer,
+       .timer          = &omap3_timer,
 MACHINE_END