• Home
  • Raw
  • Download

Lines Matching +full:s2mpa01 +full:- +full:pmic

1 // SPDX-License-Identifier: GPL-2.0+
18 #include <linux/mfd/samsung/s2mpa01.h>
52 struct s2mpa01_info *s2mpa01 = rdev_get_drvdata(rdev); in s2mpa01_regulator_set_voltage_time_sel() local
59 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_regulator_set_voltage_time_sel()
62 ramp_delay = s2mpa01->ramp_delay3; in s2mpa01_regulator_set_voltage_time_sel()
65 ramp_delay = s2mpa01->ramp_delay5; in s2mpa01_regulator_set_voltage_time_sel()
69 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_regulator_set_voltage_time_sel()
72 ramp_delay = s2mpa01->ramp_delay7; in s2mpa01_regulator_set_voltage_time_sel()
77 ramp_delay = s2mpa01->ramp_delay8910; in s2mpa01_regulator_set_voltage_time_sel()
82 ramp_delay = rdev->desc->ramp_delay; in s2mpa01_regulator_set_voltage_time_sel()
84 old_volt = rdev->desc->min_uV + (rdev->desc->uV_step * old_selector); in s2mpa01_regulator_set_voltage_time_sel()
85 new_volt = rdev->desc->min_uV + (rdev->desc->uV_step * new_selector); in s2mpa01_regulator_set_voltage_time_sel()
87 return DIV_ROUND_UP(abs(new_volt - old_volt), ramp_delay); in s2mpa01_regulator_set_voltage_time_sel()
92 struct s2mpa01_info *s2mpa01 = rdev_get_drvdata(rdev); in s2mpa01_set_ramp_delay() local
105 if (ramp_delay > s2mpa01->ramp_delay16) in s2mpa01_set_ramp_delay()
106 s2mpa01->ramp_delay16 = ramp_delay; in s2mpa01_set_ramp_delay()
108 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_set_ramp_delay()
119 if (ramp_delay > s2mpa01->ramp_delay24) in s2mpa01_set_ramp_delay()
120 s2mpa01->ramp_delay24 = ramp_delay; in s2mpa01_set_ramp_delay()
122 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_set_ramp_delay()
134 s2mpa01->ramp_delay3 = ramp_delay; in s2mpa01_set_ramp_delay()
145 if (ramp_delay > s2mpa01->ramp_delay24) in s2mpa01_set_ramp_delay()
146 s2mpa01->ramp_delay24 = ramp_delay; in s2mpa01_set_ramp_delay()
148 ramp_delay = s2mpa01->ramp_delay24; in s2mpa01_set_ramp_delay()
154 s2mpa01->ramp_delay5 = ramp_delay; in s2mpa01_set_ramp_delay()
158 if (ramp_delay > s2mpa01->ramp_delay16) in s2mpa01_set_ramp_delay()
159 s2mpa01->ramp_delay16 = ramp_delay; in s2mpa01_set_ramp_delay()
161 ramp_delay = s2mpa01->ramp_delay16; in s2mpa01_set_ramp_delay()
166 s2mpa01->ramp_delay7 = ramp_delay; in s2mpa01_set_ramp_delay()
172 if (ramp_delay > s2mpa01->ramp_delay8910) in s2mpa01_set_ramp_delay()
173 s2mpa01->ramp_delay8910 = ramp_delay; in s2mpa01_set_ramp_delay()
175 ramp_delay = s2mpa01->ramp_delay8910; in s2mpa01_set_ramp_delay()
189 ret = regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, in s2mpa01_set_ramp_delay()
192 dev_err(&rdev->dev, "failed to enable ramp rate\n"); in s2mpa01_set_ramp_delay()
199 return regmap_update_bits(rdev->regmap, ramp_reg, 0x3 << ramp_shift, in s2mpa01_set_ramp_delay()
203 return regmap_update_bits(rdev->regmap, S2MPA01_REG_RAMP1, in s2mpa01_set_ramp_delay()
241 .vsel_reg = S2MPA01_REG_L1CTRL + num - 1, \
243 .enable_reg = S2MPA01_REG_L1CTRL + num - 1, \
259 .vsel_reg = S2MPA01_REG_B1CTRL2 + (num - 1) * 2, \
261 .enable_reg = S2MPA01_REG_B1CTRL1 + (num - 1) * 2, \
295 .vsel_reg = S2MPA01_REG_B6CTRL2 + (num - 6) * 2, \
297 .enable_reg = S2MPA01_REG_B6CTRL1 + (num - 6) * 2, \
342 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); in s2mpa01_pmic_probe()
343 struct sec_platform_data *pdata = dev_get_platdata(iodev->dev); in s2mpa01_pmic_probe()
345 struct s2mpa01_info *s2mpa01; in s2mpa01_pmic_probe() local
348 s2mpa01 = devm_kzalloc(&pdev->dev, sizeof(*s2mpa01), GFP_KERNEL); in s2mpa01_pmic_probe()
349 if (!s2mpa01) in s2mpa01_pmic_probe()
350 return -ENOMEM; in s2mpa01_pmic_probe()
352 config.dev = iodev->dev; in s2mpa01_pmic_probe()
353 config.regmap = iodev->regmap_pmic; in s2mpa01_pmic_probe()
354 config.driver_data = s2mpa01; in s2mpa01_pmic_probe()
360 config.init_data = pdata->regulators[i].initdata; in s2mpa01_pmic_probe()
362 rdev = devm_regulator_register(&pdev->dev, in s2mpa01_pmic_probe()
365 dev_err(&pdev->dev, "regulator init failed for %d\n", in s2mpa01_pmic_probe()
375 { "s2mpa01-pmic", 0},
382 .name = "s2mpa01-pmic",
393 MODULE_DESCRIPTION("Samsung S2MPA01 Regulator Driver");