Lines Matching +full:regulator +full:- +full:v6
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * PCAP2 Regulator Driver
13 #include <linux/regulator/driver.h>
14 #include <linux/regulator/machine.h>
15 #include <linux/mfd/ezx-pcap.h>
116 VREG_INFO(V6, PCAP_REG_VREG2, 1, 2, 14, 20),
147 /* the regulator doesn't support voltage switching */ in pcap_regulator_set_voltage_sel()
148 if (rdev->desc->n_voltages == 1) in pcap_regulator_set_voltage_sel()
149 return -EINVAL; in pcap_regulator_set_voltage_sel()
151 return ezx_pcap_set_bits(pcap, vreg->reg, in pcap_regulator_set_voltage_sel()
152 (rdev->desc->n_voltages - 1) << vreg->index, in pcap_regulator_set_voltage_sel()
153 selector << vreg->index); in pcap_regulator_set_voltage_sel()
162 if (rdev->desc->n_voltages == 1) in pcap_regulator_get_voltage_sel()
165 ezx_pcap_read(pcap, vreg->reg, &tmp); in pcap_regulator_get_voltage_sel()
166 tmp = ((tmp >> vreg->index) & (rdev->desc->n_voltages - 1)); in pcap_regulator_get_voltage_sel()
175 if (vreg->en == NA) in pcap_regulator_enable()
176 return -EINVAL; in pcap_regulator_enable()
178 return ezx_pcap_set_bits(pcap, vreg->reg, 1 << vreg->en, 1 << vreg->en); in pcap_regulator_enable()
186 if (vreg->en == NA) in pcap_regulator_disable()
187 return -EINVAL; in pcap_regulator_disable()
189 return ezx_pcap_set_bits(pcap, vreg->reg, 1 << vreg->en, 0); in pcap_regulator_disable()
198 if (vreg->en == NA) in pcap_regulator_is_enabled()
199 return -EINVAL; in pcap_regulator_is_enabled()
201 ezx_pcap_read(pcap, vreg->reg, &tmp); in pcap_regulator_is_enabled()
202 return (tmp >> vreg->en) & 1; in pcap_regulator_is_enabled()
226 VREG(V1), VREG(V2), VREG(V3), VREG(V4), VREG(V5), VREG(V6), VREG(V7),
234 void *pcap = dev_get_drvdata(pdev->dev.parent); in pcap_regulator_probe()
237 config.dev = &pdev->dev; in pcap_regulator_probe()
238 config.init_data = dev_get_platdata(&pdev->dev); in pcap_regulator_probe()
241 rdev = devm_regulator_register(&pdev->dev, &pcap_regulators[pdev->id], in pcap_regulator_probe()
253 .name = "pcap-regulator",
273 MODULE_DESCRIPTION("PCAP2 Regulator Driver");