Commit e5d4ef0d authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Lee Jones

mfd: arizona: Add support for WM8280/WM8281

This adds support for the Wolfson Microelectronics WM8280 and WM8281
codecs.
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
[Lee: Minor fixup to remove potentially uninitialised variable. ]
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent c517d838
...@@ -1289,10 +1289,11 @@ config MFD_WM5102 ...@@ -1289,10 +1289,11 @@ config MFD_WM5102
Support for Wolfson Microelectronics WM5102 low power audio SoC Support for Wolfson Microelectronics WM5102 low power audio SoC
config MFD_WM5110 config MFD_WM5110
bool "Wolfson Microelectronics WM5110" bool "Wolfson Microelectronics WM5110 and WM8280/WM8281"
depends on MFD_ARIZONA depends on MFD_ARIZONA
help help
Support for Wolfson Microelectronics WM5110 low power audio SoC Support for Wolfson Microelectronics WM5110 and WM8280/WM8281
low power audio SoC
config MFD_WM8997 config MFD_WM8997
bool "Wolfson Microelectronics WM8997" bool "Wolfson Microelectronics WM8997"
......
...@@ -567,6 +567,7 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) ...@@ -567,6 +567,7 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
const struct of_device_id arizona_of_match[] = { const struct of_device_id arizona_of_match[] = {
{ .compatible = "wlf,wm5102", .data = (void *)WM5102 }, { .compatible = "wlf,wm5102", .data = (void *)WM5102 },
{ .compatible = "wlf,wm5110", .data = (void *)WM5110 }, { .compatible = "wlf,wm5110", .data = (void *)WM5110 },
{ .compatible = "wlf,wm8280", .data = (void *)WM8280 },
{ .compatible = "wlf,wm8997", .data = (void *)WM8997 }, { .compatible = "wlf,wm8997", .data = (void *)WM8997 },
{}, {},
}; };
...@@ -671,6 +672,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -671,6 +672,7 @@ int arizona_dev_init(struct arizona *arizona)
switch (arizona->type) { switch (arizona->type) {
case WM5102: case WM5102:
case WM5110: case WM5110:
case WM8280:
case WM8997: case WM8997:
for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++) for (i = 0; i < ARRAY_SIZE(wm5102_core_supplies); i++)
arizona->core_supplies[i].supply arizona->core_supplies[i].supply
...@@ -834,11 +836,19 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -834,11 +836,19 @@ int arizona_dev_init(struct arizona *arizona)
#endif #endif
#ifdef CONFIG_MFD_WM5110 #ifdef CONFIG_MFD_WM5110
case 0x5110: case 0x5110:
switch (arizona->type) {
case WM5110:
type_name = "WM5110";
break;
case WM8280:
type_name = "WM8280";
break;
default:
type_name = "WM5110"; type_name = "WM5110";
if (arizona->type != WM5110) {
dev_err(arizona->dev, "WM5110 registered as %d\n", dev_err(arizona->dev, "WM5110 registered as %d\n",
arizona->type); arizona->type);
arizona->type = WM5110; arizona->type = WM5110;
break;
} }
apply_patch = wm5110_patch; apply_patch = wm5110_patch;
break; break;
...@@ -1010,6 +1020,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -1010,6 +1020,7 @@ int arizona_dev_init(struct arizona *arizona)
ARRAY_SIZE(wm5102_devs), NULL, 0, NULL); ARRAY_SIZE(wm5102_devs), NULL, 0, NULL);
break; break;
case WM5110: case WM5110:
case WM8280:
ret = mfd_add_devices(arizona->dev, -1, wm5110_devs, ret = mfd_add_devices(arizona->dev, -1, wm5110_devs,
ARRAY_SIZE(wm5110_devs), NULL, 0, NULL); ARRAY_SIZE(wm5110_devs), NULL, 0, NULL);
break; break;
......
...@@ -44,6 +44,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c, ...@@ -44,6 +44,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
#endif #endif
#ifdef CONFIG_MFD_WM5110 #ifdef CONFIG_MFD_WM5110
case WM5110: case WM5110:
case WM8280:
regmap_config = &wm5110_i2c_regmap; regmap_config = &wm5110_i2c_regmap;
break; break;
#endif #endif
...@@ -87,6 +88,7 @@ static int arizona_i2c_remove(struct i2c_client *i2c) ...@@ -87,6 +88,7 @@ static int arizona_i2c_remove(struct i2c_client *i2c)
static const struct i2c_device_id arizona_i2c_id[] = { static const struct i2c_device_id arizona_i2c_id[] = {
{ "wm5102", WM5102 }, { "wm5102", WM5102 },
{ "wm5110", WM5110 }, { "wm5110", WM5110 },
{ "wm8280", WM8280 },
{ "wm8997", WM8997 }, { "wm8997", WM8997 },
{ } { }
}; };
......
...@@ -211,6 +211,7 @@ int arizona_irq_init(struct arizona *arizona) ...@@ -211,6 +211,7 @@ int arizona_irq_init(struct arizona *arizona)
#endif #endif
#ifdef CONFIG_MFD_WM5110 #ifdef CONFIG_MFD_WM5110
case WM5110: case WM5110:
case WM8280:
aod = &wm5110_aod; aod = &wm5110_aod;
switch (arizona->rev) { switch (arizona->rev) {
......
...@@ -44,6 +44,7 @@ static int arizona_spi_probe(struct spi_device *spi) ...@@ -44,6 +44,7 @@ static int arizona_spi_probe(struct spi_device *spi)
#endif #endif
#ifdef CONFIG_MFD_WM5110 #ifdef CONFIG_MFD_WM5110
case WM5110: case WM5110:
case WM8280:
regmap_config = &wm5110_spi_regmap; regmap_config = &wm5110_spi_regmap;
break; break;
#endif #endif
...@@ -84,6 +85,7 @@ static int arizona_spi_remove(struct spi_device *spi) ...@@ -84,6 +85,7 @@ static int arizona_spi_remove(struct spi_device *spi)
static const struct spi_device_id arizona_spi_ids[] = { static const struct spi_device_id arizona_spi_ids[] = {
{ "wm5102", WM5102 }, { "wm5102", WM5102 },
{ "wm5110", WM5110 }, { "wm5110", WM5110 },
{ "wm8280", WM8280 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(spi, arizona_spi_ids); MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
......
...@@ -24,6 +24,7 @@ enum arizona_type { ...@@ -24,6 +24,7 @@ enum arizona_type {
WM5102 = 1, WM5102 = 1,
WM5110 = 2, WM5110 = 2,
WM8997 = 3, WM8997 = 3,
WM8280 = 4,
}; };
#define ARIZONA_IRQ_GP1 0 #define ARIZONA_IRQ_GP1 0
......
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