Re: [PATCH v5 0/7] Add support for LUT PPG

From: Luca Weiss
Date: Fri Oct 13 2023 - 02:35:45 EST


On Thu Oct 12, 2023 at 11:50 PM CEST, Anjelique Melendez wrote:
>
>
> On 10/1/2023 7:15 AM, Luca Weiss wrote:
> > On Fri Sep 29, 2023 at 2:38 AM CEST, Anjelique Melendez wrote:
> >> In certain PMICs, LUT pattern and LPG configuration is stored in SDAM
> >> modules instead of LUT peripheral. This feature is called PPG.
> >>
> >> This change series adds support for PPG. Thanks!
> [..]
> >>
> >> Tested-by: Luca Weiss <luca.weiss@xxxxxxxxxxxxx> # sdm632-fairphone-fp3 (pmi632)
> >
> > Hi Anjelique,
> >
> > Actually I've retested this now on PMI632 (and also realized that my
> > previous tests weren't correct and wasn't actually using hw_pattern).
> >
> > Using the following commands (after boot) I'm expecting to get a
> > 500ms on 500ms off blinking pattern between white (255 255 255) and off
> > (0 0 0).
> >
> > echo pattern > /sys/class/leds/rgb:status/trigger
> > echo -1 > /sys/class/leds/rgb:status/repeat
> >
> > echo "255 255 255" > /sys/class/leds/rgb:status/multi_intensity
> > echo "255 500 255 0 0 500 0 0" > /sys/class/leds/rgb:status/hw_pattern
> >
> > What I actually see is it blinking between cyan (0 255 255) and red (255
> > 0 0).
> > At some point after playing with many patterns I got it to actually
> > cycle between white and off, but I couldn't reproduce this again (or I
> > didn't try hard enough).
> >
> >
> > But with this example it correctly blinks red on-off.
> >
> > echo "255 0 0" > /sys/class/leds/rgb:status/multi_intensity
> > echo "255 500 255 0 0 500 0 0" > /sys/class/leds/rgb:status/hw_pattern
> >
> > With "0 255 0" and "0 0 255" the other colors also work fine, it's just
> > the combinations that seem somewhat broken.
> >
> > Regards
> > Luca
> >
> >
> Hi Luca,
>
> Thanks for testing again and the feedback!
> Looks like for multicolor devices there is a small concurrency issue with
> enabling pattern at the same time for all the led channels. This could be
> why you observed your device blinking between red (255 0 0) and cyan (0 255 255),
> instead of seeing all channels (255 255 255) blink.
> The fix I'm planing to include in the next series is is to disable the multicolor led
> channels first, then configure all channels, and finally re-enable channels
> so that pattern is triggered at the same time for each all of the channels.

Sounds reasonable I think!

>
> I am currently testing with pm8350c device so if you are able to test next series
> on pmi632 it would be very appreciated!

Will do, thanks for fixing it up!

Regards
Luca

>
> Thanks,
> Anjelique