# Re: \[PATCH v7 2/3\] pwm\_backlight: use power sequences

- From: Alex Courbot \<acourbot@nvidia.com\>
- Date: 2012-10-19 09:30:06 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2012/10/3942189
- Thread: https://ratatoskr.run/linux-fbdev/2012/10/3942172/t.md

```text
On Friday 19 October 2012 17:20:36 Tony Prisk wrote:
> On Fri, 2012-10-19 at 18:06 +0900, Alexandre Courbot wrote:
> > +static void pwm_backlight_on(struct backlight_device *bl)
> > +{
> > +     struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
> > +     int ret;
> > +
> > +     if (pb->enabled)
> > +             return;
> > +
> > +     if (pb->power_on_seq) {
> > +             ret = power_seq_run(pb->power_on_seq);
> > +             if (ret < 0) {
> > +                     dev_err(&bl->dev, "cannot run power on
> > sequence\n");
> > +                     return;
> > +             }
> > +     } else {
> > +             /* legacy framework */
> > +             pwm_config(pb->pwm, 0, pb->period);
> > +             pwm_disable(pb->pwm);
> 
> Is this right? pwm_disable() in the backlight_on function?

Now everybody will notice that I never really tested the legacy interface. >_<

Thanks, this was totally wrong indeed.

Alex.

```
