Skip to content

Commit ca23f8c

Browse files
broonieSamuel Ortiz
authored andcommitted
mfd: Add WM8351 support
The WM8351 is a WM8350 variant. As well as register default changes the WM8351 has fewer voltage and current regulators than the WM8350. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
1 parent 645524a commit ca23f8c

5 files changed

Lines changed: 1112 additions & 0 deletions

File tree

‎drivers/mfd/Kconfig‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ config MFD_WM8350_CONFIG_MODE_3
143143
bool
144144
depends on MFD_WM8350
145145

146+
config MFD_WM8351_CONFIG_MODE_0
147+
bool
148+
depends on MFD_WM8350
149+
150+
config MFD_WM8351_CONFIG_MODE_1
151+
bool
152+
depends on MFD_WM8350
153+
154+
config MFD_WM8351_CONFIG_MODE_2
155+
bool
156+
depends on MFD_WM8350
157+
158+
config MFD_WM8351_CONFIG_MODE_3
159+
bool
160+
depends on MFD_WM8350
161+
146162
config MFD_WM8352_CONFIG_MODE_0
147163
bool
148164
depends on MFD_WM8350

‎drivers/mfd/wm8350-core.c‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,36 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int type, int mode)
11691169
return -EINVAL;
11701170
}
11711171

1172+
case 1:
1173+
switch (mode) {
1174+
#ifdef CONFIG_MFD_WM8351_CONFIG_MODE_0
1175+
case 0:
1176+
reg_map = wm8351_mode0_defaults;
1177+
break;
1178+
#endif
1179+
#ifdef CONFIG_MFD_WM8351_CONFIG_MODE_1
1180+
case 1:
1181+
reg_map = wm8351_mode1_defaults;
1182+
break;
1183+
#endif
1184+
#ifdef CONFIG_MFD_WM8351_CONFIG_MODE_2
1185+
case 2:
1186+
reg_map = wm8351_mode2_defaults;
1187+
break;
1188+
#endif
1189+
#ifdef CONFIG_MFD_WM8351_CONFIG_MODE_3
1190+
case 3:
1191+
reg_map = wm8351_mode3_defaults;
1192+
break;
1193+
#endif
1194+
default:
1195+
dev_err(wm8350->dev,
1196+
"WM8351 configuration mode %d not supported\n",
1197+
mode);
1198+
return -EINVAL;
1199+
}
1200+
break;
1201+
11721202
case 2:
11731203
switch (mode) {
11741204
#ifdef CONFIG_MFD_WM8352_CONFIG_MODE_0
@@ -1327,6 +1357,23 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq,
13271357
}
13281358
break;
13291359

1360+
case 1:
1361+
wm8350->pmic.max_dcdc = WM8350_DCDC_4;
1362+
wm8350->pmic.max_isink = WM8350_ISINK_A;
1363+
1364+
switch (chip_rev) {
1365+
case 0:
1366+
dev_info(wm8350->dev, "WM8351 Rev A\n");
1367+
wm8350->power.rev_g_coeff = 1;
1368+
break;
1369+
1370+
default:
1371+
dev_err(wm8350->dev, "Unknown WM8351 CHIP_REV\n");
1372+
ret = -ENODEV;
1373+
goto err;
1374+
}
1375+
break;
1376+
13301377
case 2:
13311378
wm8350->pmic.max_dcdc = WM8350_DCDC_6;
13321379
wm8350->pmic.max_isink = WM8350_ISINK_B;

‎drivers/mfd/wm8350-i2c.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static int wm8350_i2c_remove(struct i2c_client *i2c)
9797

9898
static const struct i2c_device_id wm8350_i2c_id[] = {
9999
{ "wm8350", 0 },
100+
{ "wm8351", 0 },
100101
{ "wm8352", 0 },
101102
{ }
102103
};

0 commit comments

Comments
 (0)