aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-10 07:37:58 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-07-16 09:00:32 -0400
commite102befe7a254f7b827fecc19eba0c5af03d1bf3 (patch)
treea58b33f847999e9ee80146f008717059945d3bf5
parent9cd9e289ddeb66fb571dfa83d36e15c6d4b33b4e (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>
-rw-r--r--drivers/mfd/Kconfig6
-rw-r--r--drivers/mfd/Makefile3
-rw-r--r--drivers/mfd/arizona-core.c24
-rw-r--r--drivers/mfd/arizona-i2c.c6
-rw-r--r--drivers/mfd/arizona-irq.c6
-rw-r--r--drivers/mfd/arizona-spi.c6
-rw-r--r--drivers/mfd/arizona.h7
-rw-r--r--include/linux/mfd/arizona/core.h79
-rw-r--r--include/linux/mfd/arizona/pdata.h4
9 files changed, 105 insertions, 36 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
553config 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
553config MFD_WM8400 559config 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
33ifneq ($(CONFIG_MFD_WM5102),n) 33ifneq ($(CONFIG_MFD_WM5102),n)
34obj-$(CONFIG_MFD_ARIZONA) += wm5102-tables.o 34obj-$(CONFIG_MFD_ARIZONA) += wm5102-tables.o
35endif 35endif
36ifneq ($(CONFIG_MFD_WM5110),n)
37obj-$(CONFIG_MFD_ARIZONA) += wm5110-tables.o
38endif
36obj-$(CONFIG_MFD_WM8400) += wm8400-core.o 39obj-$(CONFIG_MFD_WM8400) += wm8400-core.o
37wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o 40wm831x-objs := wm831x-core.o wm831x-irq.o wm831x-otp.o
38wm831x-objs += wm831x-auxadc.o 41wm831x-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
276static 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
276int __devinit arizona_dev_init(struct arizona *arizona) 284int __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
70static const struct i2c_device_id arizona_i2c_id[] = { 75static const struct i2c_device_id arizona_i2c_id[] = {
71 { "wm5102", WM5102 }, 76 { "wm5102", WM5102 },
77 { "wm5110", WM5110 },
72 { } 78 { }
73}; 79};
74MODULE_DEVICE_TABLE(i2c, arizona_i2c_id); 80MODULE_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
70static const struct spi_device_id arizona_spi_ids[] = { 75static const struct spi_device_id arizona_spi_ids[] = {
71 { "wm5102", WM5102 }, 76 { "wm5102", WM5102 },
77 { "wm5110", WM5110 },
72 { }, 78 { },
73}; 79};
74MODULE_DEVICE_TABLE(spi, arizona_spi_ids); 80MODULE_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
21extern const struct regmap_config wm5102_i2c_regmap; 21extern const struct regmap_config wm5102_i2c_regmap;
22extern const struct regmap_config wm5102_spi_regmap; 22extern const struct regmap_config wm5102_spi_regmap;
23
24extern const struct regmap_config wm5110_i2c_regmap;
25extern const struct regmap_config wm5110_spi_regmap;
26
23extern const struct dev_pm_ops arizona_pm_ops; 27extern const struct dev_pm_ops arizona_pm_ops;
24 28
25extern const struct regmap_irq_chip wm5102_aod; 29extern const struct regmap_irq_chip wm5102_aod;
26extern const struct regmap_irq_chip wm5102_irq; 30extern const struct regmap_irq_chip wm5102_irq;
27 31
32extern const struct regmap_irq_chip wm5110_aod;
33extern const struct regmap_irq_chip wm5110_irq;
34
28int arizona_dev_init(struct arizona *arizona); 35int arizona_dev_init(struct arizona *arizona);
29int arizona_dev_exit(struct arizona *arizona); 36int arizona_dev_exit(struct arizona *arizona);
30int arizona_irq_init(struct arizona *arizona); 37int arizona_irq_init(struct arizona *arizona);
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index 3ef32b4c1136..dd231ac0bb1f 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -22,6 +22,7 @@
22 22
23enum arizona_type { 23enum arizona_type {
24 WM5102 = 1, 24 WM5102 = 1,
25 WM5110 = 2,
25}; 26};
26 27
27#define ARIZONA_IRQ_GP1 0 28#define ARIZONA_IRQ_GP1 0
@@ -33,40 +34,49 @@ enum arizona_type {
33#define ARIZONA_IRQ_JD_FALL 6 34#define ARIZONA_IRQ_JD_FALL 6
34#define ARIZONA_IRQ_JD_RISE 7 35#define ARIZONA_IRQ_JD_RISE 7
35#define ARIZONA_IRQ_DSP1_RAM_RDY 8 36#define ARIZONA_IRQ_DSP1_RAM_RDY 8
36#define ARIZONA_IRQ_DSP_IRQ1 9 37#define ARIZONA_IRQ_DSP2_RAM_RDY 9
37#define ARIZONA_IRQ_DSP_IRQ2 10 38#define ARIZONA_IRQ_DSP3_RAM_RDY 10
38#define ARIZONA_IRQ_SPK_SHUTDOWN_WARN 11 39#define ARIZONA_IRQ_DSP4_RAM_RDY 11
39#define ARIZONA_IRQ_SPK_SHUTDOWN 12 40#define ARIZONA_IRQ_DSP_IRQ1 12
40#define ARIZONA_IRQ_MICDET 13 41#define ARIZONA_IRQ_DSP_IRQ2 13
41#define ARIZONA_IRQ_HPDET 14 42#define ARIZONA_IRQ_DSP_IRQ3 14
42#define ARIZONA_IRQ_WSEQ_DONE 15 43#define ARIZONA_IRQ_DSP_IRQ4 15
43#define ARIZONA_IRQ_DRC2_SIG_DET 16 44#define ARIZONA_IRQ_DSP_IRQ5 16
44#define ARIZONA_IRQ_DRC1_SIG_DET 17 45#define ARIZONA_IRQ_DSP_IRQ6 17
45#define ARIZONA_IRQ_ASRC2_LOCK 18 46#define ARIZONA_IRQ_DSP_IRQ7 18
46#define ARIZONA_IRQ_ASRC1_LOCK 19 47#define ARIZONA_IRQ_DSP_IRQ8 19
47#define ARIZONA_IRQ_UNDERCLOCKED 20 48#define ARIZONA_IRQ_SPK_SHUTDOWN_WARN 20
48#define ARIZONA_IRQ_OVERCLOCKED 21 49#define ARIZONA_IRQ_SPK_SHUTDOWN 21
49#define ARIZONA_IRQ_FLL2_LOCK 22 50#define ARIZONA_IRQ_MICDET 22
50#define ARIZONA_IRQ_FLL1_LOCK 23 51#define ARIZONA_IRQ_HPDET 23
51#define ARIZONA_IRQ_CLKGEN_ERR 24 52#define ARIZONA_IRQ_WSEQ_DONE 24
52#define ARIZONA_IRQ_CLKGEN_ERR_ASYNC 25 53#define ARIZONA_IRQ_DRC2_SIG_DET 25
53#define ARIZONA_IRQ_ASRC_CFG_ERR 26 54#define ARIZONA_IRQ_DRC1_SIG_DET 26
54#define ARIZONA_IRQ_AIF3_ERR 27 55#define ARIZONA_IRQ_ASRC2_LOCK 27
55#define ARIZONA_IRQ_AIF2_ERR 28 56#define ARIZONA_IRQ_ASRC1_LOCK 28
56#define ARIZONA_IRQ_AIF1_ERR 29 57#define ARIZONA_IRQ_UNDERCLOCKED 29
57#define ARIZONA_IRQ_CTRLIF_ERR 30 58#define ARIZONA_IRQ_OVERCLOCKED 30
58#define ARIZONA_IRQ_MIXER_DROPPED_SAMPLES 31 59#define ARIZONA_IRQ_FLL2_LOCK 31
59#define ARIZONA_IRQ_ASYNC_CLK_ENA_LOW 32 60#define ARIZONA_IRQ_FLL1_LOCK 32
60#define ARIZONA_IRQ_SYSCLK_ENA_LOW 33 61#define ARIZONA_IRQ_CLKGEN_ERR 33
61#define ARIZONA_IRQ_ISRC1_CFG_ERR 34 62#define ARIZONA_IRQ_CLKGEN_ERR_ASYNC 34
62#define ARIZONA_IRQ_ISRC2_CFG_ERR 35 63#define ARIZONA_IRQ_ASRC_CFG_ERR 35
63#define ARIZONA_IRQ_BOOT_DONE 36 64#define ARIZONA_IRQ_AIF3_ERR 36
64#define ARIZONA_IRQ_DCS_DAC_DONE 37 65#define ARIZONA_IRQ_AIF2_ERR 37
65#define ARIZONA_IRQ_DCS_HP_DONE 38 66#define ARIZONA_IRQ_AIF1_ERR 38
66#define ARIZONA_IRQ_FLL2_CLOCK_OK 39 67#define ARIZONA_IRQ_CTRLIF_ERR 39
67#define ARIZONA_IRQ_FLL1_CLOCK_OK 40 68#define ARIZONA_IRQ_MIXER_DROPPED_SAMPLES 40
68 69#define ARIZONA_IRQ_ASYNC_CLK_ENA_LOW 41
69#define ARIZONA_NUM_IRQ 41 70#define ARIZONA_IRQ_SYSCLK_ENA_LOW 42
71#define ARIZONA_IRQ_ISRC1_CFG_ERR 43
72#define ARIZONA_IRQ_ISRC2_CFG_ERR 44
73#define ARIZONA_IRQ_BOOT_DONE 45
74#define ARIZONA_IRQ_DCS_DAC_DONE 46
75#define ARIZONA_IRQ_DCS_HP_DONE 47
76#define ARIZONA_IRQ_FLL2_CLOCK_OK 48
77#define ARIZONA_IRQ_FLL1_CLOCK_OK 49
78
79#define ARIZONA_NUM_IRQ 50
70 80
71struct arizona { 81struct arizona {
72 struct regmap *regmap; 82 struct regmap *regmap;
@@ -99,5 +109,6 @@ void arizona_free_irq(struct arizona *arizona, int irq, void *data);
99int arizona_set_irq_wake(struct arizona *arizona, int irq, int on); 109int arizona_set_irq_wake(struct arizona *arizona, int irq, int on);
100 110
101int wm5102_patch(struct arizona *arizona); 111int wm5102_patch(struct arizona *arizona);
112int wm5110_patch(struct arizona *arizona);
102 113
103#endif 114#endif
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 68ff91aa3888..7ab442905a57 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -49,7 +49,7 @@
49#define ARIZONA_32KZ_MCLK2 2 49#define ARIZONA_32KZ_MCLK2 2
50#define ARIZONA_32KZ_NONE 3 50#define ARIZONA_32KZ_NONE 3
51 51
52#define ARIZONA_MAX_INPUT 3 52#define ARIZONA_MAX_INPUT 4
53 53
54#define ARIZONA_DMIC_MICVDD 0 54#define ARIZONA_DMIC_MICVDD 0
55#define ARIZONA_DMIC_MICBIAS1 1 55#define ARIZONA_DMIC_MICBIAS1 1
@@ -60,7 +60,7 @@
60#define ARIZONA_INMODE_SE 1 60#define ARIZONA_INMODE_SE 1
61#define ARIZONA_INMODE_DMIC 2 61#define ARIZONA_INMODE_DMIC 2
62 62
63#define ARIZONA_MAX_OUTPUT 5 63#define ARIZONA_MAX_OUTPUT 6
64 64
65#define ARIZONA_MAX_PDM_SPK 2 65#define ARIZONA_MAX_PDM_SPK 2
66 66