Lines Matching +full:in4 +full:- +full:in5
1 // SPDX-License-Identifier: GPL-2.0-only
3 * max8907-regulator.c -- support regulators in max8907
5 * Copyright (C) 2010 Gyungoh Yoo <jack.yoo@maxim-ic.com>
6 * Copyright (C) 2010-2012, NVIDIA CORPORATION. All rights reserved.
8 * Portions based on drivers/regulator/tps65910-regulator.c,
51 .n_voltages = ((max) - (min)) / (step) + 1, \
94 .n_voltages = ((max) - (min)) / (step) + 1, \
150 REG_LDO(SD1, "in-v1", MAX8907_REG_SDCTL1, 650000, 2225000, 25000),
151 REG_LDO(SD2, "in-v2", MAX8907_REG_SDCTL2, 637500, 1425000, 12500),
152 REG_LDO(SD3, "in-v3", MAX8907_REG_SDCTL3, 750000, 3900000, 50000),
156 LDO_750_50(LDO4, "in4", MAX8907_REG_LDOCTL4),
157 LDO_750_50(LDO5, "in5", MAX8907_REG_LDOCTL5),
226 np = pdev->dev.parent->of_node; in max8907_regulator_parse_dt()
232 dev_err(&pdev->dev, "regulators node not found\n"); in max8907_regulator_parse_dt()
233 return -EINVAL; in max8907_regulator_parse_dt()
236 ret = of_regulator_match(&pdev->dev, regulators, max8907_matches, in max8907_regulator_parse_dt()
240 dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", in max8907_regulator_parse_dt()
276 struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent); in max8907_regulator_probe()
277 struct max8907_platform_data *pdata = dev_get_platdata(max8907->dev); in max8907_regulator_probe()
290 pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); in max8907_regulator_probe()
292 return -ENOMEM; in max8907_regulator_probe()
296 memcpy(pmic->desc, max8907_regulators, sizeof(pmic->desc)); in max8907_regulator_probe()
299 ret = regmap_read(max8907->regmap_gen, MAX8907_REG_II2RR, &val); in max8907_regulator_probe()
305 pmic->desc[MAX8907_SD1].min_uV = 637500; in max8907_regulator_probe()
306 pmic->desc[MAX8907_SD1].uV_step = 12500; in max8907_regulator_probe()
307 pmic->desc[MAX8907_SD1].n_voltages = in max8907_regulator_probe()
308 (1425000 - 637500) / 12500 + 1; in max8907_regulator_probe()
314 config.dev = pdev->dev.parent; in max8907_regulator_probe()
316 idata = pdata->init_data[i]; in max8907_regulator_probe()
321 config.regmap = max8907->regmap_gen; in max8907_regulator_probe()
324 switch (pmic->desc[i].id) { in max8907_regulator_probe()
326 if (idata && idata->constraints.name) in max8907_regulator_probe()
327 mbatt_rail_name = idata->constraints.name; in max8907_regulator_probe()
329 mbatt_rail_name = pmic->desc[i].name; in max8907_regulator_probe()
334 idata->supply_regulator = mbatt_rail_name; in max8907_regulator_probe()
338 if (pmic->desc[i].ops == &max8907_ldo_ops) { in max8907_regulator_probe()
339 ret = regmap_read(config.regmap, pmic->desc[i].enable_reg, in max8907_regulator_probe()
346 pmic->desc[i].ops = &max8907_ldo_hwctl_ops; in max8907_regulator_probe()
347 } else if (pmic->desc[i].ops == &max8907_out5v_ops) { in max8907_regulator_probe()
348 ret = regmap_read(config.regmap, pmic->desc[i].enable_reg, in max8907_regulator_probe()
356 pmic->desc[i].ops = &max8907_out5v_hwctl_ops; in max8907_regulator_probe()
359 rdev = devm_regulator_register(&pdev->dev, in max8907_regulator_probe()
360 &pmic->desc[i], &config); in max8907_regulator_probe()
362 dev_err(&pdev->dev, in max8907_regulator_probe()
364 pmic->desc[i].name); in max8907_regulator_probe()
374 .name = "max8907-regulator",
395 MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@maxim-ic.com>");
397 MODULE_ALIAS("platform:max8907-regulator");