mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-05-02 18:15:03 -04:00
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>
This commit is contained in:
@@ -1380,6 +1380,13 @@ int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
|
||||
if (wm8350->pmic.pdev[reg])
|
||||
return -EBUSY;
|
||||
|
||||
if (reg >= WM8350_DCDC_1 && reg <= WM8350_DCDC_6 &&
|
||||
reg > wm8350->pmic.max_dcdc)
|
||||
return -ENODEV;
|
||||
if (reg >= WM8350_ISINK_A && reg <= WM8350_ISINK_B &&
|
||||
reg > wm8350->pmic.max_isink)
|
||||
return -ENODEV;
|
||||
|
||||
pdev = platform_device_alloc("wm8350-regulator", reg);
|
||||
if (!pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user