Skip to contentSkip to conversation

regulator: vexpress: Add missing n_voltages setting

PATCH In review Axel Lin 2 participants 2 messages Oct 17, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: vexpress: Add missing n_voltages setting

---
Hi Pawel,
I don't have a chance to compile test this patch because I could not find VEXPRESS_CONFIG in current tree.
Can you help testing this patch?

Thanks,
Axel

 drivers/regulator/vexpress.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/regulator/vexpress.c +6 -2
index 1702945..94a8cb9 100644
@@ -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;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Axel Lin

I don't have a chance to compile test this patch because I could not find VEXPRESS_CONFIG in current tree.
Can you help testing this patch?

I'll be more than happy to help, but can you please tell me what use case you have in mind? The "reg->desc.continuous_voltage_range = true;" together with this patch:

http://git.kernel.org/?p=linux/kernel/git/broonie/regulator.git;a=commitdiff;h=bd7a2b600ace90c8819495b639a744c8f5c68feb

were supposed to make the n_voltages unnecessary, as this regulator is (in theory at least) capable of setting any voltage in the constraints range, so there are not real operating points.

Cheers!

Paweł