diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-12-18 17:12:16 -0500 |
---|---|---|
committer | Samuel Ortiz <samuel@sortiz.org> | 2009-01-04 06:17:42 -0500 |
commit | 645524a9c6e1e42dc4fe03217befb20e2fc4d43e (patch) | |
tree | f556620d6695f7257c24cc483b3b9bdde9abfca1 /drivers | |
parent | 53a0d99b1ef14f56baec06eec1e3dad031672b3a (diff) |
mfd: Support configurable numbers of DCDCs and ISINKs on WM8350
Some WM8350 variants have fewer DCDCs and ISINKs. Identify these at
probe and refuse to use the absent DCDCs when running on these chips.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/wm8350-core.c | 6 | ||||
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c index 03af3b12c020..56c363c240a9 100644 --- a/drivers/mfd/wm8350-core.c +++ b/drivers/mfd/wm8350-core.c | |||
@@ -1301,6 +1301,9 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
1301 | 1301 | ||
1302 | switch (mask_rev) { | 1302 | switch (mask_rev) { |
1303 | case 0: | 1303 | case 0: |
1304 | wm8350->pmic.max_dcdc = WM8350_DCDC_6; | ||
1305 | wm8350->pmic.max_isink = WM8350_ISINK_B; | ||
1306 | |||
1304 | switch (chip_rev) { | 1307 | switch (chip_rev) { |
1305 | case WM8350_REV_E: | 1308 | case WM8350_REV_E: |
1306 | dev_info(wm8350->dev, "WM8350 Rev E\n"); | 1309 | dev_info(wm8350->dev, "WM8350 Rev E\n"); |
@@ -1325,6 +1328,9 @@ int wm8350_device_init(struct wm8350 *wm8350, int irq, | |||
1325 | break; | 1328 | break; |
1326 | 1329 | ||
1327 | case 2: | 1330 | case 2: |
1331 | wm8350->pmic.max_dcdc = WM8350_DCDC_6; | ||
1332 | wm8350->pmic.max_isink = WM8350_ISINK_B; | ||
1333 | |||
1328 | switch (chip_rev) { | 1334 | switch (chip_rev) { |
1329 | case 0: | 1335 | case 0: |
1330 | dev_info(wm8350->dev, "WM8352 Rev A\n"); | 1336 | dev_info(wm8350->dev, "WM8352 Rev A\n"); |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 1f44b17e23b1..c68c496b2c49 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1380,6 +1380,13 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg, | |||
1380 | if (wm8350->pmic.pdev[reg]) | 1380 | if (wm8350->pmic.pdev[reg]) |
1381 | return -EBUSY; | 1381 | return -EBUSY; |
1382 | 1382 | ||
1383 | if (reg >= WM8350_DCDC_1 && reg <= WM8350_DCDC_6 && | ||
1384 | reg > wm8350->pmic.max_dcdc) | ||
1385 | return -ENODEV; | ||
1386 | if (reg >= WM8350_ISINK_A && reg <= WM8350_ISINK_B && | ||
1387 | reg > wm8350->pmic.max_isink) | ||
1388 | return -ENODEV; | ||
1389 | |||
1383 | pdev = platform_device_alloc("wm8350-regulator", reg); | 1390 | pdev = platform_device_alloc("wm8350-regulator", reg); |
1384 | if (!pdev) | 1391 | if (!pdev) |
1385 | return -ENOMEM; | 1392 | return -ENOMEM; |