linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org,
	Mark Brown <broonie@linaro.org>
Subject: [PATCH] regulator: ab8500: Provide map_voltage() functions
Date: Wed,  3 Jul 2013 10:16:32 +0100	[thread overview]
Message-ID: <1372842992-18712-1-git-send-email-broonie@kernel.org> (raw)

From: Mark Brown <broonie@linaro.org>

Since all the voltage tables for ab8500 are sorted in ascending order we
can improve performance by using regulator_map_voltage_ascend(). A couple
of the regulators can actually use linear maps which would be even better.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/regulator/ab8500.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 603f192..43cb354 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -651,6 +651,7 @@ static struct regulator_ops ab8500_regulator_volt_mode_ops = {
 	.get_voltage_sel 	= ab8500_regulator_get_voltage_sel,
 	.set_voltage_sel	= ab8500_regulator_set_voltage_sel,
 	.list_voltage		= regulator_list_voltage_table,
+	.map_voltage		= regulator_map_voltage_ascend,
 };
 
 static struct regulator_ops ab8540_aux3_regulator_volt_mode_ops = {
@@ -663,6 +664,7 @@ static struct regulator_ops ab8540_aux3_regulator_volt_mode_ops = {
 	.get_voltage_sel = ab8540_aux3_regulator_get_voltage_sel,
 	.set_voltage_sel = ab8540_aux3_regulator_set_voltage_sel,
 	.list_voltage	= regulator_list_voltage_table,
+	.map_voltage	= regulator_map_voltage_ascend,
 };
 
 static struct regulator_ops ab8500_regulator_volt_ops = {
@@ -672,6 +674,7 @@ static struct regulator_ops ab8500_regulator_volt_ops = {
 	.get_voltage_sel = ab8500_regulator_get_voltage_sel,
 	.set_voltage_sel = ab8500_regulator_set_voltage_sel,
 	.list_voltage	= regulator_list_voltage_table,
+	.map_voltage	= regulator_map_voltage_ascend,
 };
 
 static struct regulator_ops ab8500_regulator_mode_ops = {
@@ -682,6 +685,7 @@ static struct regulator_ops ab8500_regulator_mode_ops = {
 	.set_mode		= ab8500_regulator_set_mode,
 	.get_mode		= ab8500_regulator_get_mode,
 	.list_voltage		= regulator_list_voltage_table,
+	.map_voltage	= regulator_map_voltage_ascend,
 };
 
 static struct regulator_ops ab8500_regulator_ops = {
@@ -689,6 +693,7 @@ static struct regulator_ops ab8500_regulator_ops = {
 	.disable		= ab8500_regulator_disable,
 	.is_enabled		= ab8500_regulator_is_enabled,
 	.list_voltage		= regulator_list_voltage_table,
+	.map_voltage		= regulator_map_voltage_ascend,
 };
 
 static struct regulator_ops ab8500_regulator_anamic_mode_ops = {
@@ -698,6 +703,7 @@ static struct regulator_ops ab8500_regulator_anamic_mode_ops = {
 	.set_mode	= ab8500_regulator_set_mode,
 	.get_mode	= ab8500_regulator_get_mode,
 	.list_voltage	= regulator_list_voltage_table,
+	.map_voltage	= regulator_map_voltage_ascend,
 };
 
 /* AB8500 regulator information */
-- 
1.8.3.1


             reply	other threads:[~2013-07-03  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03  9:16 Mark Brown [this message]
2013-07-21 14:45 ` [PATCH] regulator: ab8500: Provide map_voltage() functions Linus Walleij
2013-07-21 23:34   ` Mark Brown
2013-07-22 23:18     ` Linus Walleij

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=1372842992-18712-1-git-send-email-broonie@kernel.org \
    --to=broonie@kernel.org \
    --cc=bengt.g.jonsson@stericsson.com \
    --cc=broonie@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).