All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: vexpress: Add missing n_voltages setting
@ 2012-12-11  8:04 Axel Lin
  2012-12-11 13:50 ` Pawel Moll
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2012-12-11  8:04 UTC (permalink / raw)
  To: Mark Brown; +Cc: Pawel Moll, Liam Girdwood, linux-kernel

Otherwise regulator_can_change_voltage() return 0 for this driver.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/vexpress.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/vexpress.c b/drivers/regulator/vexpress.c
index 4668c7f..9bb3aa0 100644
--- a/drivers/regulator/vexpress.c
+++ b/drivers/regulator/vexpress.c
@@ -86,10 +86,14 @@ static int vexpress_regulator_probe(struct platform_device *pdev)
 	}
 
 	init_data->constraints.apply_uV = 0;
-	if (init_data->constraints.min_uV && init_data->constraints.max_uV)
+	if (init_data->constraints.min_uV && init_data->constraints.max_uV) {
 		reg->desc.ops = &vexpress_regulator_ops;
-	else
+		reg->desc.n_voltages = init_data->constraints.max_uV -
+				       init_data->constraints.min_uV + 1;
+	} else {
 		reg->desc.ops = &vexpress_regulator_ops_ro;
+		reg->desc.n_voltages = 1;
+	}
 
 	config.dev = &pdev->dev;
 	config.init_data = init_data;
-- 
1.7.9.5




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

end of thread, other threads:[~2012-12-12 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11  8:04 [PATCH] regulator: vexpress: Add missing n_voltages setting Axel Lin
2012-12-11 13:50 ` Pawel Moll
     [not found]   ` <CAFRkauBScqEMh3y1FcBuYO0dSM1yQV6OOG4Z5HQ8Ueq_Mmm9UA@mail.gmail.com>
2012-12-12 12:10     ` Pawel Moll

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.