linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	rteysseyre@gmail.com, Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 1/2] leds: core: Introduce LED pattern trigger
Date: Tue, 4 Sep 2018 10:05:06 +0800	[thread overview]
Message-ID: <CAMz4kuJwnD1B-5X-pPDbf1vCj7-VQNdX9F+EPCj9VWg2G-vPLQ@mail.gmail.com> (raw)
In-Reply-To: <20180903215323.GA21489@amd>

Hi Pavel,

On 4 September 2018 at 05:53, Pavel Machek <pavel@ucw.cz> wrote:
> 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 :-)

Thanks for your explanation here. So I think I should keep the same
logics in next version.

-- 
Baolin Wang
Best Regards

  reply	other threads:[~2018-09-04  2:05 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
2018-09-04  2:05     ` Baolin Wang [this message]
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=CAMz4kuJwnD1B-5X-pPDbf1vCj7-VQNdX9F+EPCj9VWg2G-vPLQ@mail.gmail.com \
    --to=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=pavel@ucw.cz \
    --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).