Lines Matching +full:pmic +full:- +full:buck +full:- +full:dvs +full:- +full:gpios

1 // SPDX-License-Identifier: GPL-2.0+
170 *reg = S5M8767_REG_LDO1CTRL + (reg_id - S5M8767_LDO1); in s5m8767_get_register()
173 *reg = S5M8767_REG_LDO3CTRL + (reg_id - S5M8767_LDO3); in s5m8767_get_register()
179 *reg = S5M8767_REG_BUCK2CTRL + (reg_id - S5M8767_BUCK2) * 9; in s5m8767_get_register()
185 *reg = S5M8767_REG_BUCK6CTRL1 + (reg_id - S5M8767_BUCK6) * 2; in s5m8767_get_register()
188 return -EINVAL; in s5m8767_get_register()
191 for (i = 0; i < s5m8767->num_regulators; i++) { in s5m8767_get_register()
192 if (s5m8767->opmode[i].id == reg_id) { in s5m8767_get_register()
193 mode = s5m8767->opmode[i].mode; in s5m8767_get_register()
198 if (i >= s5m8767->num_regulators) in s5m8767_get_register()
199 return -EINVAL; in s5m8767_get_register()
212 reg = S5M8767_REG_LDO1CTRL + (reg_id - S5M8767_LDO1); in s5m8767_get_vsel_reg()
215 reg = S5M8767_REG_LDO3CTRL + (reg_id - S5M8767_LDO3); in s5m8767_get_vsel_reg()
222 if (s5m8767->buck2_gpiodvs) in s5m8767_get_vsel_reg()
223 reg += s5m8767->buck_gpioindex; in s5m8767_get_vsel_reg()
227 if (s5m8767->buck3_gpiodvs) in s5m8767_get_vsel_reg()
228 reg += s5m8767->buck_gpioindex; in s5m8767_get_vsel_reg()
232 if (s5m8767->buck4_gpiodvs) in s5m8767_get_vsel_reg()
233 reg += s5m8767->buck_gpioindex; in s5m8767_get_vsel_reg()
239 reg = S5M8767_REG_BUCK6CTRL2 + (reg_id - S5M8767_BUCK6) * 2; in s5m8767_get_vsel_reg()
242 return -EINVAL; in s5m8767_get_vsel_reg()
254 return -EINVAL; in s5m8767_convert_voltage_to_sel()
256 if (min_vol > desc->max) in s5m8767_convert_voltage_to_sel()
257 return -EINVAL; in s5m8767_convert_voltage_to_sel()
259 if (min_vol < desc->min) in s5m8767_convert_voltage_to_sel()
260 min_vol = desc->min; in s5m8767_convert_voltage_to_sel()
262 selector = DIV_ROUND_UP(min_vol - desc->min, desc->step); in s5m8767_convert_voltage_to_sel()
264 if (desc->min + desc->step * selector > desc->max) in s5m8767_convert_voltage_to_sel()
265 return -EINVAL; in s5m8767_convert_voltage_to_sel()
272 int temp_index = s5m8767->buck_gpioindex; in s5m8767_set_high()
274 gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1); in s5m8767_set_high()
275 gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1); in s5m8767_set_high()
276 gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1); in s5m8767_set_high()
283 int temp_index = s5m8767->buck_gpioindex; in s5m8767_set_low()
285 gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1); in s5m8767_set_low()
286 gpio_set_value(s5m8767->buck_gpios[1], (temp_index >> 1) & 0x1); in s5m8767_set_low()
287 gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1); in s5m8767_set_low()
304 if (reg_id == S5M8767_BUCK2 && s5m8767->buck2_gpiodvs) in s5m8767_set_voltage_sel()
305 buck234_vol = &s5m8767->buck2_vol[0]; in s5m8767_set_voltage_sel()
306 else if (reg_id == S5M8767_BUCK3 && s5m8767->buck3_gpiodvs) in s5m8767_set_voltage_sel()
307 buck234_vol = &s5m8767->buck3_vol[0]; in s5m8767_set_voltage_sel()
308 else if (reg_id == S5M8767_BUCK4 && s5m8767->buck4_gpiodvs) in s5m8767_set_voltage_sel()
309 buck234_vol = &s5m8767->buck4_vol[0]; in s5m8767_set_voltage_sel()
312 return -EINVAL; in s5m8767_set_voltage_sel()
316 return -EINVAL; in s5m8767_set_voltage_sel()
319 /* buck234_vol != NULL means to control buck234 voltage via DVS GPIO */ in s5m8767_set_voltage_sel()
325 old_index = s5m8767->buck_gpioindex; in s5m8767_set_voltage_sel()
326 s5m8767->buck_gpioindex = index; in s5m8767_set_voltage_sel()
343 if ((old_sel < new_sel) && s5m8767->ramp_delay) in s5m8767_set_voltage_time_sel()
344 return DIV_ROUND_UP(rdev->desc->uV_step * (new_sel - old_sel), in s5m8767_set_voltage_time_sel()
345 s5m8767->ramp_delay * 1000); in s5m8767_set_voltage_time_sel()
433 if (rdata->id != S5M8767_BUCK9) in s5m8767_regulator_config_ext_control()
437 for (i = 0; i < s5m8767->num_regulators; i++) { in s5m8767_regulator_config_ext_control()
438 const struct sec_opmode_data *opmode = &s5m8767->opmode[i]; in s5m8767_regulator_config_ext_control()
439 if (opmode->id == rdata->id) { in s5m8767_regulator_config_ext_control()
440 mode = s5m8767_opmode_reg[rdata->id][opmode->mode]; in s5m8767_regulator_config_ext_control()
445 dev_warn(s5m8767->dev, in s5m8767_regulator_config_ext_control()
446 "ext-control for %pOFn: mismatched op_mode (%x), ignoring\n", in s5m8767_regulator_config_ext_control()
447 rdata->reg_node, mode); in s5m8767_regulator_config_ext_control()
451 if (!rdata->ext_control_gpiod) { in s5m8767_regulator_config_ext_control()
452 dev_warn(s5m8767->dev, in s5m8767_regulator_config_ext_control()
453 "ext-control for %pOFn: GPIO not valid, ignoring\n", in s5m8767_regulator_config_ext_control()
454 rdata->reg_node); in s5m8767_regulator_config_ext_control()
458 config->ena_gpiod = rdata->ext_control_gpiod; in s5m8767_regulator_config_ext_control()
471 return -EINVAL; in s5m8767_enable_ext_control()
477 return regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_enable_ext_control()
492 "s5m8767,pmic-buck-dvs-gpios", i); in s5m8767_pmic_dt_parse_dvs_gpio()
494 dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); in s5m8767_pmic_dt_parse_dvs_gpio()
495 return -EINVAL; in s5m8767_pmic_dt_parse_dvs_gpio()
497 pdata->buck_gpios[i] = gpio; in s5m8767_pmic_dt_parse_dvs_gpio()
510 "s5m8767,pmic-buck-ds-gpios", i); in s5m8767_pmic_dt_parse_ds_gpio()
512 dev_err(iodev->dev, "invalid gpio[%d]: %d\n", i, gpio); in s5m8767_pmic_dt_parse_ds_gpio()
513 return -EINVAL; in s5m8767_pmic_dt_parse_ds_gpio()
515 pdata->buck_ds[i] = gpio; in s5m8767_pmic_dt_parse_ds_gpio()
523 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); in s5m8767_pmic_dt_parse_pdata()
529 pmic_np = iodev->dev->of_node; in s5m8767_pmic_dt_parse_pdata()
531 dev_err(iodev->dev, "could not find pmic sub-node\n"); in s5m8767_pmic_dt_parse_pdata()
532 return -ENODEV; in s5m8767_pmic_dt_parse_pdata()
537 dev_err(iodev->dev, "could not find regulators sub-node\n"); in s5m8767_pmic_dt_parse_pdata()
538 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
541 /* count the number of regulators to be supported in pmic */ in s5m8767_pmic_dt_parse_pdata()
542 pdata->num_regulators = of_get_child_count(regulators_np); in s5m8767_pmic_dt_parse_pdata()
544 rdata = devm_kcalloc(&pdev->dev, in s5m8767_pmic_dt_parse_pdata()
545 pdata->num_regulators, sizeof(*rdata), in s5m8767_pmic_dt_parse_pdata()
549 return -ENOMEM; in s5m8767_pmic_dt_parse_pdata()
552 rmode = devm_kcalloc(&pdev->dev, in s5m8767_pmic_dt_parse_pdata()
553 pdata->num_regulators, sizeof(*rmode), in s5m8767_pmic_dt_parse_pdata()
557 return -ENOMEM; in s5m8767_pmic_dt_parse_pdata()
560 pdata->regulators = rdata; in s5m8767_pmic_dt_parse_pdata()
561 pdata->opmode = rmode; in s5m8767_pmic_dt_parse_pdata()
568 dev_warn(iodev->dev, in s5m8767_pmic_dt_parse_pdata()
574 rdata->ext_control_gpiod = devm_fwnode_gpiod_get( in s5m8767_pmic_dt_parse_pdata()
575 &pdev->dev, in s5m8767_pmic_dt_parse_pdata()
577 "s5m8767,pmic-ext-control", in s5m8767_pmic_dt_parse_pdata()
580 if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT) { in s5m8767_pmic_dt_parse_pdata()
581 rdata->ext_control_gpiod = NULL; in s5m8767_pmic_dt_parse_pdata()
582 } else if (IS_ERR(rdata->ext_control_gpiod)) { in s5m8767_pmic_dt_parse_pdata()
585 return PTR_ERR(rdata->ext_control_gpiod); in s5m8767_pmic_dt_parse_pdata()
588 rdata->id = i; in s5m8767_pmic_dt_parse_pdata()
589 rdata->initdata = of_get_regulator_init_data( in s5m8767_pmic_dt_parse_pdata()
590 &pdev->dev, reg_np, in s5m8767_pmic_dt_parse_pdata()
592 rdata->reg_node = reg_np; in s5m8767_pmic_dt_parse_pdata()
594 rmode->id = i; in s5m8767_pmic_dt_parse_pdata()
596 &rmode->mode)) { in s5m8767_pmic_dt_parse_pdata()
597 dev_warn(iodev->dev, in s5m8767_pmic_dt_parse_pdata()
601 rmode->mode = S5M8767_OPMODE_NORMAL_MODE; in s5m8767_pmic_dt_parse_pdata()
608 if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs")) { in s5m8767_pmic_dt_parse_pdata()
609 pdata->buck2_gpiodvs = true; in s5m8767_pmic_dt_parse_pdata()
612 "s5m8767,pmic-buck2-dvs-voltage", in s5m8767_pmic_dt_parse_pdata()
613 pdata->buck2_voltage, dvs_voltage_nr)) { in s5m8767_pmic_dt_parse_pdata()
614 dev_err(iodev->dev, "buck2 voltages not specified\n"); in s5m8767_pmic_dt_parse_pdata()
615 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
619 if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs")) { in s5m8767_pmic_dt_parse_pdata()
620 pdata->buck3_gpiodvs = true; in s5m8767_pmic_dt_parse_pdata()
623 "s5m8767,pmic-buck3-dvs-voltage", in s5m8767_pmic_dt_parse_pdata()
624 pdata->buck3_voltage, dvs_voltage_nr)) { in s5m8767_pmic_dt_parse_pdata()
625 dev_err(iodev->dev, "buck3 voltages not specified\n"); in s5m8767_pmic_dt_parse_pdata()
626 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
630 if (of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs")) { in s5m8767_pmic_dt_parse_pdata()
631 pdata->buck4_gpiodvs = true; in s5m8767_pmic_dt_parse_pdata()
634 "s5m8767,pmic-buck4-dvs-voltage", in s5m8767_pmic_dt_parse_pdata()
635 pdata->buck4_voltage, dvs_voltage_nr)) { in s5m8767_pmic_dt_parse_pdata()
636 dev_err(iodev->dev, "buck4 voltages not specified\n"); in s5m8767_pmic_dt_parse_pdata()
637 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
641 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || in s5m8767_pmic_dt_parse_pdata()
642 pdata->buck4_gpiodvs) { in s5m8767_pmic_dt_parse_pdata()
645 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
648 "s5m8767,pmic-buck-default-dvs-idx", in s5m8767_pmic_dt_parse_pdata()
649 &pdata->buck_default_idx)) { in s5m8767_pmic_dt_parse_pdata()
650 pdata->buck_default_idx = 0; in s5m8767_pmic_dt_parse_pdata()
652 if (pdata->buck_default_idx >= 8) { in s5m8767_pmic_dt_parse_pdata()
653 pdata->buck_default_idx = 0; in s5m8767_pmic_dt_parse_pdata()
654 dev_info(iodev->dev, in s5m8767_pmic_dt_parse_pdata()
655 "invalid value for default dvs index, use 0\n"); in s5m8767_pmic_dt_parse_pdata()
662 return -EINVAL; in s5m8767_pmic_dt_parse_pdata()
664 pdata->buck2_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck2-ramp-enable"); in s5m8767_pmic_dt_parse_pdata()
665 pdata->buck3_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck3-ramp-enable"); in s5m8767_pmic_dt_parse_pdata()
666 pdata->buck4_ramp_enable = of_property_read_bool(pmic_np, "s5m8767,pmic-buck4-ramp-enable"); in s5m8767_pmic_dt_parse_pdata()
668 if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable in s5m8767_pmic_dt_parse_pdata()
669 || pdata->buck4_ramp_enable) { in s5m8767_pmic_dt_parse_pdata()
670 if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay", in s5m8767_pmic_dt_parse_pdata()
671 &pdata->buck_ramp_delay)) in s5m8767_pmic_dt_parse_pdata()
672 pdata->buck_ramp_delay = 0; in s5m8767_pmic_dt_parse_pdata()
687 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); in s5m8767_pmic_probe()
688 struct sec_platform_data *pdata = iodev->pdata; in s5m8767_pmic_probe()
694 dev_err(pdev->dev.parent, "Platform data not supplied\n"); in s5m8767_pmic_probe()
695 return -ENODEV; in s5m8767_pmic_probe()
698 if (iodev->dev->of_node) { in s5m8767_pmic_probe()
704 if (pdata->buck2_gpiodvs) { in s5m8767_pmic_probe()
705 if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) { in s5m8767_pmic_probe()
706 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n"); in s5m8767_pmic_probe()
707 return -EINVAL; in s5m8767_pmic_probe()
711 if (pdata->buck3_gpiodvs) { in s5m8767_pmic_probe()
712 if (pdata->buck2_gpiodvs || pdata->buck4_gpiodvs) { in s5m8767_pmic_probe()
713 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n"); in s5m8767_pmic_probe()
714 return -EINVAL; in s5m8767_pmic_probe()
718 if (pdata->buck4_gpiodvs) { in s5m8767_pmic_probe()
719 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs) { in s5m8767_pmic_probe()
720 dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n"); in s5m8767_pmic_probe()
721 return -EINVAL; in s5m8767_pmic_probe()
725 s5m8767 = devm_kzalloc(&pdev->dev, sizeof(struct s5m8767_info), in s5m8767_pmic_probe()
728 return -ENOMEM; in s5m8767_pmic_probe()
730 s5m8767->dev = &pdev->dev; in s5m8767_pmic_probe()
731 s5m8767->iodev = iodev; in s5m8767_pmic_probe()
732 s5m8767->num_regulators = pdata->num_regulators; in s5m8767_pmic_probe()
735 s5m8767->buck_gpioindex = pdata->buck_default_idx; in s5m8767_pmic_probe()
736 s5m8767->buck2_gpiodvs = pdata->buck2_gpiodvs; in s5m8767_pmic_probe()
737 s5m8767->buck3_gpiodvs = pdata->buck3_gpiodvs; in s5m8767_pmic_probe()
738 s5m8767->buck4_gpiodvs = pdata->buck4_gpiodvs; in s5m8767_pmic_probe()
739 s5m8767->buck_gpios[0] = pdata->buck_gpios[0]; in s5m8767_pmic_probe()
740 s5m8767->buck_gpios[1] = pdata->buck_gpios[1]; in s5m8767_pmic_probe()
741 s5m8767->buck_gpios[2] = pdata->buck_gpios[2]; in s5m8767_pmic_probe()
742 s5m8767->buck_ds[0] = pdata->buck_ds[0]; in s5m8767_pmic_probe()
743 s5m8767->buck_ds[1] = pdata->buck_ds[1]; in s5m8767_pmic_probe()
744 s5m8767->buck_ds[2] = pdata->buck_ds[2]; in s5m8767_pmic_probe()
746 s5m8767->ramp_delay = pdata->buck_ramp_delay; in s5m8767_pmic_probe()
747 s5m8767->buck2_ramp = pdata->buck2_ramp_enable; in s5m8767_pmic_probe()
748 s5m8767->buck3_ramp = pdata->buck3_ramp_enable; in s5m8767_pmic_probe()
749 s5m8767->buck4_ramp = pdata->buck4_ramp_enable; in s5m8767_pmic_probe()
750 s5m8767->opmode = pdata->opmode; in s5m8767_pmic_probe()
753 pdata->buck2_init); in s5m8767_pmic_probe()
755 regmap_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK2DVS2, in s5m8767_pmic_probe()
759 pdata->buck3_init); in s5m8767_pmic_probe()
761 regmap_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK3DVS2, in s5m8767_pmic_probe()
765 pdata->buck4_init); in s5m8767_pmic_probe()
767 regmap_write(s5m8767->iodev->regmap_pmic, S5M8767_REG_BUCK4DVS2, in s5m8767_pmic_probe()
771 if (s5m8767->buck2_gpiodvs) { in s5m8767_pmic_probe()
772 s5m8767->buck2_vol[i] = in s5m8767_pmic_probe()
775 pdata->buck2_voltage[i]); in s5m8767_pmic_probe()
778 if (s5m8767->buck3_gpiodvs) { in s5m8767_pmic_probe()
779 s5m8767->buck3_vol[i] = in s5m8767_pmic_probe()
782 pdata->buck3_voltage[i]); in s5m8767_pmic_probe()
785 if (s5m8767->buck4_gpiodvs) { in s5m8767_pmic_probe()
786 s5m8767->buck4_vol[i] = in s5m8767_pmic_probe()
789 pdata->buck4_voltage[i]); in s5m8767_pmic_probe()
793 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || in s5m8767_pmic_probe()
794 pdata->buck4_gpiodvs) { in s5m8767_pmic_probe()
796 if (!gpio_is_valid(pdata->buck_gpios[0]) || in s5m8767_pmic_probe()
797 !gpio_is_valid(pdata->buck_gpios[1]) || in s5m8767_pmic_probe()
798 !gpio_is_valid(pdata->buck_gpios[2])) { in s5m8767_pmic_probe()
799 dev_err(&pdev->dev, "GPIO NOT VALID\n"); in s5m8767_pmic_probe()
800 return -EINVAL; in s5m8767_pmic_probe()
803 ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0], in s5m8767_pmic_probe()
808 ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[1], in s5m8767_pmic_probe()
813 ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[2], in s5m8767_pmic_probe()
819 gpio_direction_output(pdata->buck_gpios[0], in s5m8767_pmic_probe()
820 (s5m8767->buck_gpioindex >> 2) & 0x1); in s5m8767_pmic_probe()
822 gpio_direction_output(pdata->buck_gpios[1], in s5m8767_pmic_probe()
823 (s5m8767->buck_gpioindex >> 1) & 0x1); in s5m8767_pmic_probe()
825 gpio_direction_output(pdata->buck_gpios[2], in s5m8767_pmic_probe()
826 (s5m8767->buck_gpioindex >> 0) & 0x1); in s5m8767_pmic_probe()
829 ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[0], "S5M8767 DS2"); in s5m8767_pmic_probe()
833 ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[1], "S5M8767 DS3"); in s5m8767_pmic_probe()
837 ret = devm_gpio_request(&pdev->dev, pdata->buck_ds[2], "S5M8767 DS4"); in s5m8767_pmic_probe()
842 gpio_direction_output(pdata->buck_ds[0], 0x0); in s5m8767_pmic_probe()
844 gpio_direction_output(pdata->buck_ds[1], 0x0); in s5m8767_pmic_probe()
846 gpio_direction_output(pdata->buck_ds[2], 0x0); in s5m8767_pmic_probe()
848 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
850 (pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1)); in s5m8767_pmic_probe()
851 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
853 (pdata->buck3_gpiodvs) ? (1 << 1) : (0 << 1)); in s5m8767_pmic_probe()
854 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
856 (pdata->buck4_gpiodvs) ? (1 << 1) : (0 << 1)); in s5m8767_pmic_probe()
858 /* Initialize GPIO DVS registers */ in s5m8767_pmic_probe()
860 if (s5m8767->buck2_gpiodvs) { in s5m8767_pmic_probe()
861 regmap_write(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
863 s5m8767->buck2_vol[i]); in s5m8767_pmic_probe()
866 if (s5m8767->buck3_gpiodvs) { in s5m8767_pmic_probe()
867 regmap_write(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
869 s5m8767->buck3_vol[i]); in s5m8767_pmic_probe()
872 if (s5m8767->buck4_gpiodvs) { in s5m8767_pmic_probe()
873 regmap_write(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
875 s5m8767->buck4_vol[i]); in s5m8767_pmic_probe()
879 if (s5m8767->buck2_ramp) in s5m8767_pmic_probe()
880 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
883 if (s5m8767->buck3_ramp) in s5m8767_pmic_probe()
884 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
887 if (s5m8767->buck4_ramp) in s5m8767_pmic_probe()
888 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
891 if (s5m8767->buck2_ramp || s5m8767->buck3_ramp in s5m8767_pmic_probe()
892 || s5m8767->buck4_ramp) { in s5m8767_pmic_probe()
894 switch (s5m8767->ramp_delay) { in s5m8767_pmic_probe()
913 regmap_update_bits(s5m8767->iodev->regmap_pmic, in s5m8767_pmic_probe()
919 for (i = 0; i < pdata->num_regulators; i++) { in s5m8767_pmic_probe()
921 unsigned int id = pdata->regulators[i].id; in s5m8767_pmic_probe()
932 (desc->max - desc->min) / desc->step + 1; in s5m8767_pmic_probe()
933 regulators[id].min_uV = desc->min; in s5m8767_pmic_probe()
934 regulators[id].uV_step = desc->step; in s5m8767_pmic_probe()
945 dev_err(s5m8767->dev, "error reading registers\n"); in s5m8767_pmic_probe()
953 config.dev = s5m8767->dev; in s5m8767_pmic_probe()
954 config.init_data = pdata->regulators[i].initdata; in s5m8767_pmic_probe()
956 config.regmap = iodev->regmap_pmic; in s5m8767_pmic_probe()
957 config.of_node = pdata->regulators[i].reg_node; in s5m8767_pmic_probe()
959 if (pdata->regulators[i].ext_control_gpiod) { in s5m8767_pmic_probe()
962 &pdata->regulators[i], &config); in s5m8767_pmic_probe()
968 devm_gpiod_unhinge(s5m8767->dev, config.ena_gpiod); in s5m8767_pmic_probe()
970 rdev = devm_regulator_register(&pdev->dev, &regulators[id], in s5m8767_pmic_probe()
974 dev_err(s5m8767->dev, "regulator init failed for %d\n", in s5m8767_pmic_probe()
979 if (pdata->regulators[i].ext_control_gpiod) { in s5m8767_pmic_probe()
982 dev_err(s5m8767->dev, in s5m8767_pmic_probe()
984 rdev->desc->name, ret); in s5m8767_pmic_probe()
994 { "s5m8767-pmic", 0},
1001 .name = "s5m8767-pmic",