Lines Matching +full:enable +full:- +full:overvolt +full:- +full:hiccup
1 // SPDX-License-Identifier: GPL-2.0+
72 return -EINVAL; in rt5120_buck_set_mode()
134 return -EINVAL; in rt5120_buck1_set_suspend_voltage()
136 sel = (uV - RT5120_BUCK1_MINUV) / RT5120_BUCK1_STEPUV; in rt5120_buck1_set_suspend_voltage()
159 .enable = regulator_enable_regmap,
175 .enable = regulator_enable_regmap,
187 .enable = regulator_enable_regmap,
197 .enable = regulator_enable_regmap,
224 desc->name = name[rid]; in rt5120_fillin_regulator_desc()
225 desc->supply_name = sname[rid]; in rt5120_fillin_regulator_desc()
226 desc->owner = THIS_MODULE; in rt5120_fillin_regulator_desc()
227 desc->type = REGULATOR_VOLTAGE; in rt5120_fillin_regulator_desc()
228 desc->id = rid; in rt5120_fillin_regulator_desc()
229 desc->enable_reg = RT5120_REG_ENABLE; in rt5120_fillin_regulator_desc()
230 desc->enable_mask = RT5120_RIDEN_MASK(rid); in rt5120_fillin_regulator_desc()
231 desc->active_discharge_reg = RT5120_REG_DISCHG; in rt5120_fillin_regulator_desc()
232 desc->active_discharge_mask = RT5120_RADEN_MASK(rid); in rt5120_fillin_regulator_desc()
233 desc->active_discharge_on = RT5120_RADEN_MASK(rid); in rt5120_fillin_regulator_desc()
235 desc->n_voltages = 1; in rt5120_fillin_regulator_desc()
239 desc->of_map_mode = rt5120_buck_of_map_mode; in rt5120_fillin_regulator_desc()
245 desc->n_voltages = RT5120_BUCK1_NUM_VOLT; in rt5120_fillin_regulator_desc()
246 desc->min_uV = RT5120_BUCK1_MINUV; in rt5120_fillin_regulator_desc()
247 desc->uV_step = RT5120_BUCK1_STEPUV; in rt5120_fillin_regulator_desc()
248 desc->vsel_reg = RT5120_REG_CH1VID; in rt5120_fillin_regulator_desc()
249 desc->vsel_mask = RT5120_CH1VID_MASK; in rt5120_fillin_regulator_desc()
250 desc->ops = &rt5120_buck1_ops; in rt5120_fillin_regulator_desc()
253 desc->ops = &rt5120_buck234_ops; in rt5120_fillin_regulator_desc()
256 desc->ops = &rt5120_ldo_ops; in rt5120_fillin_regulator_desc()
259 desc->ops = &rt5120_exten_ops; in rt5120_fillin_regulator_desc()
266 struct regulator_desc *desc = priv->rdesc + rid; in rt5120_of_parse_cb()
267 struct regulator_init_data *init_data = match->init_data; in rt5120_of_parse_cb()
272 if (init_data->constraints.min_uV != init_data->constraints.max_uV) { in rt5120_of_parse_cb()
273 dev_err(priv->dev, "Variable voltage for fixed regulator\n"); in rt5120_of_parse_cb()
274 return -EINVAL; in rt5120_of_parse_cb()
277 desc->fixed_uV = init_data->constraints.min_uV; in rt5120_of_parse_cb()
292 struct device *dev = priv->dev->parent; in rt5120_parse_regulator_dt_data()
297 rt5120_fillin_regulator_desc(priv->rdesc + i, i); in rt5120_parse_regulator_dt_data()
299 rt5120_regu_match[i].desc = priv->rdesc + i; in rt5120_parse_regulator_dt_data()
302 reg_node = of_get_child_by_name(dev->of_node, "regulators"); in rt5120_parse_regulator_dt_data()
304 dev_err(priv->dev, "Couldn't find 'regulators' node\n"); in rt5120_parse_regulator_dt_data()
305 return -ENODEV; in rt5120_parse_regulator_dt_data()
308 ret = of_regulator_match(priv->dev, reg_node, rt5120_regu_match, in rt5120_parse_regulator_dt_data()
314 dev_err(priv->dev, in rt5120_parse_regulator_dt_data()
322 dev_err(priv->dev, "Failed in [%d] of_passe_cb\n", i); in rt5120_parse_regulator_dt_data()
332 struct device *dev = priv->dev->parent; in rt5120_device_property_init()
333 struct device_node *np = dev->of_node; in rt5120_device_property_init()
339 "richtek,enable-undervolt-hiccup"); in rt5120_device_property_init()
344 "richtek,enable-overvolt-hiccup"); in rt5120_device_property_init()
348 return regmap_update_bits(priv->regmap, RT5120_REG_UVOVPROT, in rt5120_device_property_init()
360 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in rt5120_regulator_probe()
362 return -ENOMEM; in rt5120_regulator_probe()
364 priv->dev = &pdev->dev; in rt5120_regulator_probe()
366 priv->regmap = dev_get_regmap(pdev->dev.parent, NULL); in rt5120_regulator_probe()
367 if (!priv->regmap) { in rt5120_regulator_probe()
368 dev_err(&pdev->dev, "Failed to init regmap\n"); in rt5120_regulator_probe()
369 return -ENODEV; in rt5120_regulator_probe()
374 dev_err(&pdev->dev, "Failed to do property init\n"); in rt5120_regulator_probe()
380 dev_err(&pdev->dev, "Failed to parse dt data\n"); in rt5120_regulator_probe()
384 config.dev = &pdev->dev; in rt5120_regulator_probe()
385 config.regmap = priv->regmap; in rt5120_regulator_probe()
391 rdev = devm_regulator_register(&pdev->dev, priv->rdesc + i, in rt5120_regulator_probe()
394 dev_err(&pdev->dev, in rt5120_regulator_probe()
404 { "rt5120-regulator", 0 },
411 .name = "rt5120-regulator",