linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: bjorn.andersson@linaro.org, Baolin Wang <baolin.wang@linaro.org>,
	rteysseyre@gmail.com, broonie@kernel.org,
	linus.walleij@linaro.org, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 1/2] leds: core: Introduce LED pattern trigger
Date: Mon, 3 Sep 2018 23:53:23 +0200	[thread overview]
Message-ID: <20180903215323.GA21489@amd> (raw)
In-Reply-To: <ef266d4a-ba0e-cba6-ae30-ebbf730e28a2@gmail.com>

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

Hi!

> > +static int pattern_trig_start_pattern(struct led_classdev *led_cdev)
> > +{
> > +	struct pattern_trig_data *data = led_cdev->trigger_data;
> > +
> > +	if (!data->npatterns)
> > +		return 0;
> > +
> > +	if (data->is_hw_pattern) {
> > +		return led_cdev->pattern_set(led_cdev, data->patterns,
> > +					     data->npatterns, data->repeat);
> > +	}
> 
> I have doubts here if it is a good idea to enforce array of tuples
> as a generic interface for all hw_patterns. It may not fit well for
> every hw pattern engine. It seems that the only feasible solution will
> be allowing drivers to come up with their own interfaces, i.e. the
> approach you proposed at first for your driver. It seems that the
> ledtrig-pattern with software pattern mechanism will be just
> a nice side effect of this series :-)
> 
> Unless someone will propose a better solution.

I believe array of tuples will work for everyone. It is just a LED, it
can change intensity over time.

> We need a broader consensus here. I'd like to hear Pavel's opinion,
> since he's been always in favor of common pattern interface, and
> inspired this work.

I believe Baolin did good work here. I believe it will cover most, if
not all, hardware engines out there. I think we should merge it, and
see what happens -- it should be good enough.

(Yes, there's still more work to do, but that will be stuff like RGB
LED synchronization.)

(And yes, one of the LED chip has pattern engine that can compute
prime numbers on its own. I don't expect to support
_that_. Fortunately, nobody but me is likely to want that pattern, so
we are still okay :-) 

https://gitlab.com/tui/tui/blob/master/ofone/tests.notcc/primes.nc

)
									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 --]

  reply	other threads:[~2018-09-03 21:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  7:52 [PATCH v7 1/2] leds: core: Introduce LED pattern trigger Baolin Wang
2018-08-31  7:52 ` [PATCH v7 2/2] leds: sc27xx: Add pattern_set/clear interfaces for LED controller Baolin Wang
2018-09-03 18:58 ` [PATCH v7 1/2] leds: core: Introduce LED pattern trigger Jacek Anaszewski
2018-09-03 21:53   ` Pavel Machek [this message]
2018-09-04  2:05     ` Baolin Wang
2018-09-04 19:38     ` Jacek Anaszewski
2018-09-07  7:34       ` Pavel Machek
2018-09-04  1:32   ` Baolin Wang

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=20180903215323.GA21489@amd \
    --to=pavel@ucw.cz \
    --cc=baolin.wang@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rteysseyre@gmail.com \
    /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).