From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Pawel Moll <pawel.moll@arm.com>, Liam Girdwood <lrg@ti.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: vexpress: Add missing n_voltages setting
Date: Tue, 11 Dec 2012 16:04:10 +0800 [thread overview]
Message-ID: <1355213050.7387.1.camel@phoenix> (raw)
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
next reply other threads:[~2012-12-11 8:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 8:04 Axel Lin [this message]
2012-12-11 13:50 ` [PATCH] regulator: vexpress: Add missing n_voltages setting Pawel Moll
[not found] ` <CAFRkauBScqEMh3y1FcBuYO0dSM1yQV6OOG4Z5HQ8Ueq_Mmm9UA@mail.gmail.com>
2012-12-12 12:10 ` Pawel Moll
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1355213050.7387.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=pawel.moll@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.