diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-10 07:37:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-07-16 09:00:32 -0400 |
commit | e102befe7a254f7b827fecc19eba0c5af03d1bf3 (patch) | |
tree | a58b33f847999e9ee80146f008717059945d3bf5 /drivers/mfd | |
parent | 9cd9e289ddeb66fb571dfa83d36e15c6d4b33b4e (diff) |
mfd: Initial support for the WM5110
The WM5110 is a highly-integrated low-power audio system for smartphones,
tablets and other portable audio devices. It combines an advanced DSP
feature set with a flexible, high-performance audio hub CODEC.
The support is based on the Arizona core driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/Kconfig | 6 | ||||
-rw-r--r-- | drivers/mfd/Makefile | 3 | ||||
-rw-r--r-- | drivers/mfd/arizona-core.c | 24 | ||||
-rw-r--r-- | drivers/mfd/arizona-i2c.c | 6 | ||||
-rw-r--r-- | drivers/mfd/arizona-irq.c | 6 | ||||
-rw-r--r-- | drivers/mfd/arizona-spi.c | 6 | ||||
-rw-r--r-- | drivers/mfd/arizona.h | 7 |
7 files changed, 58 insertions, 0 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 3c263a57b760..b9deb176402c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -550,6 +550,12 @@ config MFD_WM5102 | |||
550 | help | 550 | help |
551 | Support for Wolfson Microelectronics WM5102 low power audio SoC | 551 | Support for Wolfson Microelectronics WM5102 low power audio SoC |
552 | 552 | ||
553 | config MFD_WM5110 | ||
554 | bool "Support Wolfson Microelectronics WM5110" | ||
555 | depends on MFD_ARIZONA | ||
556 | help | ||
557 | Support for Wolfson Microelectronics WM5110 low power audio SoC | ||
558 | |||
553 | config MFD_WM8400 | 559 | config MFD_WM8400 |
554 | bool "Support Wolfson Microelectronics WM8400" | 560 | bool "Support Wolfson Microelectronics WM8400" |
555 | select MFD_CORE | 561 | select MFD_CORE |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 9c9727fe3f09..79dd22d1dc3d 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -33,6 +33,9 @@ obj-$(CONFIG_MFD_ARIZONA_SPI) += arizona-spi.o | |||
33 | ifneq ($(CONFIG_MFD_WM5102),n) | 33 | ifneq ($(CONFIG_MFD_WM5102),n) |
34 | obj-$(CONFIG_MFD_ARIZONA) += wm5102-tables.o | 34 | obj-$(CONFIG_MFD_ARIZONA) += wm5102-tables.o |
35 | endif | 35 | endif |
36 | ifneq ($(CONFIG_MFD_WM5110),n) | ||
37 | obj-$(CONFIG_MFD_ARIZONA) += wm5110-tables.o | ||
38 | endif | ||
36 | obj-$(CONFIG_MFD_WM8400) += wm8400-core.o | 39 | obj-$(CONFIG_MFD_WM8400) += wm8400-core.o |
37 | wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o | 40 | wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o |
38 | wm831x-objs += wm831x-auxadc.o | 41 | wm831x-objs += wm831x-auxadc.o |
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index b35680dcd8c1..6e70d3defc7e 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c | |||
@@ -273,6 +273,14 @@ static struct mfd_cell wm5102_devs[] = { | |||
273 | { .name = "wm5102-codec" }, | 273 | { .name = "wm5102-codec" }, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static struct mfd_cell wm5110_devs[] = { | ||
277 | { .name = "arizona-extcon" }, | ||
278 | { .name = "arizona-gpio" }, | ||
279 | { .name = "arizona-micsupp" }, | ||
280 | { .name = "arizona-pwm" }, | ||
281 | { .name = "wm5110-codec" }, | ||
282 | }; | ||
283 | |||
276 | int __devinit arizona_dev_init(struct arizona *arizona) | 284 | int __devinit arizona_dev_init(struct arizona *arizona) |
277 | { | 285 | { |
278 | struct device *dev = arizona->dev; | 286 | struct device *dev = arizona->dev; |
@@ -291,6 +299,7 @@ int __devinit arizona_dev_init(struct arizona *arizona) | |||
291 | 299 | ||
292 | switch (arizona->type) { | 300 | switch (arizona->type) { |
293 | case WM5102: | 301 | case WM5102: |
302 | case WM5110: | ||
294 | for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) | 303 | for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) |
295 | arizona->core_supplies[i].supply | 304 | arizona->core_supplies[i].supply |
296 | = wm5102_core_supplies[i]; | 305 | = wm5102_core_supplies[i]; |
@@ -379,6 +388,17 @@ int __devinit arizona_dev_init(struct arizona *arizona) | |||
379 | ret = wm5102_patch(arizona); | 388 | ret = wm5102_patch(arizona); |
380 | break; | 389 | break; |
381 | #endif | 390 | #endif |
391 | #ifdef CONFIG_MFD_WM5110 | ||
392 | case 0x5110: | ||
393 | type_name = "WM5110"; | ||
394 | if (arizona->type != WM5110) { | ||
395 | dev_err(arizona->dev, "WM5110 registered as %d\n", | ||
396 | arizona->type); | ||
397 | arizona->type = WM5110; | ||
398 | } | ||
399 | ret = wm5110_patch(arizona); | ||
400 | break; | ||
401 | #endif | ||
382 | default: | 402 | default: |
383 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); | 403 | dev_err(arizona->dev, "Unknown device ID %x\n", reg); |
384 | goto err_reset; | 404 | goto err_reset; |
@@ -494,6 +514,10 @@ int __devinit arizona_dev_init(struct arizona *arizona) | |||
494 | ret = mfd_add_devices(arizona->dev, -1, wm5102_devs, | 514 | ret = mfd_add_devices(arizona->dev, -1, wm5102_devs, |
495 | ARRAY_SIZE(wm5102_devs), NULL, 0); | 515 | ARRAY_SIZE(wm5102_devs), NULL, 0); |
496 | break; | 516 | break; |
517 | case WM5110: | ||
518 | ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, | ||
519 | ARRAY_SIZE(wm5102_devs), NULL, 0); | ||
520 | break; | ||
497 | } | 521 | } |
498 | 522 | ||
499 | if (ret != 0) { | 523 | if (ret != 0) { |
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c index fe19d11b92f0..570c4b438086 100644 --- a/drivers/mfd/arizona-i2c.c +++ b/drivers/mfd/arizona-i2c.c | |||
@@ -35,6 +35,11 @@ static __devinit int arizona_i2c_probe(struct i2c_client *i2c, | |||
35 | regmap_config = &wm5102_i2c_regmap; | 35 | regmap_config = &wm5102_i2c_regmap; |
36 | break; | 36 | break; |
37 | #endif | 37 | #endif |
38 | #ifdef CONFIG_MFD_WM5110 | ||
39 | case WM5110: | ||
40 | regmap_config = &wm5110_i2c_regmap; | ||
41 | break; | ||
42 | #endif | ||
38 | default: | 43 | default: |
39 | dev_err(&i2c->dev, "Unknown device type %ld\n", | 44 | dev_err(&i2c->dev, "Unknown device type %ld\n", |
40 | id->driver_data); | 45 | id->driver_data); |
@@ -69,6 +74,7 @@ static int __devexit arizona_i2c_remove(struct i2c_client *i2c) | |||
69 | 74 | ||
70 | static const struct i2c_device_id arizona_i2c_id[] = { | 75 | static const struct i2c_device_id arizona_i2c_id[] = { |
71 | { "wm5102", WM5102 }, | 76 | { "wm5102", WM5102 }, |
77 | { "wm5110", WM5110 }, | ||
72 | { } | 78 | { } |
73 | }; | 79 | }; |
74 | MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); | 80 | MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); |
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 17d20c0fba1e..98ac345f468e 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c | |||
@@ -164,6 +164,12 @@ int arizona_irq_init(struct arizona *arizona) | |||
164 | irq = &wm5102_irq; | 164 | irq = &wm5102_irq; |
165 | break; | 165 | break; |
166 | #endif | 166 | #endif |
167 | #ifdef CONFIG_MFD_WM5110 | ||
168 | case WM5110: | ||
169 | aod = &wm5110_aod; | ||
170 | irq = &wm5110_irq; | ||
171 | break; | ||
172 | #endif | ||
167 | default: | 173 | default: |
168 | BUG_ON("Unknown Arizona class device" == NULL); | 174 | BUG_ON("Unknown Arizona class device" == NULL); |
169 | return -EINVAL; | 175 | return -EINVAL; |
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c index f4bedaf875e6..df2e5a8bee28 100644 --- a/drivers/mfd/arizona-spi.c +++ b/drivers/mfd/arizona-spi.c | |||
@@ -35,6 +35,11 @@ static int __devinit arizona_spi_probe(struct spi_device *spi) | |||
35 | regmap_config = &wm5102_spi_regmap; | 35 | regmap_config = &wm5102_spi_regmap; |
36 | break; | 36 | break; |
37 | #endif | 37 | #endif |
38 | #ifdef CONFIG_MFD_WM5110 | ||
39 | case WM5110: | ||
40 | regmap_config = &wm5110_spi_regmap; | ||
41 | break; | ||
42 | #endif | ||
38 | default: | 43 | default: |
39 | dev_err(&spi->dev, "Unknown device type %ld\n", | 44 | dev_err(&spi->dev, "Unknown device type %ld\n", |
40 | id->driver_data); | 45 | id->driver_data); |
@@ -69,6 +74,7 @@ static int __devexit arizona_spi_remove(struct spi_device *spi) | |||
69 | 74 | ||
70 | static const struct spi_device_id arizona_spi_ids[] = { | 75 | static const struct spi_device_id arizona_spi_ids[] = { |
71 | { "wm5102", WM5102 }, | 76 | { "wm5102", WM5102 }, |
77 | { "wm5110", WM5110 }, | ||
72 | { }, | 78 | { }, |
73 | }; | 79 | }; |
74 | MODULE_DEVICE_TABLE(spi, arizona_spi_ids); | 80 | MODULE_DEVICE_TABLE(spi, arizona_spi_ids); |
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h index 1c9f333a9c17..9798ae5da67b 100644 --- a/drivers/mfd/arizona.h +++ b/drivers/mfd/arizona.h | |||
@@ -20,11 +20,18 @@ struct wm_arizona; | |||
20 | 20 | ||
21 | extern const struct regmap_config wm5102_i2c_regmap; | 21 | extern const struct regmap_config wm5102_i2c_regmap; |
22 | extern const struct regmap_config wm5102_spi_regmap; | 22 | extern const struct regmap_config wm5102_spi_regmap; |
23 | |||
24 | extern const struct regmap_config wm5110_i2c_regmap; | ||
25 | extern const struct regmap_config wm5110_spi_regmap; | ||
26 | |||
23 | extern const struct dev_pm_ops arizona_pm_ops; | 27 | extern const struct dev_pm_ops arizona_pm_ops; |
24 | 28 | ||
25 | extern const struct regmap_irq_chip wm5102_aod; | 29 | extern const struct regmap_irq_chip wm5102_aod; |
26 | extern const struct regmap_irq_chip wm5102_irq; | 30 | extern const struct regmap_irq_chip wm5102_irq; |
27 | 31 | ||
32 | extern const struct regmap_irq_chip wm5110_aod; | ||
33 | extern const struct regmap_irq_chip wm5110_irq; | ||
34 | |||
28 | int arizona_dev_init(struct arizona *arizona); | 35 | int arizona_dev_init(struct arizona *arizona); |
29 | int arizona_dev_exit(struct arizona *arizona); | 36 | int arizona_dev_exit(struct arizona *arizona); |
30 | int arizona_irq_init(struct arizona *arizona); | 37 | int arizona_irq_init(struct arizona *arizona); |