RE: [PATCH v3 1/1] leds: Add LED pattern trigger

2014-01-06 Thread Joe Xue
> From: Joe Xue > > The LED pattern trigger allows LEDs blink in user defined pattern. > > v2: Change the pattern memory from fixed static to malloc > Change the timer schedule way to save cpu time > Add the mutex to protect the pattern operation > > v3: Tiny fix,

[PATCH v2 1/1] Add LED pattern trigger

2013-12-31 Thread Joe Xue
I set the in-reply-to to try to put my new patch here, but failed. I need to figure it out. From: Joe Xue The LED pattern trigger allows LEDs blink in user defined pattern. v2: Change the pattern memory from fixed static to malloc Change the timer schedule way to save cpu time Add the

[PATCH v2 1/1] leds: Add LED pattern trigger

2013-12-31 Thread Joe Xue
From: Joe Xue The LED pattern trigger allows LEDs blink in user defined pattern. v2: Change the pattern memory from fixed static to malloc Change the timer schedule way to save cpu time Add the mutex to protect the pattern operation new file: Documentation/leds/ledtrig

RE: [PATCH] Add LED pattern trigger

2013-12-31 Thread Joe Xue
>> + * Based on Richard Purdie's ledtrig-timer.c and Atsushi Nemoto's >> + * ledtrig-heartbeat.c and Shuah Khan's ledtrig-transient.c > > I stil think this belongs in user space except for platforms with hardware > acceleration for it. This can free the user space application from loop or thread.

RE: [PATCH] Add LED pattern trigger

2013-12-30 Thread Joe Xue
> What about something like this? > > Not shcheduling timer when nothing changed should save a bit of power/cpu... > > if (pattern_data->pattern[pattern_data->count] == '/') { > return; > } > > this = pattern_data->pattern[pattern_data->count] > if (this == '#') > new_brigtness = pattern_data->brig

RE: [PATCH] Add LED pattern trigger

2013-12-30 Thread Joe Xue
>> +#define MAX_PATTEN_LEN 255 > > Arbitary limits that are not needed if it was in userspace, and not it > seems a sensible one - why not use 256 ? The maximum memory is 256, we keep one for '\0' >> +static ssize_t pattern_delay_unit_store(struct device *dev, >> + struct device_attribute *attr,

RE: [PATCH] Add the LED burst trigger

2013-12-29 Thread Joe Xue
    modified:   drivers/leds/trigger/Makefile     new file:   drivers/leds/trigger/ledtrig-pattern.c Suggested-by: Pavel Machek Signed-off-by: Joe Xue ---  Documentation/leds/ledtrig-pattern.txt |  60 ++  drivers/leds/trigger/Kconfig   |   9 ++  drivers/leds/trigger/Makefile  |   1

[PATCH] Add LED pattern trigger

2013-12-29 Thread Joe Xue
: Pavel Machek Signed-off-by: Joe Xue --- Documentation/leds/ledtrig-pattern.txt | 60 ++ drivers/leds/trigger/Kconfig | 9 ++ drivers/leds/trigger/Makefile | 1 + drivers/leds/trigger/ledtrig-pattern.c | 207 + 4 files changed, 277

RE: [PATCH] Add the LED burst trigger

2013-12-28 Thread Joe Xue
Hi Pavel, I have finished the patten trigger and have tested it. Do you mind me putting your name as suggest-by? For part idea is from you. Joe > Date: Sat, 28 Dec 2013 20:26:30 +0100 > From: pa...@ucw.cz > To: lg...@hotmail.com > CC: coolo...@gmail.com; r

RE: [PATCH] Add the LED burst trigger

2013-12-28 Thread Joe Xue
Hi >> Good idea. >> I have finished but I'll change it to this way soon and test it in next some >> days. >> >> What the idea about the character to indicate stop? >> >> I mean this patten maybe indicate just once maybe indicate repeatedly until >> the next patten. >> >> What about "/"? >> If th

RE: [PATCH] Add the LED burst trigger

2013-12-27 Thread Joe Xue
Hi Pavel, Good idea. I have finished but I'll change it to this way soon and test it in next some days. What the idea about the character to indicate stop? I mean this patten maybe indicate just once maybe indicate repeatedly until the next patten. What about "/"? If there is a "/" at end the

RE: [PATCH] Add the LED burst trigger

2013-12-26 Thread Joe Xue
Hi, I'm writing the Morse code trigger. what about this echo "-.-. *"> patten -  a long on then a off .  a short on then a off space a long off * mean repeat the patten s mean indicate the patten just one time then stop Do we also need a "step

RE: [PATCH] Add the LED burst trigger

2013-12-26 Thread Joe Xue
Hi all, I think Pavel's suggestion is a good idea, I'm starting to write another trigger named Morse code trigger. I prefer to keeping this burst trigger and add another Morse code trigger for different application. But I know the Morse code trigger will be the super set of the burst. Say the

RE: [PATCH] Add the LED burst trigger

2013-12-26 Thread Joe Xue
Hi Pavel, Yes, your suggest looks reasonable. Only issue maybe is not easy to called by program. After all, the interface is called by program more ofter then by human being. I would like to change the way what you suggest, let see if other guys agree with your idea. Before that, I'll submit

RE: [PATCH] Add the LED burst trigger

2013-12-25 Thread Joe Xue
Hi, Yes, Morse code can indicate any means. But when we look at the LEDs, would we like to also have a Morse code book in hand? The burst led blink idea is because it is easy to use and easy to describe. Mostly when users on site are describing the LEDs states to the support engineer. Joe --