diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-24 13:01:41 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-01-14 06:37:39 -0500 |
commit | 412dc11d3fd01f96fdf4a8cbfbc5584a17dab7c8 (patch) | |
tree | 8550bcb089afaa1529973ce951c763697e39b312 /drivers/mfd | |
parent | 798e6e321f807c46d81be1572118e031577ea9ab (diff) |
mfd: Add WM8326 support
The WM8326 is a high performance variant of the WM832x series with
no software visible differences.
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/wm831x-core.c | 7 | ||||
-rw-r--r-- | drivers/mfd/wm831x-i2c.c | 1 | ||||
-rw-r--r-- | drivers/mfd/wm831x-spi.c | 18 |
3 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index d1b2d534b99..3fe9a58fe6c 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -1541,6 +1541,12 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1541 | dev_info(wm831x->dev, "WM8325 revision %c\n", 'A' + rev); | 1541 | dev_info(wm831x->dev, "WM8325 revision %c\n", 'A' + rev); |
1542 | break; | 1542 | break; |
1543 | 1543 | ||
1544 | case WM8326: | ||
1545 | parent = WM8326; | ||
1546 | wm831x->num_gpio = 12; | ||
1547 | dev_info(wm831x->dev, "WM8326 revision %c\n", 'A' + rev); | ||
1548 | break; | ||
1549 | |||
1544 | default: | 1550 | default: |
1545 | dev_err(wm831x->dev, "Unknown WM831x device %04x\n", ret); | 1551 | dev_err(wm831x->dev, "Unknown WM831x device %04x\n", ret); |
1546 | ret = -EINVAL; | 1552 | ret = -EINVAL; |
@@ -1612,6 +1618,7 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1612 | case WM8320: | 1618 | case WM8320: |
1613 | case WM8321: | 1619 | case WM8321: |
1614 | case WM8325: | 1620 | case WM8325: |
1621 | case WM8326: | ||
1615 | ret = mfd_add_devices(wm831x->dev, -1, | 1622 | ret = mfd_add_devices(wm831x->dev, -1, |
1616 | wm8320_devs, ARRAY_SIZE(wm8320_devs), | 1623 | wm8320_devs, ARRAY_SIZE(wm8320_devs), |
1617 | NULL, wm831x->irq_base); | 1624 | NULL, wm831x->irq_base); |
diff --git a/drivers/mfd/wm831x-i2c.c b/drivers/mfd/wm831x-i2c.c index 156b19859e8..38be5201c78 100644 --- a/drivers/mfd/wm831x-i2c.c +++ b/drivers/mfd/wm831x-i2c.c | |||
@@ -108,6 +108,7 @@ static const struct i2c_device_id wm831x_i2c_id[] = { | |||
108 | { "wm8320", WM8320 }, | 108 | { "wm8320", WM8320 }, |
109 | { "wm8321", WM8321 }, | 109 | { "wm8321", WM8321 }, |
110 | { "wm8325", WM8325 }, | 110 | { "wm8325", WM8325 }, |
111 | { "wm8326", WM8326 }, | ||
111 | { } | 112 | { } |
112 | }; | 113 | }; |
113 | MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id); | 114 | MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id); |
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c index 2789b151b0f..0a8f772be88 100644 --- a/drivers/mfd/wm831x-spi.c +++ b/drivers/mfd/wm831x-spi.c | |||
@@ -81,6 +81,8 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi) | |||
81 | type = WM8321; | 81 | type = WM8321; |
82 | else if (strcmp(spi->modalias, "wm8325") == 0) | 82 | else if (strcmp(spi->modalias, "wm8325") == 0) |
83 | type = WM8325; | 83 | type = WM8325; |
84 | else if (strcmp(spi->modalias, "wm8326") == 0) | ||
85 | type = WM8326; | ||
84 | else { | 86 | else { |
85 | dev_err(&spi->dev, "Unknown device type\n"); | 87 | dev_err(&spi->dev, "Unknown device type\n"); |
86 | return -EINVAL; | 88 | return -EINVAL; |
@@ -184,6 +186,17 @@ static struct spi_driver wm8325_spi_driver = { | |||
184 | .suspend = wm831x_spi_suspend, | 186 | .suspend = wm831x_spi_suspend, |
185 | }; | 187 | }; |
186 | 188 | ||
189 | static struct spi_driver wm8326_spi_driver = { | ||
190 | .driver = { | ||
191 | .name = "wm8326", | ||
192 | .bus = &spi_bus_type, | ||
193 | .owner = THIS_MODULE, | ||
194 | }, | ||
195 | .probe = wm831x_spi_probe, | ||
196 | .remove = __devexit_p(wm831x_spi_remove), | ||
197 | .suspend = wm831x_spi_suspend, | ||
198 | }; | ||
199 | |||
187 | static int __init wm831x_spi_init(void) | 200 | static int __init wm831x_spi_init(void) |
188 | { | 201 | { |
189 | int ret; | 202 | int ret; |
@@ -212,12 +225,17 @@ static int __init wm831x_spi_init(void) | |||
212 | if (ret != 0) | 225 | if (ret != 0) |
213 | pr_err("Failed to register WM8325 SPI driver: %d\n", ret); | 226 | pr_err("Failed to register WM8325 SPI driver: %d\n", ret); |
214 | 227 | ||
228 | ret = spi_register_driver(&wm8326_spi_driver); | ||
229 | if (ret != 0) | ||
230 | pr_err("Failed to register WM8326 SPI driver: %d\n", ret); | ||
231 | |||
215 | return 0; | 232 | return 0; |
216 | } | 233 | } |
217 | subsys_initcall(wm831x_spi_init); | 234 | subsys_initcall(wm831x_spi_init); |
218 | 235 | ||
219 | static void __exit wm831x_spi_exit(void) | 236 | static void __exit wm831x_spi_exit(void) |
220 | { | 237 | { |
238 | spi_unregister_driver(&wm8326_spi_driver); | ||
221 | spi_unregister_driver(&wm8325_spi_driver); | 239 | spi_unregister_driver(&wm8325_spi_driver); |
222 | spi_unregister_driver(&wm8321_spi_driver); | 240 | spi_unregister_driver(&wm8321_spi_driver); |
223 | spi_unregister_driver(&wm8320_spi_driver); | 241 | spi_unregister_driver(&wm8320_spi_driver); |