Lines Matching +full:en +full:- +full:gpios

1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/mfd/rohm-bd957x.h>
11 #include <linux/mfd/rohm-generic.h>
47 const struct regulator_desc *desc = rdev->desc; in bd957x_vout34_list_voltage()
48 int multiplier = selector & desc->vsel_mask & 0x7f; in bd957x_vout34_list_voltage()
55 return desc->fixed_uV - tune; in bd957x_vout34_list_voltage()
57 return desc->fixed_uV + tune; in bd957x_vout34_list_voltage()
63 const struct regulator_desc *desc = rdev->desc; in bd957x_list_voltage()
64 int index = selector & desc->vsel_mask & 0x7f; in bd957x_list_voltage()
67 index += desc->n_voltages/2; in bd957x_list_voltage()
69 if (index >= desc->n_voltages) in bd957x_list_voltage()
70 return -EINVAL; in bd957x_list_voltage()
72 return desc->volt_table[index]; in bd957x_list_voltage()
95 .of_match = of_match_ptr("regulator-vd50"),
114 .of_match = of_match_ptr("regulator-vd18"),
133 .of_match = of_match_ptr("regulator-vdddr"),
151 .of_match = of_match_ptr("regulator-vd10"),
170 .of_match = of_match_ptr("regulator-voutl1"),
189 .of_match = of_match_ptr("regulator-vouts1"),
213 enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; in bd957x_probe()
215 regmap = dev_get_regmap(pdev->dev.parent, NULL); in bd957x_probe()
217 dev_err(&pdev->dev, "No regmap\n"); in bd957x_probe()
218 return -EINVAL; in bd957x_probe()
220 vout_mode = of_property_read_bool(pdev->dev.parent->of_node, in bd957x_probe()
221 "rohm,vout1-en-low"); in bd957x_probe()
223 struct gpio_desc *en; in bd957x_probe() local
225 dev_dbg(&pdev->dev, "GPIO controlled mode\n"); in bd957x_probe()
229 en = devm_gpiod_get_from_of_node(&pdev->dev, in bd957x_probe()
230 pdev->dev.parent->of_node, in bd957x_probe()
231 "rohm,vout1-en-gpios", 0, in bd957x_probe()
232 GPIOD_OUT_LOW, "vout1-en"); in bd957x_probe()
233 if (!IS_ERR(en)) { in bd957x_probe()
240 config.ena_gpiod = en; in bd957x_probe()
244 * vout1-en LOW during OTP loading and set VOUT1 to be in bd957x_probe()
245 * controlled by GPIO - but control the GPIO from some in bd957x_probe()
249 * I believe such case where rohm,vout1-en-low is set in bd957x_probe()
250 * and vout1-en-gpios is not is likely to be a in bd957x_probe()
253 dev_err(&pdev->dev, in bd957x_probe()
255 return PTR_ERR(en); in bd957x_probe()
262 * template. At the moment I see no such use-case so I spare some in bd957x_probe()
263 * bytes and use bd9576_regulators directly for non-constant configs in bd957x_probe()
266 ddr_sel = of_property_read_bool(pdev->dev.parent->of_node, in bd957x_probe()
267 "rohm,ddr-sel-low"); in bd957x_probe()
275 dev_dbg(&pdev->dev, "Found BD9576MUF\n"); in bd957x_probe()
278 dev_dbg(&pdev->dev, "Found BD9573MUF\n"); in bd957x_probe()
281 dev_err(&pdev->dev, "Unsupported chip type\n"); in bd957x_probe()
282 err = -EINVAL; in bd957x_probe()
286 config.dev = pdev->dev.parent; in bd957x_probe()
296 desc = &r->desc; in bd957x_probe()
298 rdev = devm_regulator_register(&pdev->dev, desc, &config); in bd957x_probe()
300 dev_err(&pdev->dev, in bd957x_probe()
302 desc->name); in bd957x_probe()
307 * Clear the VOUT1 GPIO setting - rest of the regulators do not in bd957x_probe()
318 { "bd9573-pmic", ROHM_CHIP_TYPE_BD9573 },
319 { "bd9576-pmic", ROHM_CHIP_TYPE_BD9576 },
326 .name = "bd957x-pmic",
337 MODULE_ALIAS("platform:bd957x-pmic");