mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	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, Fenglin Wu <fenglinw@codeaurora.org>
Subject: Re: [PATCH v2 1/3] leds: core: Introduce generic pattern interface
Date: Sun, 16 Jul 2017 20:49:26 +0200	[thread overview]
Message-ID: <beb9b4c3-4922-1ebb-5017-a4b791cdb4d7@gmail.com> (raw)
In-Reply-To: <20170706031801.GB12954@xo-6d-61-c0.localdomain>

Hi,

On 07/06/2017 05:18 AM, Pavel Machek wrote:
> Hi!
> 
>> Some LED controllers have support for autonomously controlling
>> brightness over time, according to some preprogrammed pattern or
>> function.
>>
>> This adds a new optional operator that LED class drivers can implement
>> if they support such functionality as well as a new device attribute to
>> configure the pattern for a given LED.
> 
>> @@ -61,3 +61,23 @@ Description:
>>  		gpio and backlight triggers. In case of the backlight trigger,
>>  		it is useful when driving a LED which is intended to indicate
>>  		a device in a standby like state.
>> +
>> +What:		/sys/class/leds/<led>/pattern
>> +Date:		July 2017
>> +KernelVersion:	4.14
>> +Description:
>> +		Specify a pattern for the LED, for LED hardware that support
>> +		altering the brightness as a function of time.
>> +
>> +		The pattern is given by a series of tuples, of brightness and
>> +		duration (ms). The LED is expected to traverse the series and
>> +		each brightness value for the specified duration.
>> +
>> +		Additionally a repeat marker ":|" can be appended to the
>> +		series, which should cause the pattern to be repeated
>> +		endlessly.
>> +
>> +		As LED hardware might have different capabilities and precision
>> +		the requested pattern might be slighly adjusted by the driver
>> +		and the resulting pattern of such operation should be returned
>> +		when this file is read.
> 
> Well. I believe this is mostly useful for RGB LEDs. Unfortunately, having patterns
> per-LED will present opportunity for different channels becoming de-synchronized
> from each other, which will not look nice.

Hmm, they are only [brightness duration] tuples, and no definition of
R, G and B LED device is covered here, so how it can be useful for RGB
LEDs?

I've been working on addition of RGB LED support to the LED core for
some time now, in the way as we agreed upon at [0], but it turns out to
be less trivial if we want to do it in an elegant way.

Less elegant way would be duplicating led-core functions and changing
single enum led_brightness argument with the three ones (or a struct
containing three brightness components)

I chose to go the elegant way and tried to introduce led_classdev_base
type that would be customizable with the set of ops, that would allow
for making the number of brightness components to be set at once
customizable. This of course entails significant amount of changes in
the LED core and some changes in LED Trigger core.

Unfortunately I can't predict how much time it will take
to submit an RFC due to limited amount of time I can spend working
on it.

[0] https://www.spinics.net/lists/linux-leds/msg07959.html

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2017-07-16 18:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 22:45 [PATCH v2 0/3] Qualcomm Light Pulse Generator Bjorn Andersson
2017-07-14 22:45 ` [PATCH v2 1/3] leds: core: Introduce generic pattern interface Bjorn Andersson
2017-07-06  3:18   ` Pavel Machek
2017-07-16 18:49     ` Jacek Anaszewski [this message]
2017-07-16 21:14       ` Bjorn Andersson
2017-07-17 21:08         ` Jacek Anaszewski
2017-07-17 23:39           ` Bjorn Andersson
2017-07-18 21:36             ` Jacek Anaszewski
2017-08-12 19:22         ` Pavel Machek
2017-07-16 19:57     ` Bjorn Andersson
2017-07-14 22:45 ` [PATCH v2 2/3] leds: Add driver for Qualcomm LPG Bjorn Andersson
2017-07-14 22:45 ` [PATCH v2 3/3] DT: leds: Add Qualcomm Light Pulse Generator binding Bjorn Andersson
2017-07-15  9:14   ` Pavel Machek
2017-07-16  5:35     ` Bjorn Andersson
2017-07-16 18:49   ` Jacek Anaszewski
2017-07-17  4:44     ` Bjorn Andersson
2017-07-17 21:08       ` Jacek Anaszewski
2017-07-18  0:03         ` Bjorn Andersson
2017-07-18 21:38           ` Jacek Anaszewski
2017-07-15  9:10 ` [PATCH v2 0/3] Qualcomm Light Pulse Generator Pavel Machek
2017-07-16  5:34   ` Bjorn Andersson
2017-07-06  3:18     ` Pavel Machek
2017-07-16 20:53       ` Bjorn Andersson
2017-07-16 21:15         ` 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=beb9b4c3-4922-1ebb-5017-a4b791cdb4d7@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fenglinw@codeaurora.org \
    --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=pavel@ucw.cz \
    --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

all inboxes | Powered by JetHome®