* [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function
@ 2014-05-27 6:05 Axel Lin
2014-05-27 9:33 ` Philipp Zabel
2014-05-27 11:06 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-05-27 6:05 UTC (permalink / raw)
To: Mark Brown; +Cc: Philipp Zabel, Liam Girdwood, linux-kernel
When fixed_uV is set and n_voltage is 1, regulator core will return
rdev->desc->fixed_uV in regulator_get_voltage() and regulator_list_voltage().
Rename ltc3589_standby_regulator_ops to ltc3589_fixed_standby_regulator_ops,
this makes the code clear that the ops is for fixed voltage regulator.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/ltc3589.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c
index fef64ee..110a99e 100644
--- a/drivers/regulator/ltc3589.c
+++ b/drivers/regulator/ltc3589.c
@@ -160,15 +160,6 @@ static int ltc3589_set_suspend_mode(struct regulator_dev *rdev,
return regmap_update_bits(ltc3589->regmap, LTC3589_VCCR, mask, bit);
}
-static int ltc3589_list_voltage_fixed(struct regulator_dev *rdev,
- unsigned int selector)
-{
- if (selector)
- return -EINVAL;
-
- return rdev->desc->fixed_uV;
-}
-
/* SW1, SW2, SW3, LDO2 */
static struct regulator_ops ltc3589_linear_regulator_ops = {
.enable = regulator_enable_regmap,
@@ -188,12 +179,10 @@ static struct regulator_ops ltc3589_fixed_regulator_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
- .list_voltage = ltc3589_list_voltage_fixed,
};
/* LDO1 */
-static struct regulator_ops ltc3589_standby_regulator_ops = {
- .list_voltage = ltc3589_list_voltage_fixed,
+static struct regulator_ops ltc3589_fixed_standby_regulator_ops = {
};
/* LDO4 */
@@ -242,7 +231,7 @@ static struct ltc3589_regulator ltc3589_regulators[LTC3589_NUM_REGULATORS] = {
LTC3589_LINEAR_REG(SW2, B2DTV1),
LTC3589_LINEAR_REG(SW3, B3DTV1),
LTC3589_FIXED_REG(BB_OUT),
- LTC3589_REG(LDO1, standby, 0, 0, 0, 0),
+ LTC3589_REG(LDO1, fixed_standby, 0, 0, 0, 0),
LTC3589_LINEAR_REG(LDO2, L2DTV1),
LTC3589_FIXED_REG(LDO3),
LTC3589_REG(LDO4, table, LTC3589_OVEN_LDO4, LTC3589_L2DTV2, 0x60, 0),
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function
2014-05-27 6:05 [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function Axel Lin
@ 2014-05-27 9:33 ` Philipp Zabel
2014-05-27 11:06 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2014-05-27 9:33 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel
Am Dienstag, den 27.05.2014, 14:05 +0800 schrieb Axel Lin:
> When fixed_uV is set and n_voltage is 1, regulator core will return
> rdev->desc->fixed_uV in regulator_get_voltage() and regulator_list_voltage().
>
> Rename ltc3589_standby_regulator_ops to ltc3589_fixed_standby_regulator_ops,
> this makes the code clear that the ops is for fixed voltage regulator.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Looks good to me.
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> drivers/regulator/ltc3589.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/regulator/ltc3589.c b/drivers/regulator/ltc3589.c
> index fef64ee..110a99e 100644
> --- a/drivers/regulator/ltc3589.c
> +++ b/drivers/regulator/ltc3589.c
> @@ -160,15 +160,6 @@ static int ltc3589_set_suspend_mode(struct regulator_dev *rdev,
> return regmap_update_bits(ltc3589->regmap, LTC3589_VCCR, mask, bit);
> }
>
> -static int ltc3589_list_voltage_fixed(struct regulator_dev *rdev,
> - unsigned int selector)
> -{
> - if (selector)
> - return -EINVAL;
> -
> - return rdev->desc->fixed_uV;
> -}
> -
> /* SW1, SW2, SW3, LDO2 */
> static struct regulator_ops ltc3589_linear_regulator_ops = {
> .enable = regulator_enable_regmap,
> @@ -188,12 +179,10 @@ static struct regulator_ops ltc3589_fixed_regulator_ops = {
> .enable = regulator_enable_regmap,
> .disable = regulator_disable_regmap,
> .is_enabled = regulator_is_enabled_regmap,
> - .list_voltage = ltc3589_list_voltage_fixed,
> };
>
> /* LDO1 */
> -static struct regulator_ops ltc3589_standby_regulator_ops = {
> - .list_voltage = ltc3589_list_voltage_fixed,
> +static struct regulator_ops ltc3589_fixed_standby_regulator_ops = {
> };
>
> /* LDO4 */
> @@ -242,7 +231,7 @@ static struct ltc3589_regulator ltc3589_regulators[LTC3589_NUM_REGULATORS] = {
> LTC3589_LINEAR_REG(SW2, B2DTV1),
> LTC3589_LINEAR_REG(SW3, B3DTV1),
> LTC3589_FIXED_REG(BB_OUT),
> - LTC3589_REG(LDO1, standby, 0, 0, 0, 0),
> + LTC3589_REG(LDO1, fixed_standby, 0, 0, 0, 0),
> LTC3589_LINEAR_REG(LDO2, L2DTV1),
> LTC3589_FIXED_REG(LDO3),
> LTC3589_REG(LDO4, table, LTC3589_OVEN_LDO4, LTC3589_L2DTV2, 0x60, 0),
thanks
Philipp
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function
2014-05-27 6:05 [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function Axel Lin
2014-05-27 9:33 ` Philipp Zabel
@ 2014-05-27 11:06 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-05-27 11:06 UTC (permalink / raw)
To: Axel Lin; +Cc: Philipp Zabel, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
On Tue, May 27, 2014 at 02:05:09PM +0800, Axel Lin wrote:
> When fixed_uV is set and n_voltage is 1, regulator core will return
> rdev->desc->fixed_uV in regulator_get_voltage() and regulator_list_voltage().
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:[~2014-05-27 11:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 6:05 [PATCH] regulator: ltc3589: Remove ltc3589_list_voltage_fixed function Axel Lin
2014-05-27 9:33 ` Philipp Zabel
2014-05-27 11:06 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox