Lines Matching refs:ldo

52 	struct wm831x_ldo *ldo = data;  in wm831x_ldo_uv_irq()  local
54 regulator_notifier_call_chain(ldo->regulator, in wm831x_ldo_uv_irq()
73 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_gp_ldo_set_suspend_voltage() local
74 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_set_suspend_voltage()
75 int sel, reg = ldo->base + WM831X_LDO_SLEEP_CONTROL; in wm831x_gp_ldo_set_suspend_voltage()
86 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_gp_ldo_get_mode() local
87 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_get_mode()
88 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL; in wm831x_gp_ldo_get_mode()
89 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_gp_ldo_get_mode()
112 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_gp_ldo_set_mode() local
113 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_set_mode()
114 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL; in wm831x_gp_ldo_set_mode()
115 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_gp_ldo_set_mode()
163 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_gp_ldo_get_status() local
164 struct wm831x *wm831x = ldo->wm831x; in wm831x_gp_ldo_get_status()
225 struct wm831x_ldo *ldo; in wm831x_gp_ldo_probe() local
237 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); in wm831x_gp_ldo_probe()
238 if (!ldo) in wm831x_gp_ldo_probe()
241 ldo->wm831x = wm831x; in wm831x_gp_ldo_probe()
249 ldo->base = res->start; in wm831x_gp_ldo_probe()
251 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); in wm831x_gp_ldo_probe()
252 ldo->desc.name = ldo->name; in wm831x_gp_ldo_probe()
254 snprintf(ldo->supply_name, sizeof(ldo->supply_name), in wm831x_gp_ldo_probe()
256 ldo->desc.supply_name = ldo->supply_name; in wm831x_gp_ldo_probe()
258 ldo->desc.id = id; in wm831x_gp_ldo_probe()
259 ldo->desc.type = REGULATOR_VOLTAGE; in wm831x_gp_ldo_probe()
260 ldo->desc.n_voltages = 32; in wm831x_gp_ldo_probe()
261 ldo->desc.ops = &wm831x_gp_ldo_ops; in wm831x_gp_ldo_probe()
262 ldo->desc.owner = THIS_MODULE; in wm831x_gp_ldo_probe()
263 ldo->desc.vsel_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_gp_ldo_probe()
264 ldo->desc.vsel_mask = WM831X_LDO1_ON_VSEL_MASK; in wm831x_gp_ldo_probe()
265 ldo->desc.enable_reg = WM831X_LDO_ENABLE; in wm831x_gp_ldo_probe()
266 ldo->desc.enable_mask = 1 << id; in wm831x_gp_ldo_probe()
267 ldo->desc.bypass_reg = ldo->base; in wm831x_gp_ldo_probe()
268 ldo->desc.bypass_mask = WM831X_LDO1_SWI; in wm831x_gp_ldo_probe()
269 ldo->desc.linear_ranges = wm831x_gp_ldo_ranges; in wm831x_gp_ldo_probe()
270 ldo->desc.n_linear_ranges = ARRAY_SIZE(wm831x_gp_ldo_ranges); in wm831x_gp_ldo_probe()
274 config.init_data = pdata->ldo[id]; in wm831x_gp_ldo_probe()
275 config.driver_data = ldo; in wm831x_gp_ldo_probe()
278 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, in wm831x_gp_ldo_probe()
280 if (IS_ERR(ldo->regulator)) { in wm831x_gp_ldo_probe()
281 ret = PTR_ERR(ldo->regulator); in wm831x_gp_ldo_probe()
291 ldo->name, in wm831x_gp_ldo_probe()
292 ldo); in wm831x_gp_ldo_probe()
299 platform_set_drvdata(pdev, ldo); in wm831x_gp_ldo_probe()
326 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_aldo_set_suspend_voltage() local
327 struct wm831x *wm831x = ldo->wm831x; in wm831x_aldo_set_suspend_voltage()
328 int sel, reg = ldo->base + WM831X_LDO_SLEEP_CONTROL; in wm831x_aldo_set_suspend_voltage()
339 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_aldo_get_mode() local
340 struct wm831x *wm831x = ldo->wm831x; in wm831x_aldo_get_mode()
341 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_aldo_get_mode()
357 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_aldo_set_mode() local
358 struct wm831x *wm831x = ldo->wm831x; in wm831x_aldo_set_mode()
359 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_aldo_set_mode()
386 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_aldo_get_status() local
387 struct wm831x *wm831x = ldo->wm831x; in wm831x_aldo_get_status()
435 struct wm831x_ldo *ldo; in wm831x_aldo_probe() local
447 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); in wm831x_aldo_probe()
448 if (!ldo) in wm831x_aldo_probe()
451 ldo->wm831x = wm831x; in wm831x_aldo_probe()
459 ldo->base = res->start; in wm831x_aldo_probe()
461 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); in wm831x_aldo_probe()
462 ldo->desc.name = ldo->name; in wm831x_aldo_probe()
464 snprintf(ldo->supply_name, sizeof(ldo->supply_name), in wm831x_aldo_probe()
466 ldo->desc.supply_name = ldo->supply_name; in wm831x_aldo_probe()
468 ldo->desc.id = id; in wm831x_aldo_probe()
469 ldo->desc.type = REGULATOR_VOLTAGE; in wm831x_aldo_probe()
470 ldo->desc.n_voltages = 32; in wm831x_aldo_probe()
471 ldo->desc.linear_ranges = wm831x_aldo_ranges; in wm831x_aldo_probe()
472 ldo->desc.n_linear_ranges = ARRAY_SIZE(wm831x_aldo_ranges); in wm831x_aldo_probe()
473 ldo->desc.ops = &wm831x_aldo_ops; in wm831x_aldo_probe()
474 ldo->desc.owner = THIS_MODULE; in wm831x_aldo_probe()
475 ldo->desc.vsel_reg = ldo->base + WM831X_LDO_ON_CONTROL; in wm831x_aldo_probe()
476 ldo->desc.vsel_mask = WM831X_LDO7_ON_VSEL_MASK; in wm831x_aldo_probe()
477 ldo->desc.enable_reg = WM831X_LDO_ENABLE; in wm831x_aldo_probe()
478 ldo->desc.enable_mask = 1 << id; in wm831x_aldo_probe()
479 ldo->desc.bypass_reg = ldo->base; in wm831x_aldo_probe()
480 ldo->desc.bypass_mask = WM831X_LDO7_SWI; in wm831x_aldo_probe()
484 config.init_data = pdata->ldo[id]; in wm831x_aldo_probe()
485 config.driver_data = ldo; in wm831x_aldo_probe()
488 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, in wm831x_aldo_probe()
490 if (IS_ERR(ldo->regulator)) { in wm831x_aldo_probe()
491 ret = PTR_ERR(ldo->regulator); in wm831x_aldo_probe()
501 ldo->name, ldo); in wm831x_aldo_probe()
508 platform_set_drvdata(pdev, ldo); in wm831x_aldo_probe()
532 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_alive_ldo_set_suspend_voltage() local
533 struct wm831x *wm831x = ldo->wm831x; in wm831x_alive_ldo_set_suspend_voltage()
534 int sel, reg = ldo->base + WM831X_ALIVE_LDO_SLEEP_CONTROL; in wm831x_alive_ldo_set_suspend_voltage()
545 struct wm831x_ldo *ldo = rdev_get_drvdata(rdev); in wm831x_alive_ldo_get_status() local
546 struct wm831x *wm831x = ldo->wm831x; in wm831x_alive_ldo_get_status()
579 struct wm831x_ldo *ldo; in wm831x_alive_ldo_probe() local
592 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); in wm831x_alive_ldo_probe()
593 if (!ldo) in wm831x_alive_ldo_probe()
596 ldo->wm831x = wm831x; in wm831x_alive_ldo_probe()
604 ldo->base = res->start; in wm831x_alive_ldo_probe()
606 snprintf(ldo->name, sizeof(ldo->name), "LDO%d", id + 1); in wm831x_alive_ldo_probe()
607 ldo->desc.name = ldo->name; in wm831x_alive_ldo_probe()
609 snprintf(ldo->supply_name, sizeof(ldo->supply_name), in wm831x_alive_ldo_probe()
611 ldo->desc.supply_name = ldo->supply_name; in wm831x_alive_ldo_probe()
613 ldo->desc.id = id; in wm831x_alive_ldo_probe()
614 ldo->desc.type = REGULATOR_VOLTAGE; in wm831x_alive_ldo_probe()
615 ldo->desc.n_voltages = WM831X_ALIVE_LDO_MAX_SELECTOR + 1; in wm831x_alive_ldo_probe()
616 ldo->desc.ops = &wm831x_alive_ldo_ops; in wm831x_alive_ldo_probe()
617 ldo->desc.owner = THIS_MODULE; in wm831x_alive_ldo_probe()
618 ldo->desc.vsel_reg = ldo->base + WM831X_ALIVE_LDO_ON_CONTROL; in wm831x_alive_ldo_probe()
619 ldo->desc.vsel_mask = WM831X_LDO11_ON_VSEL_MASK; in wm831x_alive_ldo_probe()
620 ldo->desc.enable_reg = WM831X_LDO_ENABLE; in wm831x_alive_ldo_probe()
621 ldo->desc.enable_mask = 1 << id; in wm831x_alive_ldo_probe()
622 ldo->desc.min_uV = 800000; in wm831x_alive_ldo_probe()
623 ldo->desc.uV_step = 50000; in wm831x_alive_ldo_probe()
624 ldo->desc.enable_time = 1000; in wm831x_alive_ldo_probe()
628 config.init_data = pdata->ldo[id]; in wm831x_alive_ldo_probe()
629 config.driver_data = ldo; in wm831x_alive_ldo_probe()
632 ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, in wm831x_alive_ldo_probe()
634 if (IS_ERR(ldo->regulator)) { in wm831x_alive_ldo_probe()
635 ret = PTR_ERR(ldo->regulator); in wm831x_alive_ldo_probe()
641 platform_set_drvdata(pdev, ldo); in wm831x_alive_ldo_probe()