Lines Matching refs:ldo
40 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo_enable() local
43 if (!ldo->enable) in wm8994_ldo_enable()
46 gpio_set_value(ldo->enable, 1); in wm8994_ldo_enable()
47 ldo->is_enabled = true; in wm8994_ldo_enable()
54 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo_disable() local
57 if (!ldo->enable) in wm8994_ldo_disable()
60 gpio_set_value(ldo->enable, 0); in wm8994_ldo_disable()
61 ldo->is_enabled = false; in wm8994_ldo_disable()
68 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo_is_enabled() local
70 return ldo->is_enabled; in wm8994_ldo_is_enabled()
91 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo1_get_voltage_sel() local
94 val = wm8994_reg_read(ldo->wm8994, WM8994_LDO_1); in wm8994_ldo1_get_voltage_sel()
104 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo1_set_voltage() local
115 return wm8994_set_bits(ldo->wm8994, WM8994_LDO_1, in wm8994_ldo1_set_voltage()
133 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo2_list_voltage() local
138 switch (ldo->wm8994->type) { in wm8994_ldo2_list_voltage()
150 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo2_get_voltage_sel() local
153 val = wm8994_reg_read(ldo->wm8994, WM8994_LDO_2); in wm8994_ldo2_get_voltage_sel()
163 struct wm8994_ldo *ldo = rdev_get_drvdata(rdev); in wm8994_ldo2_set_voltage() local
166 switch (ldo->wm8994->type) { in wm8994_ldo2_set_voltage()
184 return wm8994_set_bits(ldo->wm8994, WM8994_LDO_2, in wm8994_ldo2_set_voltage()
222 int id = pdev->id % ARRAY_SIZE(pdata->ldo); in wm8994_ldo_probe()
223 struct wm8994_ldo *ldo; in wm8994_ldo_probe() local
231 ldo = kzalloc(sizeof(struct wm8994_ldo), GFP_KERNEL); in wm8994_ldo_probe()
232 if (ldo == NULL) { in wm8994_ldo_probe()
237 ldo->wm8994 = wm8994; in wm8994_ldo_probe()
239 if (pdata->ldo[id].enable && gpio_is_valid(pdata->ldo[id].enable)) { in wm8994_ldo_probe()
240 ldo->enable = pdata->ldo[id].enable; in wm8994_ldo_probe()
242 ret = gpio_request(ldo->enable, "WM8994 LDO enable"); in wm8994_ldo_probe()
249 ret = gpio_direction_output(ldo->enable, ldo->is_enabled); in wm8994_ldo_probe()
256 ldo->is_enabled = true; in wm8994_ldo_probe()
258 ldo->regulator = regulator_register(&wm8994_ldo_desc[id], &pdev->dev, in wm8994_ldo_probe()
259 pdata->ldo[id].init_data, ldo); in wm8994_ldo_probe()
260 if (IS_ERR(ldo->regulator)) { in wm8994_ldo_probe()
261 ret = PTR_ERR(ldo->regulator); in wm8994_ldo_probe()
267 platform_set_drvdata(pdev, ldo); in wm8994_ldo_probe()
272 if (gpio_is_valid(ldo->enable)) in wm8994_ldo_probe()
273 gpio_free(ldo->enable); in wm8994_ldo_probe()
275 kfree(ldo); in wm8994_ldo_probe()
281 struct wm8994_ldo *ldo = platform_get_drvdata(pdev); in wm8994_ldo_remove() local
285 regulator_unregister(ldo->regulator); in wm8994_ldo_remove()
286 if (gpio_is_valid(ldo->enable)) in wm8994_ldo_remove()
287 gpio_free(ldo->enable); in wm8994_ldo_remove()
288 kfree(ldo); in wm8994_ldo_remove()