Commit 412dc11d authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: Add WM8326 support

The WM8326 is a high performance variant of the WM832x series with
no software visible differences.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 798e6e32
...@@ -1541,6 +1541,12 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) ...@@ -1541,6 +1541,12 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
dev_info(wm831x->dev, "WM8325 revision %c\n", 'A' + rev); dev_info(wm831x->dev, "WM8325 revision %c\n", 'A' + rev);
break; break;
case WM8326:
parent = WM8326;
wm831x->num_gpio = 12;
dev_info(wm831x->dev, "WM8326 revision %c\n", 'A' + rev);
break;
default: default:
dev_err(wm831x->dev, "Unknown WM831x device %04x\n", ret); dev_err(wm831x->dev, "Unknown WM831x device %04x\n", ret);
ret = -EINVAL; ret = -EINVAL;
...@@ -1612,6 +1618,7 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) ...@@ -1612,6 +1618,7 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
case WM8320: case WM8320:
case WM8321: case WM8321:
case WM8325: case WM8325:
case WM8326:
ret = mfd_add_devices(wm831x->dev, -1, ret = mfd_add_devices(wm831x->dev, -1,
wm8320_devs, ARRAY_SIZE(wm8320_devs), wm8320_devs, ARRAY_SIZE(wm8320_devs),
NULL, wm831x->irq_base); NULL, wm831x->irq_base);
......
...@@ -108,6 +108,7 @@ static const struct i2c_device_id wm831x_i2c_id[] = { ...@@ -108,6 +108,7 @@ static const struct i2c_device_id wm831x_i2c_id[] = {
{ "wm8320", WM8320 }, { "wm8320", WM8320 },
{ "wm8321", WM8321 }, { "wm8321", WM8321 },
{ "wm8325", WM8325 }, { "wm8325", WM8325 },
{ "wm8326", WM8326 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id); MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
......
...@@ -81,6 +81,8 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi) ...@@ -81,6 +81,8 @@ static int __devinit wm831x_spi_probe(struct spi_device *spi)
type = WM8321; type = WM8321;
else if (strcmp(spi->modalias, "wm8325") == 0) else if (strcmp(spi->modalias, "wm8325") == 0)
type = WM8325; type = WM8325;
else if (strcmp(spi->modalias, "wm8326") == 0)
type = WM8326;
else { else {
dev_err(&spi->dev, "Unknown device type\n"); dev_err(&spi->dev, "Unknown device type\n");
return -EINVAL; return -EINVAL;
...@@ -184,6 +186,17 @@ static struct spi_driver wm8325_spi_driver = { ...@@ -184,6 +186,17 @@ static struct spi_driver wm8325_spi_driver = {
.suspend = wm831x_spi_suspend, .suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8326_spi_driver = {
.driver = {
.name = "wm8326",
.bus = &spi_bus_type,
.owner = THIS_MODULE,
},
.probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
};
static int __init wm831x_spi_init(void) static int __init wm831x_spi_init(void)
{ {
int ret; int ret;
...@@ -212,12 +225,17 @@ static int __init wm831x_spi_init(void) ...@@ -212,12 +225,17 @@ static int __init wm831x_spi_init(void)
if (ret != 0) if (ret != 0)
pr_err("Failed to register WM8325 SPI driver: %d\n", ret); pr_err("Failed to register WM8325 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8326_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8326 SPI driver: %d\n", ret);
return 0; return 0;
} }
subsys_initcall(wm831x_spi_init); subsys_initcall(wm831x_spi_init);
static void __exit wm831x_spi_exit(void) static void __exit wm831x_spi_exit(void)
{ {
spi_unregister_driver(&wm8326_spi_driver);
spi_unregister_driver(&wm8325_spi_driver); spi_unregister_driver(&wm8325_spi_driver);
spi_unregister_driver(&wm8321_spi_driver); spi_unregister_driver(&wm8321_spi_driver);
spi_unregister_driver(&wm8320_spi_driver); spi_unregister_driver(&wm8320_spi_driver);
......
...@@ -245,6 +245,7 @@ enum wm831x_parent { ...@@ -245,6 +245,7 @@ enum wm831x_parent {
WM8320 = 0x8320, WM8320 = 0x8320,
WM8321 = 0x8321, WM8321 = 0x8321,
WM8325 = 0x8325, WM8325 = 0x8325,
WM8326 = 0x8326,
}; };
struct wm831x { struct wm831x {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment