17 #include <linux/kernel.h>
18 #include <linux/module.h>
29 return 900000 + (selector * 50000);
31 return 1700000 + ((selector - 15) * 100000);
35 int min_uV,
int max_uV)
40 if (min_uV < 900000 || min_uV > 3300000)
48 volt = wm8400_ldo_list_voltage(dev, val);
49 if (volt < min_uV || volt > max_uV)
59 .list_voltage = wm8400_ldo_list_voltage,
62 .map_voltage = wm8400_ldo_map_voltage,
65 static unsigned int wm8400_dcdc_get_mode(
struct regulator_dev *dev)
107 WM8400_DC1_ACTIVE | WM8400_DC1_SLEEP,
118 WM8400_DC1_ACTIVE | WM8400_DC1_SLEEP,
124 WM8400_DC1_ACTIVE | WM8400_DC1_SLEEP, 0);
130 static unsigned int wm8400_dcdc_get_optimum_mode(
struct regulator_dev *dev,
131 int input_uV,
int output_uV,
145 .get_mode = wm8400_dcdc_get_mode,
146 .set_mode = wm8400_dcdc_set_mode,
147 .get_optimum_mode = wm8400_dcdc_get_optimum_mode,
154 .ops = &wm8400_ldo_ops,
166 .ops = &wm8400_ldo_ops,
178 .ops = &wm8400_ldo_ops,
190 .ops = &wm8400_ldo_ops,
202 .ops = &wm8400_dcdc_ops,
216 .ops = &wm8400_dcdc_ops,
231 struct wm8400 *wm8400 =
container_of(pdev,
struct wm8400, regulators[pdev->
id]);
242 return PTR_ERR(rdev);
244 platform_set_drvdata(pdev, rdev);
253 platform_set_drvdata(pdev,
NULL);
261 .name =
"wm8400-regulator",
263 .probe = wm8400_regulator_probe,
297 static int __init wm8400_regulator_init(
void)
303 static void __exit wm8400_regulator_exit(
void)