From: Marijn Suijten <marijn.suijten@somainline.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Pavel Machek <pavel@ucw.cz>,
Thierry Reding <thierry.reding@gmail.com>,
Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>,
Lee Jones <lee.jones@linaro.org>,
Satya Priya Kakitapalli <c_skakit@qti.qualcomm.com>,
Luca Weiss <luca@z3ntu.xyz>, Rob Herring <robh+dt@kernel.org>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH v11 2/2] leds: Add driver for Qualcomm LPG
Date: Fri, 4 Feb 2022 00:20:00 +0100 [thread overview]
Message-ID: <20220203232000.btb2qt7t6rmmnayw@SoMainline.org> (raw)
In-Reply-To: <CAOCOHw7LS=NALXzHMN6LauEqrjDk2y27VoQtaT4tkHJiYxM7MQ@mail.gmail.com>
On 2022-02-02 16:08:29, Bjorn Andersson wrote:
> On Wed, Feb 2, 2022 at 2:04 PM Bjorn Andersson
> <bjorn.andersson@linaro.org> wrote:
> >
> > On Wed 02 Feb 03:18 PST 2022, Marijn Suijten wrote:
> >
> > > On 2022-01-28 16:54:29, 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@linaro.org>
> > >
> > > Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
> > >
> > > There may still be some things to improve based on whether lo_pause
> > > works in non-ping-pong mode - to alleviate the requirement for the first
> > > delta_t to be at most 512ms - but this patch should not be delayed much
> > > longer and that's perhaps for a followup patch. Same for my request for
> > > documentation and examples which at the same time serve as some form of
> > > tests to see if everything works as desired.
> > >
> >
> > I've been considering lopause to be the value before we start the
> > pattern, but I think you're right in that it denotes how long we should
> > hold the first value.
> >
> > So I think it might make sense in the predefined "<value> <delay> <value>
> > <delay>" scheme to use first <delay> as to calculate lo-pause. I think
> > it has to be calculated, because the first value will iiuc be held
> > for (lopause + 1) * delay ms.
As mentioned in v10 that seems like a great idea, as long as we can
carefully validate and communicate these numbers to the user; both
through documentation and kernel error messages when values are
ultimately rejected.
Again, perhaps it might be better to postpone this to a separate
patchset as to not block the use of LPG for backlights which is arguably
more important than some fancy phone notification led patterns.
> > > I also vaguely remember other (downstream) drivers to support more than
> > > 512ms per step by (drastically?) changing PWM period, but not sure how
> > > that worked again nor if it was reliable.
> > >
> >
> > Thinking about it again, while 512 is the 9th bit, we should be able to
> > represent [0..1023] with 9 bits...
> >
>
> Sorry, my mind was elsewhere as I wrote that. [0..511] is what we got.
Yes, 9 bits in total and BIT(8) being the highest settable ^^
- Marijn
next prev parent reply other threads:[~2022-02-03 23:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 0:54 [PATCH v11 1/2] dt-bindings: leds: Add Qualcomm Light Pulse Generator binding Bjorn Andersson
2022-01-29 0:54 ` [PATCH v11 2/2] leds: Add driver for Qualcomm LPG Bjorn Andersson
2022-02-02 11:18 ` Marijn Suijten
2022-02-02 20:05 ` Bjorn Andersson
2022-02-02 22:08 ` Bjorn Andersson
2022-02-03 23:20 ` Marijn Suijten [this message]
2022-02-02 14:56 ` Andy Shevchenko
2022-02-02 20:40 ` Bjorn Andersson
2022-02-02 16:29 ` Uwe Kleine-König
2022-02-02 21:40 ` Bjorn Andersson
2022-02-03 8:31 ` Uwe Kleine-König
2022-02-03 21:05 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220203232000.btb2qt7t6rmmnayw@SoMainline.org \
--to=marijn.suijten@somainline.org \
--cc=bjorn.andersson@linaro.org \
--cc=c_skakit@qti.qualcomm.com \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=luca@z3ntu.xyz \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®