lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfSPYkbTXMOUGKkG@yoga>
Date:   Fri, 28 Jan 2022 18:50:42 -0600
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Marijn Suijten <marijn.suijten@...ainline.org>
Cc:     Pavel Machek <pavel@....cz>, Rob Herring <robh+dt@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Uwe Kleine-K?nig <u.kleine-koenig@...gutronix.de>,
        Lee Jones <lee.jones@...aro.org>, linux-leds@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-pwm@...r.kernel.org,
        Yassine Oudjana <y.oudjana@...tonmail.com>,
        Luca Weiss <luca@...tu.xyz>,
        Subbaraman Narayanamurthy <subbaram@...eaurora.org>
Subject: Re: [PATCH v10 2/2] leds: Add driver for Qualcomm LPG

On Wed 27 Oct 16:19 CDT 2021, Marijn Suijten wrote:

> Hi Bjorn,
> 
> On 2021-10-22 10:25:35, Bjorn Andersson wrote:
> > On Sat 09 Oct 21:39 PDT 2021, Bjorn Andersson wrote:
> > 
> > > The Light Pulse Generator (LPG) is a PWM-block found in a wide range of
> > > PMICs from Qualcomm. These PMICs typically comes with 1-8 LPG instances,
> > > with their output being routed to various other components, such as
> > > current sinks or GPIOs.
> > > 
> > > Each LPG instance can operate on fixed parameters or based on a shared
> > > lookup-table, altering the duty cycle over time. This provides the means
> > > for hardware assisted transitions of LED brightness.
> > > 
> > > A typical use case for the fixed parameter mode is to drive a PWM
> > > backlight control signal, the driver therefor allows each LPG instance
> > > to be exposed to the kernel either through the LED framework or the PWM
> > > framework.
> > > 
> > > A typical use case for the LED configuration is to drive RGB LEDs in
> > > smartphones etc, for which the driver support multiple channels to be
> > > ganged up to a MULTICOLOR LED. In this configuration the pattern
> > > generators will be synchronized, to allow for multi-color patterns.
> > > 
> > > Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> > > ---
> > 
> > Any feedback on this?
> 
> I asked in #linux-msm whether anything is wrong with the patterns,
> since my Sony Discovery (sdm630 with a pm660l) blinks way quicker on a
> pattern that's supposed to stay on for 1s and off for 1s:
> 
>     echo "0 1000 255 1000" > /sys/class/leds/rgb\:status/hw_pattern
> 
> It however seems to be broken in the same way on an older version now
> (this might be v9 or v8) which I don't remember to be the case.  Can you
> double-check if this is all working fine on your side?  If so, I'll have
> to find some time to debug it on my end.
> 

I had missed the fact that LPG_RAMP_DURATION_REG is two registers for
msg and lsb, for a total of 9 bits of duration. So what you saw was
probably ticking at 232ms.

Note though that the pattern uses the last time as "high pause", so I
expect that you should have seen 232 ms of off, followed by 464ms of
light.

I've fixed this for v11, both rejecting invalid input and writing out
all 9 bits.

Thanks for spotting this!
Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ