aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-core.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2009-10-22 06:26:45 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-10-25 13:15:08 -0400
commit0b83ddebc6e884dc0221358cf68c461520fbdd8e (patch)
tree7c57a54fe8b0f02448597df3f7f81ea87a8b96b2 /drivers/mfd/twl4030-core.c
parent0ffc11800cb2a74b05c2f5b28966ebd50b27f70c (diff)
MFD: twl4030: add twl4030_codec MFD as a new child to the core
New MFD child to twl4030 MFD device. Reason for the twl4030_codec MFD: the vibra control is actually in the codec part of the twl4030. If both the vibra and the audio functionality is needed from the twl4030 at the same time, than they need to control the codec power and APLL at the same time without breaking the other driver. Also these two has to be able to work without the need for the other driver. This MFD device will be used by the drivers, which needs resources from the twl4030 codec like audio and vibra. The platform specific configuration data is passed along to the child drivers (audio, vibra). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/mfd/twl4030-core.c')
-rw-r--r--drivers/mfd/twl4030-core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index e424cf6d8e9e..0ee81e46bfbd 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -114,6 +114,12 @@
114#define twl_has_watchdog() false 114#define twl_has_watchdog() false
115#endif 115#endif
116 116
117#if defined(CONFIG_TWL4030_CODEC) || defined(CONFIG_TWL4030_CODEC_MODULE)
118#define twl_has_codec() true
119#else
120#define twl_has_codec() false
121#endif
122
117/* Triton Core internal information (BEGIN) */ 123/* Triton Core internal information (BEGIN) */
118 124
119/* Last - for index max*/ 125/* Last - for index max*/
@@ -557,6 +563,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
557 return PTR_ERR(child); 563 return PTR_ERR(child);
558 } 564 }
559 565
566 if (twl_has_codec() && pdata->codec) {
567 child = add_child(1, "twl4030_codec",
568 pdata->codec, sizeof(*pdata->codec),
569 false, 0, 0);
570 if (IS_ERR(child))
571 return PTR_ERR(child);
572 }
573
560 if (twl_has_regulator()) { 574 if (twl_has_regulator()) {
561 /* 575 /*
562 child = add_regulator(TWL4030_REG_VPLL1, pdata->vpll1); 576 child = add_regulator(TWL4030_REG_VPLL1, pdata->vpll1);