Lines Matching +full:regulator +full:- +full:decay
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
13 #include <linux/regulator/driver.h>
20 /* Selector for regulator configuration regarding PMIC chip ID. */
306 struct tps65086 * const tps = dev_get_drvdata(config->dev); in tps65086_of_parse_cb()
307 struct tps65086_regulator *regulators = tps->reg_config->config; in tps65086_of_parse_cb()
311 if (of_property_read_bool(node, "ti,regulator-step-size-25mv")) { in tps65086_of_parse_cb()
312 switch (desc->id) { in tps65086_of_parse_cb()
316 regulators[desc->id].desc.linear_ranges = in tps65086_of_parse_cb()
318 regulators[desc->id].desc.n_linear_ranges = in tps65086_of_parse_cb()
324 regulators[desc->id].desc.linear_ranges = in tps65086_of_parse_cb()
326 regulators[desc->id].desc.n_linear_ranges = in tps65086_of_parse_cb()
330 dev_warn(config->dev, "25mV step mode only valid for BUCK regulators\n"); in tps65086_of_parse_cb()
334 /* Check for decay mode */ in tps65086_of_parse_cb()
335 if (desc->id <= BUCK6 && of_property_read_bool(node, "ti,regulator-decay")) { in tps65086_of_parse_cb()
336 ret = regmap_write_bits(config->regmap, in tps65086_of_parse_cb()
337 regulators[desc->id].decay_reg, in tps65086_of_parse_cb()
338 regulators[desc->id].decay_mask, in tps65086_of_parse_cb()
339 regulators[desc->id].decay_mask); in tps65086_of_parse_cb()
341 dev_err(config->dev, "Error setting decay\n"); in tps65086_of_parse_cb()
351 struct tps65086 *tps = dev_get_drvdata(pdev->dev.parent); in tps65086_regulator_probe()
357 /* Select regulator configuration for used PMIC device */ in tps65086_regulator_probe()
358 switch (tps->chip_id) { in tps65086_regulator_probe()
372 dev_err(tps->dev, "Unknown device ID. Cannot determine regulator config.\n"); in tps65086_regulator_probe()
373 return -ENODEV; in tps65086_regulator_probe()
375 tps->reg_config = ®ulator_configs[selector_reg_config]; in tps65086_regulator_probe()
379 config.dev = &pdev->dev; in tps65086_regulator_probe()
380 config.dev->of_node = tps->dev->of_node; in tps65086_regulator_probe()
382 config.regmap = tps->regmap; in tps65086_regulator_probe()
384 for (i = 0; i < tps->reg_config->num_elems; ++i) { in tps65086_regulator_probe()
385 struct regulator_desc * const desc_ptr = &tps->reg_config->config[i].desc; in tps65086_regulator_probe()
387 dev_dbg(tps->dev, "Index: %u; Regulator name: \"%s\"; Regulator ID: %d\n", in tps65086_regulator_probe()
388 i, desc_ptr->name, desc_ptr->id); in tps65086_regulator_probe()
390 rdev = devm_regulator_register(&pdev->dev, desc_ptr, &config); in tps65086_regulator_probe()
392 dev_err(tps->dev, "failed to register %d \"%s\" regulator\n", in tps65086_regulator_probe()
393 i, desc_ptr->name); in tps65086_regulator_probe()
402 { "tps65086-regulator", },
409 .name = "tps65086-regulator",
418 MODULE_DESCRIPTION("TPS65086 Regulator driver");