Lines Matching +full:vsel +full:- +full:active +full:- +full:high
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * act8865-regulator.c - Voltage regulation for active-semi ACT88xx PMUs
5 * http://www.active-semi.com/products/power-management-units/act88xx/
22 #include <dt-bindings/regulator/active-semi,8865-regulator.h>
124 #define ACT8865_ENA 0x80 /* ON - [7] */
125 #define ACT8865_DIS 0x40 /* DIS - [6] */
127 #define ACT8865_VSEL_MASK 0x3F /* VSET - [5:0] */
130 #define ACT8600_LDO10_ENA 0x40 /* ON - [6] */
131 #define ACT8600_SUDCDC_VSEL_MASK 0xFF /* SUDCDC VSET - [7:0] */
239 struct regmap *regmap = rdev->regmap; in act8865_set_suspend_state()
240 int id = rdev->desc->id, reg, val; in act8865_set_suspend_state()
272 return -EINVAL; in act8865_set_suspend_state()
311 struct regmap *regmap = rdev->regmap; in act8865_set_mode()
338 return -EINVAL; in act8865_set_mode()
352 return -EINVAL; in act8865_set_mode()
360 struct regmap *regmap = rdev->regmap; in act8865_get_mode()
387 return -EINVAL; in act8865_get_mode()
554 { .compatible = "active-semi,act8600", .data = (void *)ACT8600 },
555 { .compatible = "active-semi,act8846", .data = (void *)ACT8846 },
556 { .compatible = "active-semi,act8865", .data = (void *)ACT8865 },
567 for (i = 0; i < pdata->num_regulators; i++) { in act8865_get_regulator_data()
568 if (pdata->regulators[i].id == id) in act8865_get_regulator_data()
569 return &pdata->regulators[i]; in act8865_get_regulator_data()
581 regmap_write(act8865->regmap, act8865->off_reg, act8865->off_mask); in act8865_power_off()
620 val->intval = ret; in act8600_charger_get_property()
623 return -EINVAL; in act8600_charger_get_property()
634 .name = "act8600-charger",
646 .of_node = dev->of_node, in act8600_charger_probe()
659 struct device *dev = &client->dev; in act8865_pmic_probe()
667 if (dev->of_node) { in act8865_pmic_probe()
672 return -ENODEV; in act8865_pmic_probe()
674 type = (unsigned long) id->data; in act8865_pmic_probe()
676 voltage_select = of_property_read_bool(dev->of_node, "active-semi,vsel-high"); in act8865_pmic_probe()
678 type = i2c_id->driver_data; in act8865_pmic_probe()
687 off_reg = -1; in act8865_pmic_probe()
688 off_mask = -1; in act8865_pmic_probe()
711 return -EINVAL; in act8865_pmic_probe()
716 return -ENOMEM; in act8865_pmic_probe()
718 act8865->regmap = devm_regmap_init_i2c(client, regmap_config); in act8865_pmic_probe()
719 if (IS_ERR(act8865->regmap)) { in act8865_pmic_probe()
720 ret = PTR_ERR(act8865->regmap); in act8865_pmic_probe()
725 if (of_device_is_system_power_controller(dev->of_node)) { in act8865_pmic_probe()
728 act8865->off_reg = off_reg; in act8865_pmic_probe()
729 act8865->off_mask = off_mask; in act8865_pmic_probe()
744 config.regmap = act8865->regmap; in act8865_pmic_probe()
749 rdata = act8865_get_regulator_data(desc->id, pdata); in act8865_pmic_probe()
751 config.init_data = rdata->init_data; in act8865_pmic_probe()
752 config.of_node = rdata->of_node; in act8865_pmic_probe()
758 dev_err(dev, "failed to register %s\n", desc->name); in act8865_pmic_probe()
764 ret = act8600_charger_probe(dev, act8865->regmap); in act8865_pmic_probe()
766 if (ret != -EPROBE_DEFER) in act8865_pmic_probe()
775 return type != ACT8865 ? 0 : regmap_write(act8865->regmap, in act8865_pmic_probe()
798 MODULE_DESCRIPTION("active-semi act88xx voltage regulator driver");