All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage
@ 2012-07-13 15:01 Axel Lin
  2012-07-13 16:34 ` Mark Brown
  2012-08-01 19:56 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-07-13 15:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: Yong Shen, Fabio Estevam, Sascha Hauer, Arnaud Patard,
	Liam Girdwood, linux-kernel

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

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
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(-)

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index d6eda28..8151889 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -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);
 
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-01 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13 15:01 [PATCH RFC] regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage Axel Lin
2012-07-13 16:34 ` Mark Brown
2012-08-01 19:56 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.