Lines Matching refs:dcdc

62 	struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);  in wm831x_dcdc_get_mode()  local
63 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_get_mode()
64 u16 reg = dcdc->base + WM831X_DCDC_ON_CONFIG; in wm831x_dcdc_get_mode()
116 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_dcdc_set_mode() local
117 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_set_mode()
118 u16 reg = dcdc->base + WM831X_DCDC_ON_CONFIG; in wm831x_dcdc_set_mode()
126 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_dcdc_set_suspend_mode() local
127 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_set_suspend_mode()
128 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL; in wm831x_dcdc_set_suspend_mode()
135 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_dcdc_get_status() local
136 struct wm831x *wm831x = dcdc->wm831x; in wm831x_dcdc_get_status()
179 struct wm831x_dcdc *dcdc = data; in wm831x_dcdc_uv_irq() local
181 regulator_notifier_call_chain(dcdc->regulator, in wm831x_dcdc_uv_irq()
190 struct wm831x_dcdc *dcdc = data; in wm831x_dcdc_oc_irq() local
192 regulator_notifier_call_chain(dcdc->regulator, in wm831x_dcdc_oc_irq()
210 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_buckv_set_dvs() local
212 if (state == dcdc->dvs_gpio_state) in wm831x_buckv_set_dvs()
215 dcdc->dvs_gpio_state = state; in wm831x_buckv_set_dvs()
216 gpiod_set_value(dcdc->dvs_gpiod, state); in wm831x_buckv_set_dvs()
229 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_buckv_set_voltage_sel() local
230 struct wm831x *wm831x = dcdc->wm831x; in wm831x_buckv_set_voltage_sel()
231 int on_reg = dcdc->base + WM831X_DCDC_ON_CONFIG; in wm831x_buckv_set_voltage_sel()
232 int dvs_reg = dcdc->base + WM831X_DCDC_DVS_CONTROL; in wm831x_buckv_set_voltage_sel()
236 if (dcdc->dvs_gpiod && dcdc->on_vsel == vsel) in wm831x_buckv_set_voltage_sel()
239 if (dcdc->dvs_gpiod && dcdc->dvs_vsel == vsel) in wm831x_buckv_set_voltage_sel()
246 dcdc->on_vsel = vsel; in wm831x_buckv_set_voltage_sel()
248 if (!dcdc->dvs_gpiod) in wm831x_buckv_set_voltage_sel()
262 if (vsel > dcdc->dvs_vsel) { in wm831x_buckv_set_voltage_sel()
267 dcdc->dvs_vsel = vsel; in wm831x_buckv_set_voltage_sel()
279 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_buckv_set_suspend_voltage() local
280 struct wm831x *wm831x = dcdc->wm831x; in wm831x_buckv_set_suspend_voltage()
281 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL; in wm831x_buckv_set_suspend_voltage()
293 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_buckv_get_voltage_sel() local
295 if (dcdc->dvs_gpiod && dcdc->dvs_gpio_state) in wm831x_buckv_get_voltage_sel()
296 return dcdc->dvs_vsel; in wm831x_buckv_get_voltage_sel()
298 return dcdc->on_vsel; in wm831x_buckv_get_voltage_sel()
329 struct wm831x_dcdc *dcdc, in wm831x_buckv_dvs_init() argument
332 struct wm831x *wm831x = dcdc->wm831x; in wm831x_buckv_dvs_init()
342 dcdc->dvs_gpio_state = pdata->dvs_init_state; in wm831x_buckv_dvs_init()
344 dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs", in wm831x_buckv_dvs_init()
345 dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW); in wm831x_buckv_dvs_init()
346 if (IS_ERR(dcdc->dvs_gpiod)) { in wm831x_buckv_dvs_init()
348 dcdc->name, PTR_ERR(dcdc->dvs_gpiod)); in wm831x_buckv_dvs_init()
361 pdata->dvs_control_src, dcdc->name); in wm831x_buckv_dvs_init()
368 if (!dcdc->dvs_vsel) { in wm831x_buckv_dvs_init()
370 dcdc->base + WM831X_DCDC_DVS_CONTROL, in wm831x_buckv_dvs_init()
371 WM831X_DC1_DVS_VSEL_MASK, dcdc->on_vsel); in wm831x_buckv_dvs_init()
373 dcdc->dvs_vsel = dcdc->on_vsel; in wm831x_buckv_dvs_init()
379 ret = wm831x_set_bits(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL, in wm831x_buckv_dvs_init()
383 dcdc->name, ret); in wm831x_buckv_dvs_init()
393 struct wm831x_dcdc *dcdc; in wm831x_buckv_probe() local
405 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), in wm831x_buckv_probe()
407 if (!dcdc) in wm831x_buckv_probe()
410 dcdc->wm831x = wm831x; in wm831x_buckv_probe()
418 dcdc->base = res->start; in wm831x_buckv_probe()
420 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1); in wm831x_buckv_probe()
421 dcdc->desc.name = dcdc->name; in wm831x_buckv_probe()
423 snprintf(dcdc->supply_name, sizeof(dcdc->supply_name), in wm831x_buckv_probe()
425 dcdc->desc.supply_name = dcdc->supply_name; in wm831x_buckv_probe()
427 dcdc->desc.id = id; in wm831x_buckv_probe()
428 dcdc->desc.type = REGULATOR_VOLTAGE; in wm831x_buckv_probe()
429 dcdc->desc.n_voltages = WM831X_BUCKV_MAX_SELECTOR + 1; in wm831x_buckv_probe()
430 dcdc->desc.linear_ranges = wm831x_buckv_ranges; in wm831x_buckv_probe()
431 dcdc->desc.n_linear_ranges = ARRAY_SIZE(wm831x_buckv_ranges); in wm831x_buckv_probe()
432 dcdc->desc.ops = &wm831x_buckv_ops; in wm831x_buckv_probe()
433 dcdc->desc.owner = THIS_MODULE; in wm831x_buckv_probe()
434 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; in wm831x_buckv_probe()
435 dcdc->desc.enable_mask = 1 << id; in wm831x_buckv_probe()
436 dcdc->desc.csel_reg = dcdc->base + WM831X_DCDC_CONTROL_2; in wm831x_buckv_probe()
437 dcdc->desc.csel_mask = WM831X_DC1_HC_THR_MASK; in wm831x_buckv_probe()
438 dcdc->desc.n_current_limits = ARRAY_SIZE(wm831x_dcdc_ilim); in wm831x_buckv_probe()
439 dcdc->desc.curr_table = wm831x_dcdc_ilim; in wm831x_buckv_probe()
441 ret = wm831x_reg_read(wm831x, dcdc->base + WM831X_DCDC_ON_CONFIG); in wm831x_buckv_probe()
446 dcdc->on_vsel = ret & WM831X_DC1_ON_VSEL_MASK; in wm831x_buckv_probe()
448 ret = wm831x_reg_read(wm831x, dcdc->base + WM831X_DCDC_DVS_CONTROL); in wm831x_buckv_probe()
453 dcdc->dvs_vsel = ret & WM831X_DC1_DVS_VSEL_MASK; in wm831x_buckv_probe()
455 if (pdata && pdata->dcdc[id]) in wm831x_buckv_probe()
456 wm831x_buckv_dvs_init(pdev, dcdc, in wm831x_buckv_probe()
457 pdata->dcdc[id]->driver_data); in wm831x_buckv_probe()
461 config.init_data = pdata->dcdc[id]; in wm831x_buckv_probe()
462 config.driver_data = dcdc; in wm831x_buckv_probe()
465 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc, in wm831x_buckv_probe()
467 if (IS_ERR(dcdc->regulator)) { in wm831x_buckv_probe()
468 ret = PTR_ERR(dcdc->regulator); in wm831x_buckv_probe()
478 dcdc->name, dcdc); in wm831x_buckv_probe()
489 dcdc->name, dcdc); in wm831x_buckv_probe()
496 platform_set_drvdata(pdev, dcdc); in wm831x_buckv_probe()
517 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_buckp_set_suspend_voltage() local
518 struct wm831x *wm831x = dcdc->wm831x; in wm831x_buckp_set_suspend_voltage()
519 u16 reg = dcdc->base + WM831X_DCDC_SLEEP_CONTROL; in wm831x_buckp_set_suspend_voltage()
551 struct wm831x_dcdc *dcdc; in wm831x_buckp_probe() local
563 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), in wm831x_buckp_probe()
565 if (!dcdc) in wm831x_buckp_probe()
568 dcdc->wm831x = wm831x; in wm831x_buckp_probe()
576 dcdc->base = res->start; in wm831x_buckp_probe()
578 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1); in wm831x_buckp_probe()
579 dcdc->desc.name = dcdc->name; in wm831x_buckp_probe()
581 snprintf(dcdc->supply_name, sizeof(dcdc->supply_name), in wm831x_buckp_probe()
583 dcdc->desc.supply_name = dcdc->supply_name; in wm831x_buckp_probe()
585 dcdc->desc.id = id; in wm831x_buckp_probe()
586 dcdc->desc.type = REGULATOR_VOLTAGE; in wm831x_buckp_probe()
587 dcdc->desc.n_voltages = WM831X_BUCKP_MAX_SELECTOR + 1; in wm831x_buckp_probe()
588 dcdc->desc.ops = &wm831x_buckp_ops; in wm831x_buckp_probe()
589 dcdc->desc.owner = THIS_MODULE; in wm831x_buckp_probe()
590 dcdc->desc.vsel_reg = dcdc->base + WM831X_DCDC_ON_CONFIG; in wm831x_buckp_probe()
591 dcdc->desc.vsel_mask = WM831X_DC3_ON_VSEL_MASK; in wm831x_buckp_probe()
592 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; in wm831x_buckp_probe()
593 dcdc->desc.enable_mask = 1 << id; in wm831x_buckp_probe()
594 dcdc->desc.min_uV = 850000; in wm831x_buckp_probe()
595 dcdc->desc.uV_step = 25000; in wm831x_buckp_probe()
599 config.init_data = pdata->dcdc[id]; in wm831x_buckp_probe()
600 config.driver_data = dcdc; in wm831x_buckp_probe()
603 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc, in wm831x_buckp_probe()
605 if (IS_ERR(dcdc->regulator)) { in wm831x_buckp_probe()
606 ret = PTR_ERR(dcdc->regulator); in wm831x_buckp_probe()
616 dcdc->name, dcdc); in wm831x_buckp_probe()
623 platform_set_drvdata(pdev, dcdc); in wm831x_buckp_probe()
644 struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev); in wm831x_boostp_get_status() local
645 struct wm831x *wm831x = dcdc->wm831x; in wm831x_boostp_get_status()
682 int id = pdev->id % ARRAY_SIZE(pdata->dcdc); in wm831x_boostp_probe()
683 struct wm831x_dcdc *dcdc; in wm831x_boostp_probe() local
689 if (pdata == NULL || pdata->dcdc[id] == NULL) in wm831x_boostp_probe()
692 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); in wm831x_boostp_probe()
693 if (!dcdc) in wm831x_boostp_probe()
696 dcdc->wm831x = wm831x; in wm831x_boostp_probe()
703 dcdc->base = res->start; in wm831x_boostp_probe()
705 snprintf(dcdc->name, sizeof(dcdc->name), "DCDC%d", id + 1); in wm831x_boostp_probe()
706 dcdc->desc.name = dcdc->name; in wm831x_boostp_probe()
707 dcdc->desc.id = id; in wm831x_boostp_probe()
708 dcdc->desc.type = REGULATOR_VOLTAGE; in wm831x_boostp_probe()
709 dcdc->desc.ops = &wm831x_boostp_ops; in wm831x_boostp_probe()
710 dcdc->desc.owner = THIS_MODULE; in wm831x_boostp_probe()
711 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; in wm831x_boostp_probe()
712 dcdc->desc.enable_mask = 1 << id; in wm831x_boostp_probe()
716 config.init_data = pdata->dcdc[id]; in wm831x_boostp_probe()
717 config.driver_data = dcdc; in wm831x_boostp_probe()
720 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc, in wm831x_boostp_probe()
722 if (IS_ERR(dcdc->regulator)) { in wm831x_boostp_probe()
723 ret = PTR_ERR(dcdc->regulator); in wm831x_boostp_probe()
733 dcdc->name, in wm831x_boostp_probe()
734 dcdc); in wm831x_boostp_probe()
741 platform_set_drvdata(pdev, dcdc); in wm831x_boostp_probe()
775 struct wm831x_dcdc *dcdc; in wm831x_epe_probe() local
780 dcdc = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_dcdc), GFP_KERNEL); in wm831x_epe_probe()
781 if (!dcdc) in wm831x_epe_probe()
784 dcdc->wm831x = wm831x; in wm831x_epe_probe()
789 snprintf(dcdc->name, sizeof(dcdc->name), "EPE%d", id + 1); in wm831x_epe_probe()
790 dcdc->desc.name = dcdc->name; in wm831x_epe_probe()
791 dcdc->desc.id = id + WM831X_EPE_BASE; /* Offset in DCDC registers */ in wm831x_epe_probe()
792 dcdc->desc.ops = &wm831x_epe_ops; in wm831x_epe_probe()
793 dcdc->desc.type = REGULATOR_VOLTAGE; in wm831x_epe_probe()
794 dcdc->desc.owner = THIS_MODULE; in wm831x_epe_probe()
795 dcdc->desc.enable_reg = WM831X_DCDC_ENABLE; in wm831x_epe_probe()
796 dcdc->desc.enable_mask = 1 << dcdc->desc.id; in wm831x_epe_probe()
801 config.driver_data = dcdc; in wm831x_epe_probe()
804 dcdc->regulator = devm_regulator_register(&pdev->dev, &dcdc->desc, in wm831x_epe_probe()
806 if (IS_ERR(dcdc->regulator)) { in wm831x_epe_probe()
807 ret = PTR_ERR(dcdc->regulator); in wm831x_epe_probe()
813 platform_set_drvdata(pdev, dcdc); in wm831x_epe_probe()