Re: [PATCH v6 2/4] leds: Add driver for Qualcomm LPG
From: Pavel Machek
Date: Thu Apr 29 2021 - 17:12:30 EST
Hi!
> > > +static int lpg_add_pwm(struct lpg *lpg)
> > > +{
> > > + int ret;
> > > +
> > > + lpg->pwm.base = -1;
> > > + lpg->pwm.dev = lpg->dev;
> > > + lpg->pwm.npwm = lpg->num_channels;
> > > + lpg->pwm.ops = &lpg_pwm_ops;
> > > +
> > > + ret = pwmchip_add(&lpg->pwm);
> > > + if (ret)
> > > + dev_err(lpg->dev, "failed to add PWM chip: ret %d\n", ret);
> > > +
> > > + return ret;
> > > +}
> >
> > Do we need to do this? I'd rather have LED driver, than LED+PWM
> > driver...
> >
>
> Yes, I believe we need to do this.
>
> Because each piece of hardware has N channels, which can be wired to
> LEDs, grouped with other channels and wired to multicolor LEDs or be
> used as PWM signals. And this configuration is board specific.
>
> One such example is the laptop in front of me, which has 3 channels
> wired to an RGB LED and 1 channel wired as a backlight control signal
> (i.e. using pwm-backlight). Another example is a devboard where the
> 4 channels are wired to 4 LEDs.
Ok, so this is actually important. In this case you should have PWM
layer, exporting PWMs, and then rgb-LED driver that takes three of
those PWMs and turns them into LED, no?
And ... surprise ... that is likely to help other people, as LEDs
connected to PWMs are quite common.
Hmm.?
If you can't do this for some reason, you should probably explain in
the changelog, because this is going to be FAQ.
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
Attachment:
signature.asc
Description: Digital signature