linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: oneshot - Allow default delay to be passed as an argument
@ 2016-09-03  9:03 Amitesh Singh
  2016-09-03 13:44 ` Jacek Anaszewski
  0 siblings, 1 reply; 7+ messages in thread
From: Amitesh Singh @ 2016-09-03  9:03 UTC (permalink / raw)
  To: Richard Purdie, Anaszewski, linux-leds

This patch facilates the blink delay to be passed as
an argument at the time of module loading.
e.g.
insmod ledtrigg-oneshot.ko default_delay=100
---
 drivers/leds/trigger/ledtrig-oneshot.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/trigger/ledtrig-oneshot.c b/drivers/leds/trigger/ledtrig-oneshot.c
index b8ea9f0..95933a1 100644
--- a/drivers/leds/trigger/ledtrig-oneshot.c
+++ b/drivers/leds/trigger/ledtrig-oneshot.c
@@ -22,6 +22,9 @@
 
 #define DEFAULT_DELAY 100
 
+static unsigned long default_delay = DEFAULT_DELAY;
+module_param(default_delay, ulong, S_IRUGO|S_IWUSR);
+
 struct oneshot_trig_data {
 	unsigned int invert;
 };
@@ -146,8 +149,8 @@ static void oneshot_trig_activate(struct led_classdev *led_cdev)
 	if (rc)
 		goto err_out_invert;
 
-	led_cdev->blink_delay_on = DEFAULT_DELAY;
-	led_cdev->blink_delay_off = DEFAULT_DELAY;
+	led_cdev->blink_delay_on = default_delay;
+	led_cdev->blink_delay_off = default_delay;
 
 	led_cdev->activated = true;
 
-- 
2.7.4

This patch facilates the blink delay to be passed as
an argument at the time of module loading.
e.g.
insmod ledtrigg-oneshot.ko default_delay=100

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] leds: oneshot - Allow default delay to be passed as an argument
@ 2016-09-03  8:39 Amitesh Singh
  0 siblings, 0 replies; 7+ messages in thread
From: Amitesh Singh @ 2016-09-03  8:39 UTC (permalink / raw)
  To: Richard Purdie, acek Anaszewski, linux-leds

This patch facilates the blink delay to be passed as
an argument at the time of module loading.
e.g.
insmod ledtrigg-oneshot.ko default_delay=100
---
 drivers/leds/trigger/ledtrig-oneshot.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/leds/trigger/ledtrig-oneshot.c b/drivers/leds/trigger/ledtrig-oneshot.c
index b8ea9f0..accb241 100644
--- a/drivers/leds/trigger/ledtrig-oneshot.c
+++ b/drivers/leds/trigger/ledtrig-oneshot.c
@@ -22,6 +22,9 @@
 
 #define DEFAULT_DELAY 100
 
+static unsigned long default_delay = DEFAULT_DELAY;
+module_param(default_delay, ulong, S_IRUGO|S_IWUSR);
+
 struct oneshot_trig_data {
 	unsigned int invert;
 };
-- 
2.7.4

This patch facilates the blink delay to be passed as
    an argument at the time of module loading.
    e.g.
    insmod ledtrigg-oneshot.ko default_delay=100

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-06 19:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-03  9:03 [PATCH] leds: oneshot - Allow default delay to be passed as an argument Amitesh Singh
2016-09-03 13:44 ` Jacek Anaszewski
2016-09-03 15:39   ` Amitesh Singh
     [not found]   ` <CABKcAmXSwgMbopurjrNU7fgPu58W-ZDbDi6VuUn2P2zOGATYLQ@mail.gmail.com>
2016-09-03 18:12     ` Jacek Anaszewski
2016-09-06 15:05       ` Amitesh Singh
2016-09-06 18:52         ` Jacek Anaszewski
  -- strict thread matches above, loose matches on Subject: below --
2016-09-03  8:39 Amitesh Singh

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