mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: shuahkhan@gmail.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
	neilb@suse.de, LKML <linux-kernel@vger.kernel.org>,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: [PATCH ] leds: add new transient trigger for one shot timer support
Date: Mon, 23 Apr 2012 07:07:23 +0200	[thread overview]
Message-ID: <1335157643.5139.37.camel@jerome.southpole.se> (raw)
In-Reply-To: <1335138687.2882.20.camel@lorien2>


On Sun, 2012-04-22 at 17:51 -0600, Shuah Khan wrote:
> Hi Jonas,
> 
> activate does sound better and having units in the property name is a
> good idea. Will make the changes including the 0200 change for activate.
> Will change the transient_time to transient_time_msec (no problem using
> duration, just that time is shorter :)

'duration' is shorter than than 'transient_time' :)

I don't think you need to prefix the property with the trigger
namespace... no other trigger does this.  I'm still inclined to say that
'duration' is clearer than 'time'... the length of the property name
can't seriously be an issue here.  Neil also commented that it should be
'delay_on' which has the advantage of being consistent with other
existing triggers.

> 
> > A couple of questions:
> > 
> > i)  Why is it important for you to maintain the LED state?
> One use-case that would be easier for user to comprehend would be to
> have a constant timer that runs periodically. time value doesn't change
> and by simply writing 1 or 0, timer with a value specified by the time
> file can be started. The following use-case is a good example for what I
> am talking about:
> 
> echo transient > trigger
> echo n > transient_time
> repeat the following step as needed:
> echo 1 > transient_enabled - start timer = transient_time to run once
> echo 1 > transient_enabled - start timer = transient_time to run once
> echo none > trigger

> This could be accomplished by simply using just the time property,
> however, each time, the same timer value needs to be echoed. Not a big
> deal, however time value either needs to stay where it is even when a
> timer is not running, or clear it 0. I don't like clearing the time
> value. Here is why. The use-case is very similar to a stop and start
> timer function on a watch for example. I typically set a time
> value and then activate and deactivate as needed without needing to
> reset the time value.
> 

You misunderstood me... it's the not the 'duration' state that I was
asking about, it's the 'illuminated' state.  In your patch you had 3
fields in your trigger data struct... I'd argue you only need two: the
duration and the timer itself; you don't need a field to keep track of
the state of the LED.

> > 
> > ii)  Why do you need to be able to cancel the timer?
> Here is an example where canceling timer is necessary. Phone is in
> silent mode and a call comes in. When call comes in phone will start
> vibrating (maybe vibrate mode set for 2 seconds), when caller answers,
> vibrate mode needs to deactivated right away by stopping the vibrate
> mode and canceling the timer.

OK, this can be accomplished by writing 0 to the 'brightness' value...
you don't need to be able to do this via the 'activate' property.  The
trigger will clean itself up automatically when you do this, too.

> > 
> > As I understand this trigger (and your use-case), this is about being
> > able to turn on a LED (signal) and forget about it, knowing that it will
> > be extinguished in due time without any intervention.  So I would leave
> > it at that; don't even present an option to intervene.
> > 
> > That said, there is already a way to intervene:  I can always write 0 to
> > 'brightness' to extinguish the led immediately.
> 
> That is correct. brightness could be used, however having a distinct
> name-space might be better for future changes instead of overloading
> brightness.

This is a simple trigger that does one thing and does it well; what
future changes do you have in mind?  Will I need to download a PDF
manual and dedicate a weekend to understanding the intricate interplay
of all its properties in the future?

The 'brightness' property will always be there; it doesn't go away just
because you install a trigger for the LED.  It's best to use the
interface that already exists instead of adding a second one that
essentially does the same thing...

> 
> Hope this helps explain my reasoning to keep transient state.
> 

Yeah, for sure... I'd say you're almost there so hang in there!

/Jonas



      parent reply	other threads:[~2012-04-23  5:07 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01 19:53 [PATCH RESEND] LEDS-One-Shot-Timer-Trigger-implementation Shuah Khan
2012-04-03 15:06 ` Shuah Khan
2012-04-06 23:53 ` Andrew Morton
2012-04-07 14:13   ` Shuah Khan
2012-04-07 21:56     ` Dmitry Torokhov
2012-04-08 23:42       ` NeilBrown
2012-04-09  0:06         ` Dmitry Torokhov
2012-04-09 22:25           ` NeilBrown
2012-04-10  8:21             ` Dmitry Torokhov
2012-04-09 16:55       ` Shuah Khan
2012-04-09 17:37         ` Dmitry Torokhov
2012-04-09 18:16           ` Shuah Khan
2012-04-09 18:45             ` Dmitry Torokhov
2012-04-09 20:20               ` Shuah Khan
2012-04-09 20:42                 ` Dmitry Torokhov
2012-04-09 22:40                   ` Shuah Khan
2012-04-10  7:17                     ` Dmitry Torokhov
2012-04-10 18:34                       ` Shuah Khan
2012-04-08 23:58   ` NeilBrown
2012-04-10 13:24 ` Richard Purdie
2012-04-10 15:31   ` Shuah Khan
2012-04-11 10:05     ` Richard Purdie
2012-04-11 15:33       ` Shuah Khan
2012-04-15 16:35   ` Shuah Khan
2012-04-15 22:34     ` [PATCH 1/1] leds: add "kickable" LED trigger Jonas Bonn
2012-04-15 22:37       ` Jonas Bonn
2012-04-16 15:28         ` Shuah Khan
2012-04-16 22:33           ` Jonas Bonn
2012-04-16 23:05             ` Shuah Khan
2012-04-20  4:04     ` [PATCH ] leds: add new transient trigger for one shot timer support Shuah Khan
2012-04-20 21:19       ` Andrew Morton
2012-04-20 22:48         ` Shuah Khan
2012-04-21  4:41       ` Jonas Bonn
2012-04-22 23:51         ` Shuah Khan
2012-04-23  1:56           ` NeilBrown
2012-04-23  5:29             ` Jonas Bonn
2012-04-23  5:45               ` NeilBrown
2012-04-23 22:22                 ` Shuah Khan
2012-04-25 17:42                   ` [PATCH v2] leds: add new transient trigger for one shot timer activation Shuah Khan
2012-04-26  6:02                     ` NeilBrown
2012-04-26 14:48                       ` Shuah Khan
2012-04-26 23:00                     ` Andrew Morton
2012-04-30 20:33                       ` [PATCH v3] " Shuah Khan
2012-04-23  5:07           ` Jonas Bonn [this message]

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=1335157643.5139.37.camel@jerome.southpole.se \
    --to=jonas@southpole.se \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=shuahkhan@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

all inboxes | Powered by JetHome®