Skip to contentSkip to conversation

regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage

RFC PATCH Applied Axel Lin 2 participants 3 messages Jul 13, 2012 – Aug 1, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

RFC PATCH 1/1 regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage

This was missing until now and the underlying _regulator_do_set_voltage is using this value when calling list_voltage.

---
Not very sure if we should implement set_voltage callback for fixed voltage. ( Other drivers do not implement set_voltage callback for fixed voltage. Since the voltage is fixed, implement set_voltage callback seems does not make sense.)

If we do implement the callback, we need to populate selector. Or alternative, we can just remove mc13xxx_fixed_regulator_set_voltage.

Axel

 drivers/regulator/mc13xxx-regulator-core.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/regulator/mc13xxx-regulator-core.c +4 -2
index d6eda28..8151889 100644
@@ -143,10 +143,12 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
 		__func__, id, min_uV, max_uV);
 
 	if (min_uV <= rdev->desc->volt_table[0] &&
-	    rdev->desc->volt_table[0] <= max_uV)
+	    rdev->desc->volt_table[0] <= max_uV) {
+		*selector = 0;
 		return 0;
-	else
+	} else {
 		return -EINVAL;
+	}
 }
 EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage);
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Axel Lin

Not very sure if we should implement set_voltage callback for fixed voltage. ( Other drivers do not implement set_voltage callback for fixed voltage. Since the voltage is fixed, implement set_voltage callback seems does not make sense.)

We shouldn't normally implement it. The fixed voltage driver does so because it reuses the existing set voltage device tree binding to specify the voltage it provides but I'd not expect other drivers to need to do this.

Applied
#2 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

This was missing until now and the underlying _regulator_do_set_voltage is using this value when calling list_voltage.

Applied, thanks.