Skip to content

Commit

Permalink
mfd: Add support for TWL4030/5030 dynamic power switching
Browse files Browse the repository at this point in the history
The TWL4030/5030 family of multifunction devices allows board-specific
control of the the various regulators, clock and reset lines through
'scripts' that are loaded into its memory. This allows for Dynamic Power
Switching (DPS).

Implement board-independent core support for DPS that is then used by
board-specific code to load custom DPS scripts.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Amit Kucheria authored and Samuel Ortiz committed Sep 17, 2009
1 parent 12992dd commit ebf0bd3
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 10 deletions.
13 changes: 13 additions & 0 deletions drivers/mfd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ config TWL4030_CORE
high speed USB OTG transceiver, an audio codec (on most
versions) and many other features.

config TWL4030_POWER
bool "Support power resources on TWL4030 family chips"
depends on TWL4030_CORE && ARM
help
Say yes here if you want to use the power resources on the
TWL4030 family chips. Most of these resources are regulators,
which have a separate driver; some are control signals, such
as clock request handshaking.

This driver uses board-specific data to initialize the resources
and load scripts controling which resources are switched off/on
or reset when a sleep, wakeup or warm reset event occurs.

config MFD_TMIO
bool
default n
Expand Down
1 change: 1 addition & 0 deletions drivers/mfd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_TPS65010) += tps65010.o
obj-$(CONFIG_MENELAUS) += menelaus.o

obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-irq.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o

obj-$(CONFIG_MFD_MC13783) += mc13783-core.o

Expand Down
10 changes: 10 additions & 0 deletions drivers/mfd/twl4030-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
#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
Expand Down Expand Up @@ -801,6 +807,10 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* setup clock framework */
clocks_init(&client->dev);

/* load power event scripts */
if (twl_has_power() && pdata->power)
twl4030_power_init(pdata->power);

/* Maybe init the T2 Interrupt subsystem */
if (client->irq
&& pdata->irq_base
Expand Down
Loading

0 comments on commit ebf0bd3

Please sign in to comment.