Lines Matching +full:buck +full:- +full:c
1 // SPDX-License-Identifier: GPL-2.0+
3 // Copyright (c) 2013 Samsung Electronics Co., Ltd
58 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_regulator_set_voltage_time_sel()
61 ramp_delay = s2mpa01->ramp_delay3; in s2mpa01_regulator_set_voltage_time_sel()
64 ramp_delay = s2mpa01->ramp_delay5; in s2mpa01_regulator_set_voltage_time_sel()
68 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_regulator_set_voltage_time_sel()
71 ramp_delay = s2mpa01->ramp_delay7; in s2mpa01_regulator_set_voltage_time_sel()
76 ramp_delay = s2mpa01->ramp_delay8910; in s2mpa01_regulator_set_voltage_time_sel()
81 ramp_delay = rdev->desc->ramp_delay; in s2mpa01_regulator_set_voltage_time_sel()
83 old_volt = rdev->desc->min_uV + (rdev->desc->uV_step * old_selector); in s2mpa01_regulator_set_voltage_time_sel()
84 new_volt = rdev->desc->min_uV + (rdev->desc->uV_step * new_selector); in s2mpa01_regulator_set_voltage_time_sel()
86 return DIV_ROUND_UP(abs(new_volt - old_volt), ramp_delay); in s2mpa01_regulator_set_voltage_time_sel()
104 if (ramp_delay > s2mpa01->ramp_delay16) in s2mpa01_set_ramp_delay()
105 s2mpa01->ramp_delay16 = ramp_delay; in s2mpa01_set_ramp_delay()
107 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_set_ramp_delay()
118 if (ramp_delay > s2mpa01->ramp_delay24) in s2mpa01_set_ramp_delay()
119 s2mpa01->ramp_delay24 = ramp_delay; in s2mpa01_set_ramp_delay()
121 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_set_ramp_delay()
133 s2mpa01->ramp_delay3 = ramp_delay; in s2mpa01_set_ramp_delay()
144 if (ramp_delay > s2mpa01->ramp_delay24) in s2mpa01_set_ramp_delay()
145 s2mpa01->ramp_delay24 = ramp_delay; in s2mpa01_set_ramp_delay()
147 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_set_ramp_delay()
153 s2mpa01->ramp_delay5 = ramp_delay; in s2mpa01_set_ramp_delay()
157 if (ramp_delay > s2mpa01->ramp_delay16) in s2mpa01_set_ramp_delay()
158 s2mpa01->ramp_delay16 = ramp_delay; in s2mpa01_set_ramp_delay()
160 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_set_ramp_delay()
165 s2mpa01->ramp_delay7 = ramp_delay; in s2mpa01_set_ramp_delay()
171 if (ramp_delay > s2mpa01->ramp_delay8910) in s2mpa01_set_ramp_delay()
172 s2mpa01->ramp_delay8910 = ramp_delay; in s2mpa01_set_ramp_delay()
174 ramp_delay = s2mpa01->ramp_delay8910; in s2mpa01_set_ramp_delay()
185 /* Ramp delay can be enabled/disabled only for buck[1234] */ in s2mpa01_set_ramp_delay()
188 ret = regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, in s2mpa01_set_ramp_delay()
191 dev_err(&rdev->dev, "failed to enable ramp rate\n"); in s2mpa01_set_ramp_delay()
198 return regmap_update_bits(rdev->regmap, ramp_reg, 0x3 << ramp_shift, in s2mpa01_set_ramp_delay()
202 return regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, in s2mpa01_set_ramp_delay()
240 .vsel_reg = S2MPA01_REG_L1CTRL + num - 1, \
242 .enable_reg = S2MPA01_REG_L1CTRL + num - 1, \
247 .name = "BUCK"#num, \
248 .of_match = of_match_ptr("BUCK"#num), \
258 .vsel_reg = S2MPA01_REG_B1CTRL2 + (num - 1) * 2, \
260 .enable_reg = S2MPA01_REG_B1CTRL1 + (num - 1) * 2, \
283 .name = "BUCK"#num, \
284 .of_match = of_match_ptr("BUCK"#num), \
294 .vsel_reg = S2MPA01_REG_B6CTRL2 + (num - 6) * 2, \
296 .enable_reg = S2MPA01_REG_B6CTRL1 + (num - 6) * 2, \
341 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); in s2mpa01_pmic_probe()
346 s2mpa01 = devm_kzalloc(&pdev->dev, sizeof(*s2mpa01), GFP_KERNEL); in s2mpa01_pmic_probe()
348 return -ENOMEM; in s2mpa01_pmic_probe()
350 config.dev = iodev->dev; in s2mpa01_pmic_probe()
351 config.regmap = iodev->regmap_pmic; in s2mpa01_pmic_probe()
357 rdev = devm_regulator_register(&pdev->dev, in s2mpa01_pmic_probe()
360 dev_err(&pdev->dev, "regulator init failed for %d\n", in s2mpa01_pmic_probe()
370 { "s2mpa01-pmic", 0},
377 .name = "s2mpa01-pmic",