* [PATCH] regulator: st-pwm: Convert to get_voltage_sel
@ 2014-03-21 23:22 Axel Lin
2014-03-24 8:36 ` Lee Jones
2014-03-24 10:49 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-03-21 23:22 UTC (permalink / raw)
To: Mark Brown; +Cc: Lee Jones, Liam Girdwood, linux-kernel
Also remove test for selector in st_pwm_regulator_set_voltage_sel, the checking
is already done in .list_voltage.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/st-pwm.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/st-pwm.c b/drivers/regulator/st-pwm.c
index 6ef569f..e367af1 100644
--- a/drivers/regulator/st-pwm.c
+++ b/drivers/regulator/st-pwm.c
@@ -39,11 +39,11 @@ struct st_pwm_voltages {
unsigned int dutycycle;
};
-static int st_pwm_regulator_get_voltage(struct regulator_dev *dev)
+static int st_pwm_regulator_get_voltage_sel(struct regulator_dev *dev)
{
struct st_pwm_regulator_data *drvdata = rdev_get_drvdata(dev);
- return drvdata->pdata->duty_cycle_table[drvdata->state].uV;
+ return drvdata->state;
}
static int st_pwm_regulator_set_voltage_sel(struct regulator_dev *dev,
@@ -53,9 +53,6 @@ static int st_pwm_regulator_set_voltage_sel(struct regulator_dev *dev,
int dutycycle;
int ret;
- if (selector >= dev->desc->n_voltages)
- return -EINVAL;
-
dutycycle = (ST_PWM_REG_PERIOD / 100) *
drvdata->pdata->duty_cycle_table[selector].dutycycle;
@@ -92,7 +89,7 @@ static int st_pwm_regulator_list_voltage(struct regulator_dev *dev,
static struct regulator_ops st_pwm_regulator_voltage_ops = {
.set_voltage_sel = st_pwm_regulator_set_voltage_sel,
- .get_voltage = st_pwm_regulator_get_voltage,
+ .get_voltage_sel = st_pwm_regulator_get_voltage_sel,
.list_voltage = st_pwm_regulator_list_voltage,
.map_voltage = regulator_map_voltage_iterate,
};
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: st-pwm: Convert to get_voltage_sel
2014-03-21 23:22 [PATCH] regulator: st-pwm: Convert to get_voltage_sel Axel Lin
@ 2014-03-24 8:36 ` Lee Jones
2014-03-24 10:49 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2014-03-24 8:36 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Liam Girdwood, linux-kernel
> Also remove test for selector in st_pwm_regulator_set_voltage_sel, the checking
> is already done in .list_voltage.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/st-pwm.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Wow! Not even going to give me a chance to fix it myself eh?
Acked-by: Lee Jones <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: st-pwm: Convert to get_voltage_sel
2014-03-21 23:22 [PATCH] regulator: st-pwm: Convert to get_voltage_sel Axel Lin
2014-03-24 8:36 ` Lee Jones
@ 2014-03-24 10:49 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-03-24 10:49 UTC (permalink / raw)
To: Axel Lin; +Cc: Lee Jones, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
On Sat, Mar 22, 2014 at 07:22:38AM +0800, Axel Lin wrote:
> Also remove test for selector in st_pwm_regulator_set_voltage_sel, the checking
> is already done in .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-03-24 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 23:22 [PATCH] regulator: st-pwm: Convert to get_voltage_sel Axel Lin
2014-03-24 8:36 ` Lee Jones
2014-03-24 10:49 ` 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.