linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: ab8500: Provide map_voltage() functions
@ 2013-07-03  9:16 Mark Brown
  2013-07-21 14:45 ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-07-03  9:16 UTC (permalink / raw)
  To: Liam Girdwood, Lee Jones, Bengt Jonsson
  Cc: linux-kernel, linaro-kernel, Mark Brown

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


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

* Re: [PATCH] regulator: ab8500: Provide map_voltage() functions
  2013-07-03  9:16 [PATCH] regulator: ab8500: Provide map_voltage() functions Mark Brown
@ 2013-07-21 14:45 ` Linus Walleij
  2013-07-21 23:34   ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2013-07-21 14:45 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Lee Jones, Bengt Jonsson, linaro-kernel,
	linux-kernel, Mark Brown

On Wed, Jul 3, 2013 at 11:16 AM, Mark Brown <broonie@kernel.org> wrote:

> 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>

Hm. Have you looked closer at this one voltage table in this driver:

static const unsigned int ldo_vaux56_voltages[] = {
    1800000,
    1050000,
    1100000,
    1200000,
    1500000,
    2200000,
    2500000,
    2790000,
};

Or this one:

static const unsigned int ldo_sdio_voltages[] = {
    1160000,
    1050000,
    1100000,
    1500000,
    1800000,
    2200000,
    2910000,
    3050000,
};

Yours,
Linus Walleij

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

* Re: [PATCH] regulator: ab8500: Provide map_voltage() functions
  2013-07-21 14:45 ` Linus Walleij
@ 2013-07-21 23:34   ` Mark Brown
  2013-07-22 23:18     ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-07-21 23:34 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Liam Girdwood, Lee Jones, Bengt Jonsson, linaro-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On Sun, Jul 21, 2013 at 04:45:23PM +0200, Linus Walleij wrote:

> Hm. Have you looked closer at this one voltage table in this driver:

> static const unsigned int ldo_vaux56_voltages[] = {
>     1800000,
>     1050000,

Meh, that's annoying - 8 looks too close to zero and it's the first time
I've ever seen non-ascending hardware :/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] regulator: ab8500: Provide map_voltage() functions
  2013-07-21 23:34   ` Mark Brown
@ 2013-07-22 23:18     ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-07-22 23:18 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Lee Jones, Bengt Jonsson, linaro-kernel, linux-kernel

On Mon, Jul 22, 2013 at 1:34 AM, Mark Brown <broonie@kernel.org> wrote:
> On Sun, Jul 21, 2013 at 04:45:23PM +0200, Linus Walleij wrote:
>
>> Hm. Have you looked closer at this one voltage table in this driver:
>
>> static const unsigned int ldo_vaux56_voltages[] = {
>>     1800000,
>>     1050000,
>
> Meh, that's annoying - 8 looks too close to zero and it's the first time
> I've ever seen non-ascending hardware :/

Yeah it totally kills my obsessive-compulsive side ...
but it seems the HW engineer didn't care :-(

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-07-22 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03  9:16 [PATCH] regulator: ab8500: Provide map_voltage() functions Mark Brown
2013-07-21 14:45 ` Linus Walleij
2013-07-21 23:34   ` Mark Brown
2013-07-22 23:18     ` Linus Walleij

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).