From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: Fabio Baltieri <fabio.baltieri@gmail.com>, linux-can@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/2] can: add tx/rx LED trigger support
Date: Wed, 25 Apr 2012 09:41:05 +0200 [thread overview]
Message-ID: <4F97AA91.1020007@pengutronix.de> (raw)
In-Reply-To: <4F97A735.5080708@grandegger.com>
[-- Attachment #1: Type: text/plain, Size: 2726 bytes --]
On 04/25/2012 09:26 AM, Wolfgang Grandegger wrote:
> Hi Fabio,
>
> On 04/24/2012 09:02 PM, Fabio Baltieri wrote:
>> Hi Wolfgang,
>>
>> On Tue, Apr 24, 2012 at 08:46:29AM +0200, Wolfgang Grandegger wrote:
>>> I still think that the blinking support should go to the timer class to
>>> avoid duplicated code. Any good reason against? Apart from that the
>>> patches look good.
>>>
>>> Wolfgang.
>>
>> I can see you point and I considered your note about adding the
>> one-shot-blink function to the led-class framework (sorry for not
>> mentioning it in my first post). Still, I ended up with this code for
>> a couple of reasons:
>>
>> - I think that the led_blink_set function is primarily used to configure
>> leds with hardware blinking (like i2c led drivers). While it would be
>> possible to extend the function to get one-shot behavior and always
>> fallback on software blink, I think that that's out of the purpose of
>> the led-class, which should just translate on-off requests to
>> underlaying hardware.
>
> Why, there is already led_tigger_event() and led_trigger_blink(). Why
> should led_trigger_blink_once() then do not make sense?
>
>> - I think that different drivers may want to obtain different on-off
>> behavior depending on the application. For example in the ide-disk
>> case the user expects to see a steady-on LED on constant activity,
>> and that's how it's implemented, while in this case the on-if-up
>> keep-blinking-on-activity off-if-down makes much more sense. So I think
>> that even if a generic blink function were available, people would
>> still be using custom functions because they want to fine tune the
>> behavior for the application. Also, maybe a function too generic may
>> impact on performance in critical paths.
>
> The blinking could be specified with led_trigger_blink_once().
>
>> - in this case, it looks to me like the implementation is as optimized
>> as it can be, in the sense that the hot-path does really only some
>> essential check and engage the timer and the timer function itself is
>> really short. Also the final blinking effect is nice IMO :-)
>
> For me it still does make sense to provide a generic
> led_trigger_blink_once support. But well, go ahead if I'm the only one
> with that opinion.
+1
At least start a discussion on the LED list (I don't know which list
that is).
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2012-04-25 7:41 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 21:02 [RFC PATCH v2 1/2] can: add tx/rx LED trigger support Fabio Baltieri
2012-04-23 21:02 ` [RFC PATCH v2 2/2] can: flexcan: add " Fabio Baltieri
2012-04-24 5:16 ` [RFC PATCH v2 1/2] can: add tx/rx " Oliver Hartkopp
2012-04-24 19:10 ` Fabio Baltieri
2012-04-24 6:46 ` Wolfgang Grandegger
2012-04-24 15:41 ` Oliver Hartkopp
2012-04-24 18:08 ` Wolfgang Grandegger
2012-04-24 18:57 ` Oliver Hartkopp
2012-04-25 7:05 ` Wolfgang Grandegger
2012-04-24 19:02 ` Fabio Baltieri
2012-04-25 7:26 ` Wolfgang Grandegger
2012-04-25 7:41 ` Marc Kleine-Budde [this message]
2012-04-25 10:04 ` Wolfgang Grandegger
2012-05-03 21:49 ` Fabio Baltieri
2012-05-04 7:03 ` Oliver Hartkopp
2012-05-04 7:30 ` Wolfgang Grandegger
2012-04-24 8:38 ` Kurt Van Dijck
2012-04-24 20:22 ` Fabio Baltieri
2012-04-25 7:50 ` Kurt Van Dijck
2012-04-24 8:45 ` Kurt Van Dijck
2012-04-24 20:34 ` Fabio Baltieri
2012-04-25 8:00 ` Kurt Van Dijck
2012-04-25 20:39 ` Fabio Baltieri
2012-04-26 8:21 ` Kurt Van Dijck
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=4F97AA91.1020007@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=fabio.baltieri@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=wg@grandegger.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