]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
regulator: Add WM1811 support
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 24 Jul 2011 11:40:48 +0000 (12:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 7 Oct 2011 11:49:18 +0000 (12:49 +0100)
The WM1811 has a slightly different range on LDO2 to other WM8994 class
devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/wm8994-regulator.c

index 1a6a690f24dbecc415c7c7f9c5006573a767ef0b..b87bf5c841f8216a8867db35b23bab5acd0acce2 100644 (file)
@@ -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;
        }