Re: [PATCH 1/2] regulator: st-pwm: get voltage and duty table from dts
From: Lee Jones
Date: Wed Sep 17 2014 - 17:26:57 EST
On Wed, 17 Sep 2014, Doug Anderson wrote:
> On Wed, Sep 17, 2014 at 6:07 AM, Chris Zhong <zyw@xxxxxxxxxxxxxx> wrote:
> > Get voltage & duty table from device tree might be better, other platforms can also use this
> > driver without any modify.
> >
> > Signed-off-by: Chris Zhong <zyw@xxxxxxxxxxxxxx>
>
> Why didn't you CC Lee Jones on your patches? He's the author of the
> driver and should certainly be involved in reviewing your patches.
>
> CCed him now.
Thanks Doug.
> > drivers/regulator/Kconfig | 1 -
> > drivers/regulator/st-pwm.c | 80 +++++++++++++++++++++++---------------------
> > 2 files changed, 42 insertions(+), 39 deletions(-)
> >
> > diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> > index fb32bab..06a9632 100644
> > --- a/drivers/regulator/Kconfig
> > +++ b/drivers/regulator/Kconfig
> > @@ -495,7 +495,6 @@ config REGULATOR_S5M8767
> >
> > config REGULATOR_ST_PWM
> > tristate "STMicroelectronics PWM voltage regulator"
It's okay to generify the driver and remove references to ST.
> > - depends on ARCH_STI
>
> Seems like you should add some wording saying that this driver is also
> useful for other PWM-based voltage regulators.
In the commit message yes, I wouldn't worry about doing that here.
> > help
> > This driver supports ST's PWM controlled voltage regulators.
> >
> > diff --git a/drivers/regulator/st-pwm.c b/drivers/regulator/st-pwm.c
> > index 5ea78df..877381b 100644
> > --- a/drivers/regulator/st-pwm.c
> > +++ b/drivers/regulator/st-pwm.c
In order to avoid confusion to future users, rename the file too.
[...]
> > -static const struct regulator_desc b2105_desc = {
> > +static struct regulator_desc b2105_desc = {
> > .name = "b2105-pwm-regulator",
Generify.
> > .ops = &st_pwm_regulator_voltage_ops,
> > .type = REGULATOR_VOLTAGE,
> > .owner = THIS_MODULE,
> > - .n_voltages = ARRAY_SIZE(b2105_duty_cycle_table),
> > .supply_name = "pwm",
> > };
> >
> > -static const struct st_pwm_regulator_pdata b2105_info = {
> > - .desc = &b2105_desc,
> > - .duty_cycle_table = b2105_duty_cycle_table,
> > -};
> > -
> > static const struct of_device_id st_pwm_of_match[] = {
> > - { .compatible = "st,b2105-pwm-regulator", .data = &b2105_info, },
> > + { .compatible = "st,b2105-pwm-regulator" },
Remove and replace with "pwm-regulator".
As we're no longer matching, you can move this down to the bottom.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/