aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm831x-spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-24 13:01:41 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2011-01-14 06:37:39 -0500
commit412dc11d3fd01f96fdf4a8cbfbc5584a17dab7c8 (patch)
tree8550bcb089afaa1529973ce951c763697e39b312 /drivers/mfd/wm831x-spi.c
parent798e6e321f807c46d81be1572118e031577ea9ab (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/wm831x-spi.c')
-rw-r--r--drivers/mfd/wm831x-spi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index 2789b151b0f9..0a8f772be88c 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
189static 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
187static int __init wm831x_spi_init(void) 200static 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}
217subsys_initcall(wm831x_spi_init); 234subsys_initcall(wm831x_spi_init);
218 235
219static void __exit wm831x_spi_exit(void) 236static 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);