Lines Matching +full:fault +full:- +full:log +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0+
3 // SLG51000 High PSRR, Multi-Output Regulators
20 #include "slg51000-regulator.h"
182 .enable = regulator_enable_regmap,
192 .enable = regulator_enable_regmap,
203 ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0, in slg51000_of_parse_cb()
206 "gpio-en-ldo"); in slg51000_of_parse_cb()
208 config->ena_gpiod = ena_gpiod; in slg51000_of_parse_cb()
258 chip->rdesc[id] = &regls_desc[id]; in slg51000_regulator_init()
259 rdesc = chip->rdesc[id]; in slg51000_regulator_init()
260 config.regmap = chip->regmap; in slg51000_regulator_init()
261 config.dev = chip->dev; in slg51000_regulator_init()
264 ret = regmap_bulk_read(chip->regmap, min_regs[id], in slg51000_regulator_init()
267 dev_err(chip->dev, in slg51000_regulator_init()
280 ret = regmap_read(chip->regmap, reg, &val); in slg51000_regulator_init()
282 dev_err(chip->dev, in slg51000_regulator_init()
288 rdesc->linear_min_sel = vsel_range[0]; in slg51000_regulator_init()
289 rdesc->n_voltages = vsel_range[1] + 1; in slg51000_regulator_init()
291 rdesc->min_uV = SLG51000_LDOHP_HV_MIN in slg51000_regulator_init()
293 * rdesc->uV_step); in slg51000_regulator_init()
295 rdesc->min_uV = SLG51000_LDOHP_LV_MIN in slg51000_regulator_init()
297 * rdesc->uV_step); in slg51000_regulator_init()
307 ret = regmap_read(chip->regmap, reg, &val); in slg51000_regulator_init()
309 dev_err(chip->dev, in slg51000_regulator_init()
315 rdesc->ops = &slg51000_switch_ops; in slg51000_regulator_init()
316 rdesc->n_voltages = 0; in slg51000_regulator_init()
317 rdesc->min_uV = 0; in slg51000_regulator_init()
318 rdesc->uV_step = 0; in slg51000_regulator_init()
319 rdesc->linear_min_sel = 0; in slg51000_regulator_init()
325 rdesc->linear_min_sel = vsel_range[0]; in slg51000_regulator_init()
326 rdesc->n_voltages = vsel_range[1] + 1; in slg51000_regulator_init()
327 rdesc->min_uV = rdesc->min_uV in slg51000_regulator_init()
328 + (vsel_range[0] * rdesc->uV_step); in slg51000_regulator_init()
332 chip->rdev[id] = devm_regulator_register(chip->dev, rdesc, in slg51000_regulator_init()
334 if (IS_ERR(chip->rdev[id])) { in slg51000_regulator_init()
335 ret = PTR_ERR(chip->rdev[id]); in slg51000_regulator_init()
336 dev_err(chip->dev, in slg51000_regulator_init()
338 chip->rdesc[id]->name, ret); in slg51000_regulator_init()
349 struct regmap *regmap = chip->regmap; in slg51000_irq_handler()
359 dev_err(chip->dev, in slg51000_irq_handler()
367 dev_err(chip->dev, in slg51000_irq_handler()
374 dev_err(chip->dev, in slg51000_irq_handler()
381 dev_info(chip->dev, in slg51000_irq_handler()
389 regulator_notifier_call_chain(chip->rdev[i], in slg51000_irq_handler()
393 dev_warn(chip->dev, in slg51000_irq_handler()
394 "Over-current limit(ldo%d)\n", i + 1); in slg51000_irq_handler()
404 regulator_notifier_call_chain(chip->rdev[i], in slg51000_irq_handler()
411 dev_warn(chip->dev, "High temperature warning!\n"); in slg51000_irq_handler()
422 ret = regmap_read(chip->regmap, SLG51000_SYSCTL_FAULT_LOG1, &val); in slg51000_clear_fault_log()
424 dev_err(chip->dev, "Failed to read Fault log register\n"); in slg51000_clear_fault_log()
429 dev_dbg(chip->dev, "Fault log: FLT_OVER_TEMP\n"); in slg51000_clear_fault_log()
431 dev_dbg(chip->dev, "Fault log: FLT_POWER_SEQ_CRASH_REQ\n"); in slg51000_clear_fault_log()
433 dev_dbg(chip->dev, "Fault log: FLT_RST\n"); in slg51000_clear_fault_log()
435 dev_dbg(chip->dev, "Fault log: FLT_POR\n"); in slg51000_clear_fault_log()
440 struct device *dev = &client->dev; in slg51000_i2c_probe()
447 return -ENOMEM; in slg51000_i2c_probe()
457 chip->cs_gpiod = cs_gpiod; in slg51000_i2c_probe()
463 chip->chip_irq = client->irq; in slg51000_i2c_probe()
464 chip->dev = dev; in slg51000_i2c_probe()
465 chip->regmap = devm_regmap_init_i2c(client, &slg51000_regmap_config); in slg51000_i2c_probe()
466 if (IS_ERR(chip->regmap)) { in slg51000_i2c_probe()
467 error = PTR_ERR(chip->regmap); in slg51000_i2c_probe()
475 dev_err(chip->dev, "Failed to init regulator(%d)\n", ret); in slg51000_i2c_probe()
481 if (chip->chip_irq) { in slg51000_i2c_probe()
482 ret = devm_request_threaded_irq(dev, chip->chip_irq, NULL, in slg51000_i2c_probe()
486 "slg51000-irq", chip); in slg51000_i2c_probe()
489 chip->chip_irq); in slg51000_i2c_probe()
507 .name = "slg51000-regulator",