linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] leds: Add driver for Qualcomm LPG
Date: Thu, 23 Mar 2017 21:37:49 +0100	[thread overview]
Message-ID: <20170323203749.GB8563@amd> (raw)
In-Reply-To: <20170323055435.29197-1-bjorn.andersson@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2241 bytes --]

Hi!

> The Light Pulse Generator (LPG) is a PWM-block found in a wide range of
> PMICs from Qualcomm. It can operate on fixed parameters or based on a
> lookup-table, altering the duty cycle over time - which provides the
> means for e.g. hardware assisted transitions of LED brightness.

Ok, this is not first hardware that supports something like this. We
have similar hardware that can do blinking on Nokia N900 -- please
take a look at leds-lp55*.c

And it would be really good to provide hardware abstraction. We really
don't want to have different userspace for LPG and for N900 and for
...

Which probably means finding subset that makes sense for everyone.

Hmm. What is difference between "ping_pong" and "reverse"? And do we
really want it? That seems little .. too specialized.

How are different channels on RGB LED synchronized?

> +What:		/sys/class/leds/<led>/pattern
> +Date:		March 2017
> +KernelVersion:	4.12
> +Contact:	Bjorn Andersson <bjorn.andersson@linaro.org>
> +Description:
> +		Comma-separated list of duty cycle values to output from
> +		the ramp generator. Values should be in the range of 0
> +		to 511.

We normally do "space separated" in sysfs.

Can your engine do "smooth transitions"? For example if you want to
slowly turn on the LED on, can you do something more clever than

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
...
496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509,
510, 511

? What is the maximum length of the pattern?

Could we do patterns in form of "delay brightness delay brightness"
.... ?

> +static enum led_brightness lpg_brightnes_get(struct led_classdev *cdev)
> +{
> +	struct lpg *lpg = container_of(cdev, struct lpg, cdev);
> +	unsigned long max = (1 << lpg->pwm_size) - 1;
> +
> +	if (!lpg->enabled)
> +		return LED_OFF;
> +
> +	return lpg->pwm_value * cdev->max_brightness / max;
> +}

Does this return something reasonable when pattern is running?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2017-03-23 20:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  5:54 [PATCH 1/2] leds: Add driver for Qualcomm LPG Bjorn Andersson
2017-03-23  5:54 ` [PATCH 2/2] DT: leds: Add Qualcomm Light Pulse Generator binding Bjorn Andersson
2017-03-29  2:26   ` Rob Herring
2017-03-29 19:26     ` Bjorn Andersson
2017-03-29 22:13   ` Pavel Machek
2017-03-23 20:37 ` Pavel Machek [this message]
2017-03-27  4:48   ` [PATCH 1/2] leds: Add driver for Qualcomm LPG Bjorn Andersson
2017-03-29  2:17   ` Rob Herring
2017-03-29 19:07     ` Bjorn Andersson
2017-03-29 22:23       ` Pavel Machek
2017-03-30  0:09         ` Bjorn Andersson
2017-03-30  7:43           ` Pavel Machek
2017-03-31  9:28             ` Jacek Anaszewski
2017-04-02 12:54               ` Jacek Anaszewski
2017-04-03 18:21                 ` Bjorn Andersson
2017-04-03 20:38                   ` Jacek Anaszewski
2017-04-10  9:52                   ` Pavel Machek
2017-04-03 19:00               ` Bjorn Andersson
2017-04-03 20:38                 ` Jacek Anaszewski
2017-04-07 20:26                   ` Bjorn Andersson
2017-04-08  9:57                     ` Pavel Machek
2017-04-08 13:39                     ` Pavel Machek
2017-04-09 12:32                       ` Jacek Anaszewski
2017-04-10 19:19                       ` Bjorn Andersson
2017-04-11 17:54                         ` Pavel Machek
2017-04-11 23:17                           ` Bjorn Andersson
2017-04-07 13:32                 ` Pavel Machek
2017-04-07 20:36                   ` Bjorn Andersson
2017-04-08  9:33                     ` Pavel Machek
2017-04-07 12:54               ` Pavel Machek
2022-05-23 16:30 ` Pavel Machek
2022-05-23 22:01   ` Marijn Suijten
2022-05-23 22:18     ` Pavel Machek
2022-05-24 18:19       ` Marijn Suijten
2022-05-24 15:02   ` Bjorn Andersson
2022-05-24 18:26     ` Marijn Suijten
2022-05-24 20:10     ` Pavel Machek

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=20170323203749.GB8563@amd \
    --to=pavel@ucw.cz \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rpurdie@rpsys.net \
    /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;
as well as URLs for NNTP newsgroup(s).