Lines Matching +full:ilim +full:- +full:ma
1 // SPDX-License-Identifier: GPL-2.0+
97 #define PF8X00_SW_BASE(i) (8 * (i - PF8X00_BUCK1) + PF8X00_SW1_CONFIG1)
106 #define PF8X00_LDO_BASE(i) (6 * (i - PF8X00_LDO1) + PF8X00_LDO1_CONFIG1)
179 static void swxilim_select(struct pf8x00_chip *chip, int id, int ilim) in swxilim_select() argument
184 switch (ilim) { in swxilim_select()
202 regmap_update_bits(chip->regmap, reg, in swxilim_select()
211 struct pf8x00_chip *chip = config->driver_data; in handle_ilim_property()
215 if ((desc->id >= PF8X00_BUCK1) && (desc->id <= PF8X00_BUCK7)) { in handle_ilim_property()
216 ret = of_property_read_u32(np, "nxp,ilim-ma", &val); in handle_ilim_property()
218 dev_dbg(chip->dev, "unspecified ilim for BUCK%d, use value stored in OTP\n", in handle_ilim_property()
219 desc->id - PF8X00_LDO4); in handle_ilim_property()
223 dev_warn(chip->dev, "nxp,ilim-ma is deprecated, please use regulator-max-microamp\n"); in handle_ilim_property()
224 swxilim_select(chip, desc->id, val); in handle_ilim_property()
227 dev_warn(chip->dev, "nxp,ilim-ma used with incorrect regulator (%d)\n", desc->id); in handle_ilim_property()
234 unsigned char id = desc->id - PF8X00_LDO4; in handle_shift_property()
236 struct pf8x00_chip *chip = config->driver_data; in handle_shift_property()
241 if ((desc->id >= PF8X00_BUCK1) && (desc->id <= PF8X00_BUCK7)) { in handle_shift_property()
242 ret = of_property_read_u32(np, "nxp,phase-shift", &val); in handle_shift_property()
244 dev_dbg(chip->dev, in handle_shift_property()
245 "unspecified phase-shift for BUCK%d, using OTP configuration\n", in handle_shift_property()
251 dev_warn(config->dev, in handle_shift_property()
260 phase -= 1; in handle_shift_property()
264 regmap_update_bits(chip->regmap, reg, in handle_shift_property()
268 dev_warn(chip->dev, "nxp,phase-shift used with incorrect regulator (%d)\n", id); in handle_shift_property()
288 return regmap_update_bits(rmap, regl->suspend_enable_reg, in pf8x00_suspend_enable()
289 regl->suspend_enable_mask, in pf8x00_suspend_enable()
290 regl->suspend_enable_mask); in pf8x00_suspend_enable()
298 return regmap_update_bits(rmap, regl->suspend_enable_reg, in pf8x00_suspend_disable()
299 regl->suspend_enable_mask, 0); in pf8x00_suspend_disable()
307 if (regl->suspend_voltage_cache == uV) in pf8x00_set_suspend_voltage()
317 uV, regl->suspend_voltage_reg, regl->desc.vsel_mask, ret); in pf8x00_set_suspend_voltage()
318 ret = regmap_update_bits(rdev->regmap, regl->suspend_voltage_reg, in pf8x00_set_suspend_voltage()
319 regl->desc.vsel_mask, ret); in pf8x00_set_suspend_voltage()
325 regl->suspend_voltage_cache = uV; in pf8x00_set_suspend_voltage()
508 ret = regmap_read(chip->regmap, PF8X00_DEVICEID, &value); in pf8x00_identify()
510 dev_err(chip->dev, "failed to read chip family\n"); in pf8x00_identify()
519 dev_err(chip->dev, in pf8x00_identify()
536 dev_err(chip->dev, "Unknown pf8x00 device id 0x%x\n", dev_id); in pf8x00_identify()
537 return -ENODEV; in pf8x00_identify()
540 dev_info(chip->dev, "%s PMIC found.\n", name); in pf8x00_identify()
552 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); in pf8x00_i2c_probe()
554 return -ENOMEM; in pf8x00_i2c_probe()
557 chip->dev = &client->dev; in pf8x00_i2c_probe()
559 chip->regmap = devm_regmap_init_i2c(client, &pf8x00_regmap_config); in pf8x00_i2c_probe()
560 if (IS_ERR(chip->regmap)) { in pf8x00_i2c_probe()
561 ret = PTR_ERR(chip->regmap); in pf8x00_i2c_probe()
562 dev_err(&client->dev, in pf8x00_i2c_probe()
575 config.dev = chip->dev; in pf8x00_i2c_probe()
577 config.regmap = chip->regmap; in pf8x00_i2c_probe()
579 rdev = devm_regulator_register(&client->dev, &data->desc, &config); in pf8x00_i2c_probe()
581 dev_err(&client->dev, in pf8x00_i2c_probe()
582 "failed to register %s regulator\n", data->desc.name); in pf8x00_i2c_probe()