diff options
author | Ilkka Koskinen <ilkka.koskinen@nokia.com> | 2009-11-10 10:26:15 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-12-13 13:21:41 -0500 |
commit | 1920a61e208fac73d1a30a7cf4005701802fe69f (patch) | |
tree | 2282d5b842d46f5b48144d9950a89a7b78fb930a /drivers/mfd/twl4030-core.c | |
parent | 6a6127462eb9096419fd4b3115ec5971d83a600f (diff) |
mfd: Initial support for twl5031
TWL5031 introduces two new interrupts in PIH. Moreover, BCI
has changed remarkably and, thus, it's disabled when TWL5031
is in use.
Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl4030-core.c')
-rw-r--r-- | drivers/mfd/twl4030-core.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index 90a38e43c313..334c86fccede 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c | |||
@@ -158,6 +158,10 @@ | |||
158 | #define TWL4030_BASEADD_PWMB 0x00F1 | 158 | #define TWL4030_BASEADD_PWMB 0x00F1 |
159 | #define TWL4030_BASEADD_KEYPAD 0x00D2 | 159 | #define TWL4030_BASEADD_KEYPAD 0x00D2 |
160 | 160 | ||
161 | #define TWL5031_BASEADD_ACCESSORY 0x0074 /* Replaces Main Charge */ | ||
162 | #define TWL5031_BASEADD_INTERRUPTS 0x00B9 /* Different than TWL4030's | ||
163 | one */ | ||
164 | |||
161 | /* subchip/slave 3 - POWER ID */ | 165 | /* subchip/slave 3 - POWER ID */ |
162 | #define TWL4030_BASEADD_BACKUP 0x0014 | 166 | #define TWL4030_BASEADD_BACKUP 0x0014 |
163 | #define TWL4030_BASEADD_INT 0x002E | 167 | #define TWL4030_BASEADD_INT 0x002E |
@@ -189,6 +193,7 @@ | |||
189 | /* chip-specific feature flags, for i2c_device_id.driver_data */ | 193 | /* chip-specific feature flags, for i2c_device_id.driver_data */ |
190 | #define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */ | 194 | #define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */ |
191 | #define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ | 195 | #define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ |
196 | #define TWL5031 BIT(2) /* twl5031 has different registers */ | ||
192 | 197 | ||
193 | /*----------------------------------------------------------------------*/ | 198 | /*----------------------------------------------------------------------*/ |
194 | 199 | ||
@@ -241,6 +246,8 @@ static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = { | |||
241 | { 2, TWL4030_BASEADD_PWM1 }, | 246 | { 2, TWL4030_BASEADD_PWM1 }, |
242 | { 2, TWL4030_BASEADD_PWMA }, | 247 | { 2, TWL4030_BASEADD_PWMA }, |
243 | { 2, TWL4030_BASEADD_PWMB }, | 248 | { 2, TWL4030_BASEADD_PWMB }, |
249 | { 2, TWL5031_BASEADD_ACCESSORY }, | ||
250 | { 2, TWL5031_BASEADD_INTERRUPTS }, | ||
244 | 251 | ||
245 | { 3, TWL4030_BASEADD_BACKUP }, | 252 | { 3, TWL4030_BASEADD_BACKUP }, |
246 | { 3, TWL4030_BASEADD_INT }, | 253 | { 3, TWL4030_BASEADD_INT }, |
@@ -488,7 +495,8 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features) | |||
488 | { | 495 | { |
489 | struct device *child; | 496 | struct device *child; |
490 | 497 | ||
491 | if (twl_has_bci() && pdata->bci && !(features & TPS_SUBSET)) { | 498 | if (twl_has_bci() && pdata->bci && |
499 | !(features & (TPS_SUBSET | TWL5031))) { | ||
492 | child = add_child(3, "twl4030_bci", | 500 | child = add_child(3, "twl4030_bci", |
493 | pdata->bci, sizeof(*pdata->bci), | 501 | pdata->bci, sizeof(*pdata->bci), |
494 | false, | 502 | false, |
@@ -760,6 +768,7 @@ static void clocks_init(struct device *dev, | |||
760 | 768 | ||
761 | int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end); | 769 | int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end); |
762 | int twl_exit_irq(void); | 770 | int twl_exit_irq(void); |
771 | int twl_init_chip_irq(const char *chip); | ||
763 | 772 | ||
764 | static int twl4030_remove(struct i2c_client *client) | 773 | static int twl4030_remove(struct i2c_client *client) |
765 | { | 774 | { |
@@ -835,6 +844,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
835 | if (client->irq | 844 | if (client->irq |
836 | && pdata->irq_base | 845 | && pdata->irq_base |
837 | && pdata->irq_end > pdata->irq_base) { | 846 | && pdata->irq_end > pdata->irq_base) { |
847 | twl_init_chip_irq(id->name); | ||
838 | status = twl_init_irq(client->irq, pdata->irq_base, pdata->irq_end); | 848 | status = twl_init_irq(client->irq, pdata->irq_base, pdata->irq_end); |
839 | if (status < 0) | 849 | if (status < 0) |
840 | goto fail; | 850 | goto fail; |
@@ -850,6 +860,7 @@ fail: | |||
850 | static const struct i2c_device_id twl4030_ids[] = { | 860 | static const struct i2c_device_id twl4030_ids[] = { |
851 | { "twl4030", TWL4030_VAUX2 }, /* "Triton 2" */ | 861 | { "twl4030", TWL4030_VAUX2 }, /* "Triton 2" */ |
852 | { "twl5030", 0 }, /* T2 updated */ | 862 | { "twl5030", 0 }, /* T2 updated */ |
863 | { "twl5031", TWL5031 }, /* TWL5030 updated */ | ||
853 | { "tps65950", 0 }, /* catalog version of twl5030 */ | 864 | { "tps65950", 0 }, /* catalog version of twl5030 */ |
854 | { "tps65930", TPS_SUBSET }, /* fewer LDOs and DACs; no charger */ | 865 | { "tps65930", TPS_SUBSET }, /* fewer LDOs and DACs; no charger */ |
855 | { "tps65920", TPS_SUBSET }, /* fewer LDOs; no codec or charger */ | 866 | { "tps65920", TPS_SUBSET }, /* fewer LDOs; no codec or charger */ |