Re: [PATCH v3 3/3] pwm: New driver to support PWM driven LEDs onTWL4030/6030 series of PMICs

From: Thierry Reding
Date: Tue Nov 20 2012 - 06:58:53 EST


On Tue, Nov 20, 2012 at 12:54:11PM +0100, Peter Ujfalusi wrote:
> On 11/20/2012 10:56 AM, Peter Ujfalusi wrote:
> > The driver supports the following LED outputs as generic PWM driver:
> > TWL4030 LEDA and LEDB (PWMA and PWMB)
> > TWL6030 Charging indicator LED (PWM LED)
> >
> > On TWL6030 when the PWM requested LED is configured to be controlled by SW.
> > In this case the user can enable/disable and set the duty period freely.
> > When the PWM has been freed, the LED driver is put back to HW control.
> >
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxx>
> > ---
> > drivers/pwm/Kconfig | 10 ++
> > drivers/pwm/Makefile | 1 +
> > drivers/pwm/pwm-twl-led.c | 303 ++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 314 insertions(+)
> > create mode 100644 drivers/pwm/pwm-twl-led.c
>
> ...
>
> > +static int twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm,
> > + int duty_ns, int period_ns)
> > +{
> > + int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns);
> > + u8 pwm_config[2] = {1, 0};
> > + int base, ret;
> > +
> > + /*
> > + * To configure the duty period:
> > + * On-cycle is set to 1 (the minimum allowed value)
> > + * The off time of 0 is not configurable, so the mapping is:
> > + * 0 -> off cycle = 2,
> > + * 1 -> off cycle = 2,
> > + * 2 -> off cycle = 3,
> > + * 125 - > off cycle 127,
> > + * 126 - > off cycle 1
>
> Oh, I missed to save the updated comment before I commited the change.
> Can I just send and update patch instead of the whole series again?

Sure.

Sorry for taking so long to review this. I'm rather busy with other
things but I'll try to find some time to review properly tonight or
tomorrow.

Thierry

Attachment: pgp00000.pgp
Description: PGP signature