lkml.org 
[lkml]   [2021]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 2/4] leds: Add driver for Qualcomm LPG
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-04-29 23:13    [W:0.085 / U:1.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site