All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10
@ 2012-05-21 11:46 Axel Lin
  2012-05-21 12:13 ` Graeme Gregory
  2012-05-21 14:48 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-05-21 11:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Graeme Gregory, Mark Brown, Liam Girdwood

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/palmas-regulator.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 9b7ca90..4fd8333 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -400,19 +400,14 @@ static struct regulator_ops palmas_ops_smps = {
 	.map_voltage		= palmas_map_voltage_smps,
 };
 
-static int palmas_list_voltage_smps10(struct regulator_dev *dev,
-					unsigned selector)
-{
-	return 3750000 + (selector * 1250000);
-}
-
 static struct regulator_ops palmas_ops_smps10 = {
 	.is_enabled		= regulator_is_enabled_regmap,
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
 	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
 	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
-	.list_voltage		= palmas_list_voltage_smps10,
+	.list_voltage		= regulator_list_voltage_linear;
+	.map_voltage		= regulator_map_voltage_linear;
 };
 
 static int palmas_is_enabled_ldo(struct regulator_dev *dev)
@@ -675,6 +670,8 @@ static __devinit int palmas_probe(struct platform_device *pdev)
 			pmic->desc[id].vsel_mask = SMPS10_VSEL;
 			pmic->desc[id].enable_reg = PALMAS_SMPS10_STATUS;
 			pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
+			pmic->desc[id].min_uV = 3750000;
+			pmic->desc[id].uV_step = 1250000;
 		}
 
 		pmic->desc[id].type = REGULATOR_VOLTAGE;
-- 
1.7.5.4




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

* Re: [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10
  2012-05-21 11:46 [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10 Axel Lin
@ 2012-05-21 12:13 ` Graeme Gregory
  2012-05-21 14:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Graeme Gregory @ 2012-05-21 12:13 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Mark Brown, Liam Girdwood

This is a good improvement I missed.

Acked-by: Graeme Gregory <gg@slimlogic.co.uk>

On 21/05/12 12:46, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/regulator/palmas-regulator.c |   11 ++++-------
>  1 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
> index 9b7ca90..4fd8333 100644
> --- a/drivers/regulator/palmas-regulator.c
> +++ b/drivers/regulator/palmas-regulator.c
> @@ -400,19 +400,14 @@ static struct regulator_ops palmas_ops_smps = {
>  	.map_voltage		= palmas_map_voltage_smps,
>  };
>  
> -static int palmas_list_voltage_smps10(struct regulator_dev *dev,
> -					unsigned selector)
> -{
> -	return 3750000 + (selector * 1250000);
> -}
> -
>  static struct regulator_ops palmas_ops_smps10 = {
>  	.is_enabled		= regulator_is_enabled_regmap,
>  	.enable			= regulator_enable_regmap,
>  	.disable		= regulator_disable_regmap,
>  	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
>  	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
> -	.list_voltage		= palmas_list_voltage_smps10,
> +	.list_voltage		= regulator_list_voltage_linear;
> +	.map_voltage		= regulator_map_voltage_linear;
>  };
>  
>  static int palmas_is_enabled_ldo(struct regulator_dev *dev)
> @@ -675,6 +670,8 @@ static __devinit int palmas_probe(struct platform_device *pdev)
>  			pmic->desc[id].vsel_mask = SMPS10_VSEL;
>  			pmic->desc[id].enable_reg = PALMAS_SMPS10_STATUS;
>  			pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
> +			pmic->desc[id].min_uV = 3750000;
> +			pmic->desc[id].uV_step = 1250000;
>  		}
>  
>  		pmic->desc[id].type = REGULATOR_VOLTAGE;


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

* Re: [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10
  2012-05-21 11:46 [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10 Axel Lin
  2012-05-21 12:13 ` Graeme Gregory
@ 2012-05-21 14:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-05-21 14:48 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Graeme Gregory, Liam Girdwood

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

On Mon, May 21, 2012 at 07:46:41PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied, thanks.

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

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

end of thread, other threads:[~2012-05-21 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 11:46 [PATCH] regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10 Axel Lin
2012-05-21 12:13 ` Graeme Gregory
2012-05-21 14:48 ` Mark Brown

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.