* Re: [PATCH] input: extend EV_LED [not found] <45CEE9AB.2020208@freemail.hu> @ 2007-02-12 18:31 ` Dmitry Torokhov 2007-02-14 19:06 ` Németh Márton 0 siblings, 1 reply; 13+ messages in thread From: Dmitry Torokhov @ 2007-02-12 18:31 UTC (permalink / raw) To: Németh Márton; +Cc: linux-input, linux-kernel On 2/11/07, Németh Márton <nm127@freemail.hu> wrote: > > Extend EV_LED handling code so that it can handle not > only two states (on/off) but also others. For example > a LED can blink using hardware acceleration. The code > changed so that it is similar to the code at EV_SND. > Hi, I am not sure we would need this, could you explain what are you trying to use input leds for? Generally speaking leds within input subsystem are supposed to be very simple on/off objects, mostly for reporting state of input devices (keyboards), I am not even sure that LED_MAIL and LED_CHARGING make much sense here. For more compex objects(blinking/different colors/different brightness) we have a separate LED subsystem (drivers/leds). -- Dmitry ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-12 18:31 ` [PATCH] input: extend EV_LED Dmitry Torokhov @ 2007-02-14 19:06 ` Németh Márton 2007-02-14 19:49 ` Dmitry Torokhov 0 siblings, 1 reply; 13+ messages in thread From: Németh Márton @ 2007-02-14 19:06 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: linux-input, linux-kernel Dmitry Torokhov <dmitry.torokhov@gmail.com> írta: > On 2/11/07, Németh Márton <nm127@freemail.hu> wrote: > > > > Extend EV_LED handling code so that it can handle not > > only two states (on/off) but also others. For example > > a LED can blink using hardware acceleration. The code > > changed so that it is similar to the code at EV_SND. > > > > Hi, > > I am not sure we would need this, could you explain what are you > trying to use input leds for? > > Generally speaking leds within input subsystem are supposed to be very > simple on/off objects, mostly for reporting state of input devices > (keyboards), I am not even sure that LED_MAIL and LED_CHARGING make > much sense here. For more compex objects(blinking/different > colors/different brightness) we have a separate LED subsystem > (drivers/leds). The background is that I own a Clevo notebook model D4J, product D410J which has a mail led near to the other LEDs. The mail LED in question has three known state: off, blink slow (0.5Hz), and blink fast (1Hz). The mail LED can be programmed through the ports 0x60 and 0x64. These ports belog to the i8042 controller, which is operated by the input subsystem. To be able to access the i8042 controller correctly, I need the spinlock i8042_lock held, which is defined as static in linux/drivers/input/serio/i8042.c . What I miss currently from the input subsystem is that the EV_LED can only handle on/off state. I do not know the LED subsystem in detail, but I do not know any possibility to access the i8042 from different subsystem than the input subsystem. What do you think and recommend? NMarci P.S.: my project home page is located at http://clevo-mailled.sourceforge.net/ ______________________________________________________________________ Könyvszerda a Gabo, Akkord, Talentum, Ciceró Kiadókkal! Több mint 700 féle könyv 30% kedvezménnyel! http://www.bookline.hu/control/news?newsid=397&affiliate=frekszkar3435 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-14 19:06 ` Németh Márton @ 2007-02-14 19:49 ` Dmitry Torokhov 2007-02-14 23:51 ` Németh Márton 2007-02-15 17:40 ` Pavel Machek 0 siblings, 2 replies; 13+ messages in thread From: Dmitry Torokhov @ 2007-02-14 19:49 UTC (permalink / raw) To: Németh Márton; +Cc: linux-input, linux-kernel On 2/14/07, Németh Márton <nm127@freemail.hu> wrote: > > > Dmitry Torokhov <dmitry.torokhov@gmail.com> írta: > > > On 2/11/07, Németh Márton <nm127@freemail.hu> wrote: > > > > > > Extend EV_LED handling code so that it can handle not > > > only two states (on/off) but also others. For example > > > a LED can blink using hardware acceleration. The code > > > changed so that it is similar to the code at EV_SND. > > > > > > > Hi, > > > > I am not sure we would need this, could you explain what > are you > > trying to use input leds for? > > > > Generally speaking leds within input subsystem are > supposed to be very > > simple on/off objects, mostly for reporting state of input > devices > > (keyboards), I am not even sure that LED_MAIL and > LED_CHARGING make > > much sense here. For more compex objects(blinking/different > > colors/different brightness) we have a separate LED subsystem > > (drivers/leds). > > The background is that I own a Clevo notebook model D4J, > product D410J which has a mail led near to the other LEDs. > The mail LED in question has three known state: off, blink > slow (0.5Hz), and blink fast (1Hz). > > The mail LED can be programmed through the ports 0x60 and > 0x64. These ports belog to the i8042 controller, which is > operated by the input subsystem. To be able to access the > i8042 controller correctly, I need the spinlock i8042_lock > held, which is defined as static in > linux/drivers/input/serio/i8042.c . > > What I miss currently from the input subsystem is that the > EV_LED can only handle on/off state. > > I do not know the LED subsystem in detail, but I do not know > any possibility to access the i8042 from different subsystem > than the input subsystem. > > What do you think and recommend? > I think you need to use leds framework for what you are trying to do. I could export i8042_command() so you could access keyboard controller from your driver. -- Dmitry ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-14 19:49 ` Dmitry Torokhov @ 2007-02-14 23:51 ` Németh Márton 2007-02-15 17:40 ` Pavel Machek 1 sibling, 0 replies; 13+ messages in thread From: Németh Márton @ 2007-02-14 23:51 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: linux-input, linux-kernel Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote: > On 2/14/07, Németh Márton <nm127@freemail.hu> wrote: > > > > > > Dmitry Torokhov <dmitry.torokhov@gmail.com> írta: > > > > > On 2/11/07, Németh Márton <nm127@freemail.hu> wrote: > > > > > > > > Extend EV_LED handling code so that it can handle not > > > > only two states (on/off) but also others. For example > > > > a LED can blink using hardware acceleration. The code > > > > changed so that it is similar to the code at EV_SND. > > > > > > > > > > Hi, > > > > > > I am not sure we would need this, could you explain what > > are you > > > trying to use input leds for? > > > > > > Generally speaking leds within input subsystem are > > supposed to be very > > > simple on/off objects, mostly for reporting state of input > > devices > > > (keyboards), I am not even sure that LED_MAIL and > > LED_CHARGING make > > > much sense here. For more compex objects(blinking/different > > > colors/different brightness) we have a separate LED subsystem > > > (drivers/leds). > > > > The background is that I own a Clevo notebook model D4J, > > product D410J which has a mail led near to the other LEDs. > > The mail LED in question has three known state: off, blink > > slow (0.5Hz), and blink fast (1Hz). > > > > The mail LED can be programmed through the ports 0x60 and > > 0x64. These ports belog to the i8042 controller, which is > > operated by the input subsystem. To be able to access the > > i8042 controller correctly, I need the spinlock i8042_lock > > held, which is defined as static in > > linux/drivers/input/serio/i8042.c . > > > > What I miss currently from the input subsystem is that the > > EV_LED can only handle on/off state. > > > > I do not know the LED subsystem in detail, but I do not know > > any possibility to access the i8042 from different subsystem > > than the input subsystem. > > > > What do you think and recommend? > > > > I think you need to use leds framework for what you are trying to do. > I could export i8042_command() so you could access keyboard controller > from your driver. I think exporting the i8042_command() would solve my problem, so I could call: retval = i8042_command(NULL, 0x0083); retval = i8042_command(NULL, 0x0084); retval = i8042_command(NULL, 0x008A); as needed. Which header file should the i8042_command() defined in? NMarci ______________________________________________________________________ Könyvszerda a Gabo, Akkord, Talentum, Ciceró Kiadókkal! Több mint 700 féle könyv 30% kedvezménnyel! http://www.bookline.hu/control/news?newsid=397&affiliate=frekszkar3435 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-14 19:49 ` Dmitry Torokhov 2007-02-14 23:51 ` Németh Márton @ 2007-02-15 17:40 ` Pavel Machek 2007-02-15 22:47 ` Németh Márton 1 sibling, 1 reply; 13+ messages in thread From: Pavel Machek @ 2007-02-15 17:40 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: Németh Márton, linux-input, linux-kernel Hi! > >I do not know the LED subsystem in detail, but I do not > >know > >any possibility to access the i8042 from different > >subsystem > >than the input subsystem. > > > >What do you think and recommend? > > I think you need to use leds framework for what you are > trying to do. I'm actually not sure if led framework can do that. It was designed for leds on gpios, and handles blinking itself. But he could export two leds :-). Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 17:40 ` Pavel Machek @ 2007-02-15 22:47 ` Németh Márton 2007-02-15 23:09 ` Richard Purdie 2007-02-16 14:04 ` Pavel Machek 0 siblings, 2 replies; 13+ messages in thread From: Németh Márton @ 2007-02-15 22:47 UTC (permalink / raw) To: Pavel Machek; +Cc: Dmitry Torokhov, Richard Purdie, linux-input, linux-kernel Pavel Machek <pavel@ucw.cz> wrote: > Hi! > > > >I do not know the LED subsystem in detail, but I do not > > >know > > >any possibility to access the i8042 from different > > >subsystem > > >than the input subsystem. > > > > > >What do you think and recommend? > > > > I think you need to use leds framework for what you are > > trying to do. > > I'm actually not sure if led framework can do that. It was designed > for leds on gpios, and handles blinking itself. > > But he could export two leds :-). Hi, what do you mean about two leds? The first one would be off/0.5Hz and the other off/1Hz? I read in linux/Documentation/led-class.txt the following: | Some leds can be programmed to flash in hardware. As this isn't a generic | LED device property, this should be exported as a device specific sysfs | attribute rather than part of the class if this functionality is required. Does it mean that neither the input subsystem nor the led subsystem is designed for hardware acelerated blinking leds? Is there any usual way what attribute a hw accelerated blinking LED_MAIL should export? NMarci ______________________________________________________________________________ 10.000 Ft ajándék fotókidolgozás minden Panasonic digitális fényképezőgéphez! FotoMarket Online Fotóáruház http://ad.adverticum.net/b/cl,1,6022,99786,162268/click.prm ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 22:47 ` Németh Márton @ 2007-02-15 23:09 ` Richard Purdie 2007-02-15 23:24 ` Pavel Machek 2007-02-18 7:45 ` Németh Márton 2007-02-16 14:04 ` Pavel Machek 1 sibling, 2 replies; 13+ messages in thread From: Richard Purdie @ 2007-02-15 23:09 UTC (permalink / raw) To: Németh Márton Cc: Pavel Machek, Dmitry Torokhov, linux-input, linux-kernel On Thu, 2007-02-15 at 23:47 +0100, Németh Márton wrote: > Pavel Machek <pavel@ucw.cz> wrote: > > > >I do not know the LED subsystem in detail, but I do not > > > >know any possibility to access the i8042 from different > > > >subsystem than the input subsystem. > > > > > > > >What do you think and recommend? > > > > > > I think you need to use leds framework for what you are > > > trying to do. > > > > I'm actually not sure if led framework can do that. It was > > designed for leds on gpios, and handles blinking itself. The led framework is generic. If you can write a function to turn it on/off you can drive it with the LED framework. > > But he could export two leds :-). > > what do you mean about two leds? The first one would be > off/0.5Hz and the other off/1Hz? > > I read in linux/Documentation/led-class.txt the following: > > | Some leds can be programmed to flash in hardware. As this > isn't a generic > | LED device property, this should be exported as a device > specific sysfs > | attribute rather than part of the class if this > functionality is required. > > Does it mean that neither the input subsystem nor the led > subsystem is designed for hardware acelerated blinking leds? > Is there any usual way what attribute a hw accelerated > blinking LED_MAIL should export? This has been discussed in several places several times. The problem with hardware accelerated flashing is that you're are often limited to certain constraints (this case being no exception) and indicating what these are to userspace in a generic fashion is difficult. One way I've come up with is adds capability to the class to have LED specific triggers and you can then expose these hardware capabilities as an extra trigger specific to the LED. Another proposal more specific to this use case was to have some information behind the scenes which the software timer based trigger could use to turn on the "hardware acceleration" if present and capable of the requested mode. This might just need a function pointer in the core so could be quite neat. Nether patch exists yet. Cheers, Richard ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 23:09 ` Richard Purdie @ 2007-02-15 23:24 ` Pavel Machek 2007-02-15 23:36 ` Richard Purdie 2007-02-18 7:45 ` Németh Márton 1 sibling, 1 reply; 13+ messages in thread From: Pavel Machek @ 2007-02-15 23:24 UTC (permalink / raw) To: Richard Purdie Cc: Németh Márton, Dmitry Torokhov, linux-input, linux-kernel Hi! > > > > >I do not know the LED subsystem in detail, but I do not > > > > >know any possibility to access the i8042 from different > > > > >subsystem than the input subsystem. > > > > > > > > > >What do you think and recommend? > > > > > > > > I think you need to use leds framework for what you are > > > > trying to do. > > > > > > I'm actually not sure if led framework can do that. It was > > > designed for leds on gpios, and handles blinking itself. > > The led framework is generic. If you can write a function to turn it > on/off you can drive it with the LED framework. Even if that function is slow and sleeps? > > > But he could export two leds :-). > > > > what do you mean about two leds? The first one would be > > off/0.5Hz and the other off/1Hz? > > > > I read in linux/Documentation/led-class.txt the following: > > > > | Some leds can be programmed to flash in hardware. As this > > isn't a generic > > | LED device property, this should be exported as a device > > specific sysfs > > | attribute rather than part of the class if this > > functionality is required. > > > > Does it mean that neither the input subsystem nor the led > > subsystem is designed for hardware acelerated blinking leds? > > Is there any usual way what attribute a hw accelerated > > blinking LED_MAIL should export? > > This has been discussed in several places several times. The problem > with hardware accelerated flashing is that you're are often limited to > certain constraints (this case being no exception) and indicating what > these are to userspace in a generic fashion is difficult. > > One way I've come up with is adds capability to the class to have LED > specific triggers and you can then expose these hardware capabilities as > an extra trigger specific to the LED. > > Another proposal more specific to this use case was to have some > information behind the scenes which the software timer based trigger > could use to turn on the "hardware acceleration" if present and capable > of the requested mode. This might just need a function pointer in the > core so could be quite neat. I do not think we want to permit this led to run in "not accelerated" mode. I believe i8042 accesses are pretty expensive. > Nether patch exists yet. Yep, interested party should create one of them :-). (And I'd prefer the first one, due to i8042 slowness). Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 23:24 ` Pavel Machek @ 2007-02-15 23:36 ` Richard Purdie 0 siblings, 0 replies; 13+ messages in thread From: Richard Purdie @ 2007-02-15 23:36 UTC (permalink / raw) To: Pavel Machek Cc: Németh Márton, Dmitry Torokhov, linux-input, linux-kernel On Fri, 2007-02-16 at 00:24 +0100, Pavel Machek wrote: > > The led framework is generic. If you can write a function to turn it > > on/off you can drive it with the LED framework. > > Even if that function is slow and sleeps? The LED class itself can call in interrupt context so you'd have to schedule a workqueue if you need to sleep. > > One way I've come up with is adds capability to the class to have LED > > specific triggers and you can then expose these hardware capabilities as > > an extra trigger specific to the LED. > > > > Another proposal more specific to this use case was to have some > > information behind the scenes which the software timer based trigger > > could use to turn on the "hardware acceleration" if present and capable > > of the requested mode. This might just need a function pointer in the > > core so could be quite neat. > > I do not think we want to permit this led to run in "not accelerated" > mode. I believe i8042 accesses are pretty expensive. Which means they probably won't work well with the standard triggers. Not something we can do much about though... > > Nether patch exists yet. > > Yep, interested party should create one of them :-). (And I'd prefer > the first one, due to i8042 slowness). Right, patches welcome :) Cheers, Richard ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 23:09 ` Richard Purdie 2007-02-15 23:24 ` Pavel Machek @ 2007-02-18 7:45 ` Németh Márton 2007-02-18 8:07 ` Willy Tarreau 2007-02-18 11:12 ` Richard Purdie 1 sibling, 2 replies; 13+ messages in thread From: Németh Márton @ 2007-02-18 7:45 UTC (permalink / raw) To: Richard Purdie; +Cc: Pavel Machek, Dmitry Torokhov, linux-input, linux-kernel On Fri, 16 Feb 2007, Henrique de Moraes Holschuh wrote: > On Thu, 15 Feb 2007, Richard Purdie wrote: > > This has been discussed in several places several times. The problem > > with hardware accelerated flashing is that you're are often limited to > > certain constraints (this case being no exception) and indicating what > > these are to userspace in a generic fashion is difficult. > > The hability to blinking at one rate is *very* common on laptops. Blinking > at a few discrete rates is also common enough. They should be supported in > a generic way. > [...] > Here's a suggestion for a simple, non-overengineered interface: a "blink" > attribute (on/off) for leds which can hardware-blink. Only one blink > frequency is common enough that this attribute by itself is very useful > (e.g. it is all a ThinkPad and most WiFi/network card leds need). > > For hardware-blink leds with various frequencies, there is the typical way > to provide such things: give us a RO blink_available_frequencies attribute > which says which discrete frequencies are allowed (space separated), and a > RW blink_frequency attribute to set the frequency. If instead of > blink_available_frequencies, the driver provides RO blink_frequency_min and > _max attributes, then it means it can blink on that range of freqs. > > That is simple enough to implement and use, and generic enough. You just > need to set in stone if you want the freq in Hz, or a submultiple. You can > even implement an optional "blink" software emulation that drivers can hook > into for systems where the driver *knows* that led access is fast, but there > is no hardware blinking emulation. > A blinking led is basically a PWM (Pulse Width Modulation) signal. A PWM signal has three different attribute. The first one is the amplitude, this attribute is already provided by the led subsystem as "brightness". There are two more attributes, which are the frequency [Hz] and the duty cycle [%], or the on-time [ms] and off-time [ms]. The frequency [Hz] and duty cycle [%] parameters has the problem, that if we are limited to integers, it is not possible to express slower blinks than 1Hz. We could also use [mHz] (milli-Hertz), but it is not very common unit. The on-time [ms] and off-time [ms] seems to be easier to handle (and this is also easier to simulate from software if ever needed). An RO attribute could be introduced: 'pwm_available', which can contain parameter pairs separated by space, and the new parameter pair is in new line. An RW attribute 'pwm' could accept a parameter pair separated by space. A range could be also given in 'pwm_available', like this: '500-1000 500-1000'. This has the limitation that if there is a hardware which can blink a LED in differet freqencies, but only with fixed 50% duty cycle, the on-time off-time pair cannot express this range easily. My real-world example would be my Clevo D4J (D410J) notebook's mail led. It has three known state: off, PWM at 1Hz (50%), PWM at 0.5Hz (50%). In case the on-time [ms] off-time [ms] parameter pairs are used: $ cat pwm_available 500 500 1000 1000 What is your opinion? Is there more real-world hardware accelerated blinking LED parameter examples? NMarci __________________________________________________________________________ Kedvező tandíjak, különleges kedvezmények és magas szintű szolgáltatások. Ez az Educomm online nyelviskola és az egyedülálló EDUCATOR. Kattints ide! http://ad.adverticum.net/b/cl,1,6022,131839,203066/click.prm ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-18 7:45 ` Németh Márton @ 2007-02-18 8:07 ` Willy Tarreau 2007-02-18 11:12 ` Richard Purdie 1 sibling, 0 replies; 13+ messages in thread From: Willy Tarreau @ 2007-02-18 8:07 UTC (permalink / raw) To: Németh Márton Cc: Richard Purdie, Pavel Machek, Dmitry Torokhov, linux-input, linux-kernel On Sun, Feb 18, 2007 at 08:45:00AM +0100, Németh Márton wrote: > > On Fri, 16 Feb 2007, Henrique de Moraes Holschuh wrote: > > On Thu, 15 Feb 2007, Richard Purdie wrote: > > > This has been discussed in several places several times. > The problem > > > with hardware accelerated flashing is that you're are > often limited to > > > certain constraints (this case being no exception) and > indicating what > > > these are to userspace in a generic fashion is difficult. > > > > The hability to blinking at one rate is *very* common on > laptops. Blinking > > at a few discrete rates is also common enough. They > should be supported in > > a generic way. > > [...] > > Here's a suggestion for a simple, non-overengineered > interface: a "blink" > > attribute (on/off) for leds which can hardware-blink. > Only one blink > > frequency is common enough that this attribute by itself > is very useful > > (e.g. it is all a ThinkPad and most WiFi/network card leds > need). > > > > For hardware-blink leds with various frequencies, there is > the typical way > > to provide such things: give us a RO > blink_available_frequencies attribute > > which says which discrete frequencies are allowed (space > separated), and a > > RW blink_frequency attribute to set the frequency. If > instead of > > blink_available_frequencies, the driver provides RO > blink_frequency_min and > > _max attributes, then it means it can blink on that range > of freqs. > > > > That is simple enough to implement and use, and generic > enough. You just > > need to set in stone if you want the freq in Hz, or a > submultiple. You can > > even implement an optional "blink" software emulation that > drivers can hook > > into for systems where the driver *knows* that led access > is fast, but there > > is no hardware blinking emulation. > > > > A blinking led is basically a PWM (Pulse Width Modulation) > signal. A PWM signal has three different attribute. The > first one is the amplitude, this attribute is already > provided by the led subsystem as "brightness". There are two > more attributes, which are the frequency [Hz] and the duty > cycle [%], or the on-time [ms] and off-time [ms]. > > The frequency [Hz] and duty cycle [%] parameters has the > problem, that if we are limited to integers, it is not > possible to express slower blinks than 1Hz. We could also > use [mHz] (milli-Hertz), but it is not very common unit. > > The on-time [ms] and off-time [ms] seems to be easier to > handle (and this is also easier to simulate from software if > ever needed). An RO attribute could be introduced: > 'pwm_available', which can contain parameter pairs separated > by space, and the new parameter pair is in new line. An RW > attribute 'pwm' could accept a parameter pair separated by > space. > > A range could be also given in 'pwm_available', like this: > '500-1000 500-1000'. This has the limitation that if there > is a hardware which can blink a LED in differet freqencies, > but only with fixed 50% duty cycle, the on-time off-time > pair cannot express this range easily. > > My real-world example would be my Clevo D4J (D410J) > notebook's mail led. It has three known state: off, PWM at > 1Hz (50%), PWM at 0.5Hz (50%). In case the on-time [ms] > off-time [ms] parameter pairs are used: > > $ cat pwm_available > 500 500 > 1000 1000 > > What is your opinion? Maybe you should consider that if there's only one parameter, it implies both on- and off- times, leading to a duty cycle of 50% ? It would also make it easier to get and set the frequency when the duty cycle is assumed to be 50%. Also, I'm not sure that a resolution of 1ms really is appropriate, in case you encounter hardware with better resolution. With ms, at high blink rates (>=100 Hz), you're bound to 500,333,250,200,166,142,125,111,100 Hz, which does not give you much control over the duty cycle for devices with a high frequency. Maybe you should express the on- and off- times in microseconds ? Just my two cents anyway since I'm not directly concerned by such devices. Regards, Willy ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-18 7:45 ` Németh Márton 2007-02-18 8:07 ` Willy Tarreau @ 2007-02-18 11:12 ` Richard Purdie 1 sibling, 0 replies; 13+ messages in thread From: Richard Purdie @ 2007-02-18 11:12 UTC (permalink / raw) To: Németh Márton Cc: Pavel Machek, Dmitry Torokhov, linux-input, linux-kernel On Sun, 2007-02-18 at 08:45 +0100, Németh Márton wrote: > A blinking led is basically a PWM (Pulse Width Modulation) > signal. A PWM signal has three different attribute. The > first one is the amplitude, this attribute is already > provided by the led subsystem as "brightness". There are two > more attributes, which are the frequency [Hz] and the duty > cycle [%], or the on-time [ms] and off-time [ms]. > > The frequency [Hz] and duty cycle [%] parameters has the > problem, that if we are limited to integers, it is not > possible to express slower blinks than 1Hz. We could also > use [mHz] (milli-Hertz), but it is not very common unit. > > The on-time [ms] and off-time [ms] seems to be easier to > handle (and this is also easier to simulate from software if > ever needed). An RO attribute could be introduced: > 'pwm_available', which can contain parameter pairs separated > by space, and the new parameter pair is in new line. An RW > attribute 'pwm' could accept a parameter pair separated by > space. We already have a timer trigger which takes an on time and an off time for the reason you mention above (floating point would get ugly). The problem is mainly about finding ways to enable hardware acceleration of the existing timer trigger (where possible) and maybe implementing a simpler blink trigger which could be hardware accelerated when the full blown timer trigger couldn't. Regards, Richard ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] input: extend EV_LED 2007-02-15 22:47 ` Németh Márton 2007-02-15 23:09 ` Richard Purdie @ 2007-02-16 14:04 ` Pavel Machek 1 sibling, 0 replies; 13+ messages in thread From: Pavel Machek @ 2007-02-16 14:04 UTC (permalink / raw) To: Németh Márton Cc: Dmitry Torokhov, Richard Purdie, linux-input, linux-kernel Hi! > > > >I do not know the LED subsystem in detail, but I do not > > > >know > > > >any possibility to access the i8042 from different > > > >subsystem > > > >than the input subsystem. > > > > > > > >What do you think and recommend? > > > > > > I think you need to use leds framework for what you are > > > trying to do. > > > > I'm actually not sure if led framework can do that. It was > designed > > for leds on gpios, and handles blinking itself. > > > > But he could export two leds :-). > > Hi, > > what do you mean about two leds? The first one would be > off/0.5Hz and the other off/1Hz? Somethinglike that. > I read in linux/Documentation/led-class.txt the following: > > | Some leds can be programmed to flash in hardware. As this > isn't a generic > | LED device property, this should be exported as a device > specific sysfs > | attribute rather than part of the class if this > functionality is required. > > Does it mean that neither the input subsystem nor the led > subsystem is designed for hardware acelerated blinking leds? Seems so. -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-02-18 11:12 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <45CEE9AB.2020208@freemail.hu> 2007-02-12 18:31 ` [PATCH] input: extend EV_LED Dmitry Torokhov 2007-02-14 19:06 ` Németh Márton 2007-02-14 19:49 ` Dmitry Torokhov 2007-02-14 23:51 ` Németh Márton 2007-02-15 17:40 ` Pavel Machek 2007-02-15 22:47 ` Németh Márton 2007-02-15 23:09 ` Richard Purdie 2007-02-15 23:24 ` Pavel Machek 2007-02-15 23:36 ` Richard Purdie 2007-02-18 7:45 ` Németh Márton 2007-02-18 8:07 ` Willy Tarreau 2007-02-18 11:12 ` Richard Purdie 2007-02-16 14:04 ` Pavel Machek
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).