From: Mark Brown Date: Sun, 24 Jul 2011 11:40:48 +0000 (+0100) Subject: regulator: Add WM1811 support X-Git-Tag: v3.3-rc1~14^2~534 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1ff89ef3cd6515d378f946db5f3760089bb644e;p=platform%2Fkernel%2Flinux-exynos.git regulator: Add WM1811 support The WM1811 has a slightly different range on LDO2 to other WM8994 class devices. Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 1a6a690..b87bf5c 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c @@ -140,6 +140,14 @@ static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev, return (selector * 100000) + 900000; case WM8958: return (selector * 100000) + 1000000; + case WM1811: + switch (selector) { + case 0: + return -EINVAL; + default: + return (selector * 100000) + 950000; + } + break; default: return -EINVAL; } @@ -170,6 +178,11 @@ static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev, case WM8958: selector = (min_uV - 1000000) / 100000; break; + case WM1811: + selector = (min_uV - 950000) / 100000; + if (selector == 0) + selector = 1; + break; default: return -EINVAL; }