Lines Matching +full:dcdc +full:- +full:reg
1 // SPDX-License-Identifier: GPL-2.0-only
76 struct device *dev = ltc3676->dev; in ltc3676_set_suspend_voltage()
77 int dcdc = rdev_get_id(rdev); in ltc3676_set_suspend_voltage() local
80 dev_dbg(dev, "%s id=%d uV=%d\n", __func__, dcdc, uV); in ltc3676_set_suspend_voltage()
86 return regmap_update_bits(ltc3676->regmap, rdev->desc->vsel_reg + 1, in ltc3676_set_suspend_voltage()
87 rdev->desc->vsel_mask, sel); in ltc3676_set_suspend_voltage()
94 struct device *dev = ltc3676->dev; in ltc3676_set_suspend_mode()
96 int dcdc = rdev_get_id(rdev); in ltc3676_set_suspend_mode() local
98 dev_dbg(dev, "%s id=%d mode=%d\n", __func__, dcdc, mode); in ltc3676_set_suspend_mode()
109 dev_warn(&rdev->dev, "%s: regulator mode: 0x%x not supported\n", in ltc3676_set_suspend_mode()
110 rdev->desc->name, mode); in ltc3676_set_suspend_mode()
111 return -EINVAL; in ltc3676_set_suspend_mode()
114 return regmap_update_bits(ltc3676->regmap, rdev->desc->vsel_reg, in ltc3676_set_suspend_mode()
121 struct device *dev = ltc3676->dev; in ltc3676_set_voltage_sel()
122 int ret, dcdc = rdev_get_id(rdev); in ltc3676_set_voltage_sel() local
124 dev_dbg(dev, "%s id=%d selector=%d\n", __func__, dcdc, selector); in ltc3676_set_voltage_sel()
126 ret = regmap_update_bits(ltc3676->regmap, rdev->desc->vsel_reg + 1, in ltc3676_set_voltage_sel()
149 struct ltc3676 *ltc3676 = config->driver_data; in ltc3676_of_parse_cb()
150 struct regulator_desc *rdesc = <c3676->regulator_descs[desc->id]; in ltc3676_of_parse_cb()
155 if (desc->id == LTC3676_LDO3) in ltc3676_of_parse_cb()
158 ret = of_property_read_u32_array(np, "lltc,fb-voltage-divider", r, 2); in ltc3676_of_parse_cb()
160 dev_err(ltc3676->dev, "Failed to parse voltage divider: %d\n", in ltc3676_of_parse_cb()
165 rdesc->min_uV = ltc3676_scale(desc->min_uV, r[0], r[1]); in ltc3676_of_parse_cb()
166 rdesc->uV_step = ltc3676_scale(desc->uV_step, r[0], r[1]); in ltc3676_of_parse_cb()
167 rdesc->fixed_uV = ltc3676_scale(desc->fixed_uV, r[0], r[1]); in ltc3676_of_parse_cb()
172 /* SW1, SW2, SW3, SW4 linear 0.8V-3.3V with scalar via R1/R2 feeback res */
184 /* LDO1 always on fixed 0.8V-3.3V via scalar via R1/R2 feeback res */
235 static bool ltc3676_readable_writeable_reg(struct device *dev, unsigned int reg) in ltc3676_readable_writeable_reg() argument
237 switch (reg) { in ltc3676_readable_writeable_reg()
246 static bool ltc3676_volatile_reg(struct device *dev, unsigned int reg) in ltc3676_volatile_reg() argument
248 switch (reg) { in ltc3676_volatile_reg()
270 struct device *dev = ltc3676->dev; in ltc3676_isr()
273 regmap_read(ltc3676->regmap, LTC3676_IRQSTAT, &irqstat); in ltc3676_isr()
277 dev_warn(dev, "Over-temperature Warning\n"); in ltc3676_isr()
280 regulator_notifier_call_chain(ltc3676->regulators[i], in ltc3676_isr()
288 regulator_notifier_call_chain(ltc3676->regulators[i], in ltc3676_isr()
293 regmap_write(ltc3676->regmap, LTC3676_CLIRQ, 0); in ltc3676_isr()
300 struct device *dev = &client->dev; in ltc3676_regulator_probe()
308 return -ENOMEM; in ltc3676_regulator_probe()
311 ltc3676->dev = dev; in ltc3676_regulator_probe()
313 descs = ltc3676->regulator_descs; in ltc3676_regulator_probe()
317 ltc3676->regmap = devm_regmap_init_i2c(client, <c3676_regmap_config); in ltc3676_regulator_probe()
318 if (IS_ERR(ltc3676->regmap)) { in ltc3676_regulator_probe()
319 ret = PTR_ERR(ltc3676->regmap); in ltc3676_regulator_probe()
325 struct regulator_desc *desc = <c3676->regulator_descs[i]; in ltc3676_regulator_probe()
334 ltc3676->regulators[i] = devm_regulator_register(dev, desc, in ltc3676_regulator_probe()
336 if (IS_ERR(ltc3676->regulators[i])) { in ltc3676_regulator_probe()
337 ret = PTR_ERR(ltc3676->regulators[i]); in ltc3676_regulator_probe()
339 desc->name, ret); in ltc3676_regulator_probe()
344 regmap_write(ltc3676->regmap, LTC3676_CLIRQ, 0); in ltc3676_regulator_probe()
345 if (client->irq) { in ltc3676_regulator_probe()
346 ret = devm_request_threaded_irq(dev, client->irq, NULL, in ltc3676_regulator_probe()
349 client->name, ltc3676); in ltc3676_regulator_probe()