Lines Matching +full:vsel +full:- +full:high

1 // SPDX-License-Identifier: GPL-2.0
45 regmap_update_bits(rdev->regmap, di->vsel_reg, in sy8827n_set_mode()
49 regmap_update_bits(rdev->regmap, di->vsel_reg, in sy8827n_set_mode()
53 return -EINVAL; in sy8827n_set_mode()
64 ret = regmap_read(rdev->regmap, di->vsel_reg, &val); in sy8827n_get_mode()
89 struct regulator_desc *rdesc = &di->desc; in sy8827n_regulator_register()
92 rdesc->name = "sy8827n-reg"; in sy8827n_regulator_register()
93 rdesc->supply_name = "vin"; in sy8827n_regulator_register()
94 rdesc->ops = &sy8827n_regulator_ops; in sy8827n_regulator_register()
95 rdesc->type = REGULATOR_VOLTAGE; in sy8827n_regulator_register()
96 rdesc->n_voltages = SY8827N_NVOLTAGES; in sy8827n_regulator_register()
97 rdesc->enable_reg = di->vsel_reg; in sy8827n_regulator_register()
98 rdesc->enable_mask = SY8827N_BUCK_EN; in sy8827n_regulator_register()
99 rdesc->min_uV = SY8827N_VSELMIN; in sy8827n_regulator_register()
100 rdesc->uV_step = SY8827N_VSELSTEP; in sy8827n_regulator_register()
101 rdesc->vsel_reg = di->vsel_reg; in sy8827n_regulator_register()
102 rdesc->vsel_mask = rdesc->n_voltages - 1; in sy8827n_regulator_register()
103 rdesc->owner = THIS_MODULE; in sy8827n_regulator_register()
105 rdev = devm_regulator_register(di->dev, &di->desc, config); in sy8827n_regulator_register()
126 struct device *dev = &client->dev; in sy8827n_i2c_probe()
127 struct device_node *np = dev->of_node; in sy8827n_i2c_probe()
135 return -ENOMEM; in sy8827n_i2c_probe()
137 di->regulator = of_get_regulator_init_data(dev, np, &di->desc); in sy8827n_i2c_probe()
138 if (!di->regulator) { in sy8827n_i2c_probe()
140 return -EINVAL; in sy8827n_i2c_probe()
143 di->en_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); in sy8827n_i2c_probe()
144 if (IS_ERR(di->en_gpio)) in sy8827n_i2c_probe()
145 return PTR_ERR(di->en_gpio); in sy8827n_i2c_probe()
147 if (of_property_read_bool(np, "silergy,vsel-state-high")) in sy8827n_i2c_probe()
148 di->vsel_reg = SY8827N_VSEL1; in sy8827n_i2c_probe()
150 di->vsel_reg = SY8827N_VSEL0; in sy8827n_i2c_probe()
152 di->dev = dev; in sy8827n_i2c_probe()
161 config.dev = di->dev; in sy8827n_i2c_probe()
162 config.init_data = di->regulator; in sy8827n_i2c_probe()
189 .name = "sy8827n-regulator",