Lines Matching +full:rt5759 +full:- +full:buck
1 // SPDX-License-Identifier: GPL-2.0+
70 return -EINVAL; in rt5759_set_mode()
137 i = ARRAY_SIZE(ocp_lvl) - 1; in rt5759_set_ocp()
170 i = ARRAY_SIZE(otp_lvl) - 1; in rt5759_set_otp()
212 struct device_node *np = priv->dev->of_node; in rt5759_regulator_register()
213 struct regulator_desc *reg_desc = &priv->desc; in rt5759_regulator_register()
218 reg_desc->name = "rt5759-buck"; in rt5759_regulator_register()
219 reg_desc->type = REGULATOR_VOLTAGE; in rt5759_regulator_register()
220 reg_desc->owner = THIS_MODULE; in rt5759_regulator_register()
221 reg_desc->ops = &rt5759_regulator_ops; in rt5759_regulator_register()
222 reg_desc->n_voltages = RT5759_NUM_VOLTS; in rt5759_regulator_register()
223 reg_desc->min_uV = RT5759_MIN_UV; in rt5759_regulator_register()
224 reg_desc->uV_step = RT5759_STEP_UV; in rt5759_regulator_register()
225 reg_desc->vsel_reg = RT5759_REG_VSEL; in rt5759_regulator_register()
226 reg_desc->vsel_mask = RT5759_VSEL_MASK; in rt5759_regulator_register()
227 reg_desc->enable_reg = RT5759_REG_DCDCCTRL; in rt5759_regulator_register()
228 reg_desc->enable_mask = RT5759_ENABLE_MASK; in rt5759_regulator_register()
229 reg_desc->active_discharge_reg = RT5759_REG_DCDCCTRL; in rt5759_regulator_register()
230 reg_desc->active_discharge_mask = RT5759_DISCHARGE_MASK; in rt5759_regulator_register()
231 reg_desc->active_discharge_on = RT5759_DISCHARGE_MASK; in rt5759_regulator_register()
232 reg_desc->ramp_reg = RT5759_REG_FREQ; in rt5759_regulator_register()
233 reg_desc->ramp_mask = RT5759_TSTEP_MASK; in rt5759_regulator_register()
234 reg_desc->ramp_delay_table = rt5759_ramp_table; in rt5759_regulator_register()
235 reg_desc->n_ramp_values = ARRAY_SIZE(rt5759_ramp_table); in rt5759_regulator_register()
236 reg_desc->enable_time = RT5759_MINSS_TIMEUS; in rt5759_regulator_register()
237 reg_desc->of_map_mode = rt5759_of_map_mode; in rt5759_regulator_register()
240 * RT5759 step uV = 10000 in rt5759_regulator_register()
243 if (priv->chip_type == CHIP_TYPE_RT5759A) in rt5759_regulator_register()
244 reg_desc->uV_step = RT5759A_STEP_UV; in rt5759_regulator_register()
247 reg_cfg.dev = priv->dev; in rt5759_regulator_register()
249 reg_cfg.init_data = of_get_regulator_init_data(priv->dev, np, reg_desc); in rt5759_regulator_register()
250 reg_cfg.regmap = priv->regmap; in rt5759_regulator_register()
252 rdev = devm_regulator_register(priv->dev, reg_desc, ®_cfg); in rt5759_regulator_register()
255 dev_err(priv->dev, "Failed to register regulator (%d)\n", ret); in rt5759_regulator_register()
269 if (priv->chip_type != CHIP_TYPE_RT5759A) in rt5759_init_device_property()
272 if (device_property_read_bool(priv->dev, "richtek,watchdog-enable")) in rt5759_init_device_property()
275 return regmap_update_bits(priv->regmap, RT5759A_REG_WDTEN, in rt5759_init_device_property()
284 ret = regmap_read(priv->regmap, RT5759_REG_VENDORINFO, &vendor); in rt5759_manufacturer_check()
289 dev_err(priv->dev, "vendor info not correct (%d)\n", vendor); in rt5759_manufacturer_check()
290 return -EINVAL; in rt5759_manufacturer_check()
303 if (priv->chip_type == CHIP_TYPE_RT5759A && reg == RT5759A_REG_WDTEN) in rt5759_is_accessible_reg()
322 priv = devm_kzalloc(&i2c->dev, sizeof(*priv), GFP_KERNEL); in rt5759_probe()
324 return -ENOMEM; in rt5759_probe()
326 priv->dev = &i2c->dev; in rt5759_probe()
327 priv->chip_type = (unsigned long)of_device_get_match_data(&i2c->dev); in rt5759_probe()
330 priv->regmap = devm_regmap_init_i2c(i2c, &rt5759_regmap_config); in rt5759_probe()
331 if (IS_ERR(priv->regmap)) { in rt5759_probe()
332 ret = PTR_ERR(priv->regmap); in rt5759_probe()
333 dev_err(&i2c->dev, "Failed to allocate regmap (%d)\n", ret); in rt5759_probe()
339 dev_err(&i2c->dev, "Failed to check device (%d)\n", ret); in rt5759_probe()
345 dev_err(&i2c->dev, "Failed to init device (%d)\n", ret); in rt5759_probe()
353 { .compatible = "richtek,rt5759", .data = (void *)CHIP_TYPE_RT5759 },
361 .name = "rt5759",
370 MODULE_DESCRIPTION("Richtek RT5759 Regulator Driver");