]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Hook twl4030 power code into twl4030 core.
authorPeter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Mon, 20 Oct 2008 08:37:53 +0000 (11:37 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 24 Oct 2008 22:53:47 +0000 (15:53 -0700)
This patch makes twl4030 core call the power code in case the scripts are present in the platform data.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/twl4030-core.c

index e643f6bb81c1143b33fbb21b40c555bd7ae9f5e5..91c0417d3548d2b37000678cb2e140fd9edd7c5e 100644 (file)
@@ -64,6 +64,15 @@ config TWL4030_CORE
          high speed USB OTG transceiver, an audio codec (on most
          versions) and many other features.
 
+config TWL4030_POWER
+       bool "Support power sequencing scripts on TWL4030/TPS659x0"
+       depends on TWL4030_CORE
+       help
+         Say yes here if you want to use the power sequencing scripts on
+         the TWL4030/TPS659x0. These scripts control which regulators or
+         oscillators are switched off or on or reset when a sleep, wakeup
+         or warm reset event occurs.
+
 config MFD_TMIO
        bool
        default n
index 92531f04c81819a837af27e8f8a86aa31675da28..baa15bd8d172a770f97f617f192246b4cad36629 100644 (file)
@@ -13,6 +13,7 @@ obj-$(CONFIG_MFD_TC6387XB)    += tc6387xb.o
 obj-$(CONFIG_MFD_TC6393XB)     += tc6393xb.o
 
 obj-$(CONFIG_TWL4030_CORE)     += twl4030-core.o twl4030-irq.o
+obj-$(CONFIG_TWL4030_POWER)    += twl4030-power.o
 
 obj-$(CONFIG_MFD_CORE)         += mfd-core.o
 
index dd843c4fbcc7cc76330199fc917185dbf16680f1..3fc54bf6397b424e994cc7b79ab65d14bf50665a 100644 (file)
 #define twl_has_madc() false
 #endif
 
+#ifdef CONFIG_TWL4030_POWER
+#define twl_has_power()        true
+#else
+#define twl_has_power()        false
+#endif
+
 #if defined(CONFIG_RTC_DRV_TWL4030) || defined(CONFIG_RTC_DRV_TWL4030_MODULE)
 #define twl_has_rtc()  true
 #else
@@ -209,6 +215,8 @@ static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = {
        { 3, TWL4030_BASEADD_SECURED_REG },
 };
 
+extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
+
 /*----------------------------------------------------------------------*/
 
 /* Exported Functions */
@@ -514,6 +522,9 @@ static int add_children(struct twl4030_platform_data *pdata)
                }
        }
 
+       if (twl_has_power() && pdata->power)
+               twl4030_power_init(pdata->power);
+
        if (twl_has_rtc()) {
                twl = &twl4030_modules[3];