]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mfd/twl4030-core.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / mfd / twl4030-core.c
index 26dea6b448f6b4a808a89567b6327283afa356a6..7e7f0db2005d74bef2450ccea9923e733f62b8a8 100644 (file)
@@ -38,6 +38,9 @@
 #include <linux/i2c.h>
 #include <linux/i2c/twl4030.h>
 
+#ifdef CONFIG_ARM
+#include <mach/cpu.h>
+#endif
 
 /*
  * The TWL4030 "Triton 2" is one of a family of a multi-function "Power
@@ -441,7 +444,7 @@ add_regulator_linked(int num, struct regulator_init_data *pdata,
        if (!pdata)
                return NULL;
 
-       if (consumers && !pdata->consumer_supplies) {
+       if (consumers) {
                pdata->consumer_supplies = consumers;
                pdata->num_consumer_supplies = num_consumers;
        }
@@ -564,9 +567,6 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
                static struct regulator_consumer_supply usb3v1 = {
                        .supply =       "usb3v1",
                };
-               static struct regulator_consumer_supply usbcp = {
-                       .supply =       "usbcp",
-               };
 
                /* this is a template that gets copied */
                struct regulator_init_data usb_fixed = {
@@ -581,7 +581,6 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
                usb1v5.dev = usb_transceiver;
                usb1v8.dev = usb_transceiver;
                usb3v1.dev = usb_transceiver;
-               usbcp.dev = usb_transceiver;
 
                child = add_regulator_linked(TWL4030_REG_VUSB1V5, &usb_fixed,
                                &usb1v5, 1);
@@ -597,11 +596,6 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
                                &usb3v1, 1);
                if (IS_ERR(child))
                        return PTR_ERR(child);
-
-               child = add_regulator_linked(TWL4030_REG_VUSBCP, &usb_fixed,
-                               &usbcp, 1);
-               if (IS_ERR(child))
-                       return PTR_ERR(child);
        }
 
        /* maybe add LDOs that are omitted on cost-reduced parts */
@@ -675,12 +669,7 @@ static void __init clocks_init(void)
                osc = clk_get(NULL, "osc_ck");
        else
                osc = clk_get(NULL, "osc_sys_ck");
-#else
-       /* REVISIT for non-OMAP systems, pass the clock rate from
-        * board init code, using platform_data.
-        */
-       osc = ERR_PTR(-EIO);
-#endif
+
        if (IS_ERR(osc)) {
                printk(KERN_WARNING "Skipping twl4030 internal clock init and "
                                "using bootloader value (unknown osc rate)\n");
@@ -690,6 +679,18 @@ static void __init clocks_init(void)
        rate = clk_get_rate(osc);
        clk_put(osc);
 
+#else
+       /* REVISIT for non-OMAP systems, pass the clock rate from
+        * board init code, using platform_data.
+        */
+       osc = ERR_PTR(-EIO);
+
+       printk(KERN_WARNING "Skipping twl4030 internal clock init and "
+              "using bootloader value (unknown osc rate)\n");
+
+       return;
+#endif
+
        switch (rate) {
        case 19200000:
                ctrl = HFCLK_FREQ_19p2_MHZ;