mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: pv88060: Fix .ops for PV88060_SW
@ 2019-02-15  1:42 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2019-02-15  1:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: James Ban, Liam Girdwood, linux-kernel, Axel Lin

There is no vsel_reg/vsel_mask settings for PV88060_ID_SWx, so don't use
pv88060_ldo_ops for PV88060_SW. The PV88060_ID_SWx is fixed voltage,
set .fixed_uV instead of .min_uV then regulator core will automatically
support get_voltage and list_voltage.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi James,
I don't have this h/w, please help to review and test this patch.
Thanks,
Axel
 drivers/regulator/pv88060-regulator.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/pv88060-regulator.c b/drivers/regulator/pv88060-regulator.c
index a9446056435f..d5dab9bef378 100644
--- a/drivers/regulator/pv88060-regulator.c
+++ b/drivers/regulator/pv88060-regulator.c
@@ -184,6 +184,12 @@ static const struct regulator_ops pv88060_ldo_ops = {
 	.list_voltage = regulator_list_voltage_linear,
 };
 
+static const struct regulator_ops pv88060_sw_ops = {
+	.enable = regulator_enable_regmap,
+	.disable = regulator_disable_regmap,
+	.is_enabled = regulator_is_enabled_regmap,
+};
+
 #define PV88060_BUCK(chip, regl_name, min, step, max, limits_array) \
 {\
 	.desc	=	{\
@@ -237,9 +243,8 @@ static const struct regulator_ops pv88060_ldo_ops = {
 		.regulators_node = of_match_ptr("regulators"),\
 		.type = REGULATOR_VOLTAGE,\
 		.owner = THIS_MODULE,\
-		.ops = &pv88060_ldo_ops,\
-		.min_uV = max,\
-		.uV_step = 0,\
+		.ops = &pv88060_sw_ops,\
+		.fixed_uV = max,\
 		.n_voltages = 1,\
 		.enable_reg = PV88060_REG_##regl_name##_CONF,\
 		.enable_mask = PV88060_SW_EN,\
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-15  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15  1:42 [PATCH] regulator: pv88060: Fix .ops for PV88060_SW Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®