2.6: drivers/input/power.c is never built
In 2.6, drivers/input/power.c would only have been built if CONFIG_INPUT_POWER was enabled - but it is nowhere possible to enable this option.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 4 lines
In 2.6,
drivers/input/power.cwould only have been built ifCONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.
That was written a long time ago before the new power management went in. On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power management is in what should we do?
Quoted 10 lines · James Simmons
Quoted 4 lines
In 2.6,
drivers/input/power.cwould only have been built ifCONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.That was written a long time ago before the new power management went in. On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power management is in what should we do?
Change power.c to generate power events like ACPI does, most likely.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 11 lines
Quoted 9 lines
Quoted 3 lines
In 2.6,
drivers/input/power.cwould only have been built ifCONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.That was written a long time ago before the new power management went in. On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power management is in what should we do?
Change
power.cto generate power events like ACPI does, most likely.
Actually I believe you want to fix ACPI to use inputs. You hardly want /proc/acpi/events on PDA, right?
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 11 lines
Quoted 9 lines
Quoted 3 lines
In 2.6,
drivers/input/power.cwould only have been built ifCONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.That was written a long time ago before the new power management went in. On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power management is in what should we do?
Change
power.cto generate power events like ACPI does, most likely.
There was some recent discussion of this on linux-input. It was basically agreed that the input system should pass the request on to ACPI and/or apm and Dmitry Torokhov (cc'd) proposed a patch that did this. His patch needed to be slightly modified to work with arm apm, the final result being:
http://www.rpsys.net/openzaurus/2.6.11-rc4/input_power-r1.patch
I can confirm this works well on arm with apm enabled.
Regards,
Richard
Hi!
Quoted 14 lines
Quoted 11 lines
Quoted 10 lines
Quoted 2 lines
CONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.That was written a long time ago before the new power management went in.
On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power
management is in what should we do?Quoted 1 line
Change
power.cto generate power events like ACPI does, most likely.
Quoted 8 lines
There was some recent discussion of this on linux-input. It was basically agreed that the input system should pass the request on to ACPI and/or apm and Dmitry Torokhov (cc'd) proposed a patch that did this. His patch needed to be slightly modified to work with arm apm, the final result being:
http://www.rpsys.net/openzaurus/2.6.11-rc4/input_power-r1.patch
I can confirm this works well on arm with apm enabled.
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI. /proc/acpi/events needs to die, being replaced by input subsystem.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 5 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.
But aren't there power events (battery low, etc) which are not input events?
Regards
Oliver
Hi!
Quoted 7 lines
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.But aren't there power events (battery low, etc) which are not input events?
Yes, there are. They can probably stay... Or we can get "battery low" key.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 10 lines · Pavel Machek
Quoted 7 lines
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.But aren't there power events (battery low, etc) which are not input events?
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that, EV_PWR in the input subsystem.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Am Freitag, 18. Februar 2005 18:00 schrieb Vojtech Pavlik:
Quoted 7 lines · Pavel Machek
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
But aren't there power events (battery low, etc) which are not input events?
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that,
EV_PWRin the input subsystem.
Over that route we'd arrive at a situation where power management without the input layer is impossible. Think about embedded stuff I wonder whether this is viable.
Regards
Oliver
Quoted 11 lines · Oliver Neukum
Am Freitag, 18. Februar 2005 18:00 schrieb Vojtech Pavlik:
Quoted 10 lines · Pavel Machek
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.But aren't there power events (battery low, etc) which are not input events?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that,
EV_PWRin the input subsystem.Over that route we'd arrive at a situation where power management without the input layer is impossible.
All you'd need is input.c. One file, approx 750 lines at the moment, a big chunk of that can be confugured out if you don't need procfs or hotplug.
Quoted 1 line
Think about embedded stuff I wonder whether this is viable.
On most embedded platforms you have some buttons or controls, so it's likely you'll use input anyway.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Quoted 9 lines
All you'd need is
input.c. One file, approx 750 lines at the moment, a big chunk of that can be confugured out if you don't need procfs or hotplug.Quoted 1 line
Think about embedded stuff I wonder whether this is viable.
On most embedded platforms you have some buttons or controls, so it's likely you'll use input anyway.
I have always used the input api on embedded devices.
Hi!
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that,
EV_PWRin the input subsystem.Over that route we'd arrive at a situation where power management without the input layer is impossible. Think about embedded stuff I wonder whether this is viable.
I'd say it is: you need some support to get it into userspace. And I'd certianly prefer input infrastructure over ACPI infrastructure...
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Am Freitag, 18. Februar 2005 21:14 schrieb Pavel Machek:
Quoted 5 lines
Hi!
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Yes, there are. They can probably stay... Or we can get "battery low" key.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
We even have an event class for that,
EV_PWRin the input subsystem.Over that route we'd arrive at a situation where power management without the input layer is impossible. Think about embedded stuff I wonder whether this is viable.
I'd say it is: you need some support to get it into userspace. And I'd certianly prefer input infrastructure over ACPI infrastructure...
If it could replace ACPI (or some abstraction thereof), maybe. But power management needs communication in both ways
(like setting warn levels and transfers complex things, like queries for battery power which cannot easily be abstracted as events)
Regards
Oliver
Quoted 7 lines · Vojtech Pavlik
Quoted 5 lines · Pavel Machek
Quoted 5 lines
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
But aren't there power events (battery low, etc) which are not input events?
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that,
EV_PWRin the input subsystem.
I really really think this is wrong. Power management should be possible without input layer. EV_PWR is fine for telling input devices to do something, like enter lower power mode and for sending _some_ requests to the PM system. But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Signature · 1 line
Dmitry
Quoted 11 lines · Dmitry Torokhov
Quoted 10 lines · Vojtech Pavlik
Quoted 8 lines · Pavel Machek
Quoted 7 lines
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.But aren't there power events (battery low, etc) which are not input events?
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Yes, there are. They can probably stay... Or we can get "battery low" key.
We even have an event class for that,
EV_PWRin the input subsystem.I really really think this is wrong. Power management should be possible without input layer.
EV_PWRis fine for telling input devices to do something, like enter lower power mode
Definitely not for this. The request to go to low power mode should come from the other side - the bus the device lives on.
Quoted 1 line
and for sending _some_ requests to the PM system.
I don't think input devices themselves should be sending any requests to the PM system at all, they should just pass the events to the userspace and have that decide what to do with it.
Maybe a simple event handler like power.c for transforming key events to power change requests for embedded systems makes sense, but normally many more variables need to be taken into account, and thus userspace needs to decide.
Quoted 2 lines
But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Well, plugging in a power cord is a physical user action much like closing the lid is, much like pressing the power button is, much like pressing a key is.
I definitely wouldn't want to see input to be a generic trasport layer - it is not. But I wouldn't be opposed to pass some of the user induced events through it.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Quoted 15 lines · Vojtech Pavlik
Quoted 14 lines · Dmitry Torokhov
Quoted 13 lines · Vojtech Pavlik
Quoted 10 lines · Pavel Machek
Quoted 7 lines
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.But aren't there power events (battery low, etc) which are not input events?
Yes, there are. They can probably stay... Or we can get "battery low" key.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
We even have an event class for that,
EV_PWRin the input subsystem.I really really think this is wrong. Power management should be possible without input layer.
EV_PWRis fine for telling input devices to do something, like enter lower power modeDefinitely not for this. The request to go to low power mode should come from the other side - the bus the device lives on.
Probably not. On the other hand input layer is kind of a hyper-transport allowing to send messages to several devices at one regardless of the bis they are reside on.
Quoted 12 lines
Quoted 2 lines
and for sending _some_ requests to the PM system.
I don't think input devices themselves should be sending any requests to the PM system at all, they should just pass the events to the userspace and have that decide what to do with it.
Maybe a simple event handler like
power.cfor transforming key events to power change requests for embedded systems makes sense, but normally many more variables need to be taken into account, and thus userspace needs to decide.
I never said it should go staringt into the core of ACPI and performing some action. That hack to power.c that I did was effectively sending message to acpid giving userspace a chance to make decision and react to the request.
Quoted 6 lines
Quoted 2 lines
But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Well, plugging in a power cord is a physical user action much like closing the lid is, much like pressing the power button is, much like pressing a key is.
What about power dying and my UPS switing on? I think it is out of input layer, we need PM/system state messaging layer. It can be based on acpi events and acpid or maybe kevents (but I don't like the idea of needing kobjects for that).
Still power.c seems like the good place to hide all the ugliness and glue between that new (or old) layer and input layer.
Signature · 1 line
Dmitry
Quoted 9 lines · Dmitry Torokhov
Quoted 6 lines
Quoted 2 lines
But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Well, plugging in a power cord is a physical user action much like closing the lid is, much like pressing the power button is, much like pressing a key is.
What about power dying and my UPS switing on? I think it is out of input layer,
Yes, I was thinking about this, too. An UPS is pretty much the same thing to a desktop as a battery is to a notebook. And I also got to the conclusion that this is a bad idea.
But now that you are talking about this, I think there is some merit to that way.
UPSes are usually handled by userspace daemons, either through serial ports or via USB over hiddev (which is another driver that should be redone from scratch).
So we may need a way to loop these events through the kernel to make them available to the power event handling software. uinput would be a rather straightforward solution here ...
Quoted 3 lines
we need PM/system state messaging layer. It can be based on acpi events and acpid or maybe kevents (but I don't like the idea of needing kobjects for that).
ACPI is too platform specific. We really need some platform independent way to be able to have a simple software solution.
Quoted 2 lines
Still
power.cseems like the good place to hide all the ugliness and glue between that new (or old) layer and input layer.
Yes, it's a reasonable way. But the other way around (passing most power related events through input) also is quite compelling.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Well, plugging in a power cord is a physical user action much like closing the lid is, much like pressing the power button is, much like pressing a key is.
Quoted 6 lines
Quoted 2 lines
What about power dying and my UPS switing on? I think it is out of input layer,
Yes, I was thinking about this, too. An UPS is pretty much the same thing to a desktop as a battery is to a notebook. And I also got to the conclusion that this is a bad idea.
Well, I'm not sure if input layer is suitable for batteries... Modern battery has quite a lot of parameters. It can tell you current voltage, current capacity (either mAh or mWh), design capacity, last capacity at full charge, current current, battery's estimate of run time (which may be better than system's estimate), ... But some batteries only know percentage of energy left, and some batteries only know current voltage (you can estimate %left from that). I'm not sure if input system can handle all that complexity...
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 16 lines · Pavel Machek
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
But input layer shoudl not be used as a generic transport. I mean battery low, docking requests, etc has nothing to do with input.
Well, plugging in a power cord is a physical user action much like closing the lid is, much like pressing the power button is, much like pressing a key is.
Quoted 6 lines
Quoted 2 lines
What about power dying and my UPS switing on? I think it is out of input layer,
Yes, I was thinking about this, too. An UPS is pretty much the same thing to a desktop as a battery is to a notebook. And I also got to the conclusion that this is a bad idea.
Quoted 8 lines
Well, I'm not sure if input layer is suitable for batteries... Modern battery has quite a lot of parameters. It can tell you current voltage, current capacity (either mAh or mWh), design capacity, last capacity at full charge, current current, battery's estimate of run time (which may be better than system's estimate), ... But some batteries only know percentage of energy left, and some batteries only know current voltage (you can estimate %left from that). I'm not sure if input system can handle all that complexity...
I wouldn't want to pass all the battery info (UPSes can be even more complex, able to switch on/off individual sockets, etc) through input, just the basic events:
AC power on/off
battery full/normal/low/critical/(fail)
Then the other power-related events
Lid open/closed
Power button
Sleep button
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
Nice graphics battery monitors in X can gather their information from the platform specific sources, since they'll need it all in the greatest detail.
PS.
full = not charging
normal = OK state, charging if AC
low = better shutdown if you don't want to stress the battery
(namely LiIon batteries prefer not to be discharged too much)
critical = last chance to shutdown cleanly
fail = battery present, but doesn't work.
A server, while booting should wait for battery going at least to 'low' before mounting system read/write, otherwise subsequent power failures might cause damage.
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 22 lines
Quoted 8 lines
Well, I'm not sure if input layer is suitable for batteries... Modern battery has quite a lot of parameters. It can tell you current voltage, current capacity (either mAh or mWh), design capacity, last capacity at full charge, current current, battery's estimate of run time (which may be better than system's estimate), ... But some batteries only know percentage of energy left, and some batteries only know current voltage (you can estimate %left from that). I'm not sure if input system can handle all that complexity...
I wouldn't want to pass all the battery info (UPSes can be even more complex, able to switch on/off individual sockets, etc) through input, just the basic events:
AC power on/off
battery full/normal/low/critical/(fail)Then the other power-related events
Lid open/closed
Power button
Sleep button
Quoted 7 lines
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
Nice graphics battery monitors in X can gather their information from the platform specific sources, since they'll need it all in the greatest detail.
Makes sense. Other possibility is to have simple "battery status changed" event, but that would not be enough for simple UPSes... I guess battery full/normal/low/critical makes sense, perhaps I'd say that battery might repeat event if something "interesting" changed.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Am Freitag, 18. Februar 2005 21:40 schrieb Vojtech Pavlik:
Quoted 4 lines
I wouldn't want to pass all the battery info (UPSes can be even more complex, able to switch on/off individual sockets, etc) through input, just the basic events:
Quoted 8 lines
AC power on/off
battery full/normal/low/critical/(fail)Then the other power-related events
Lid open/closed
Power button
Sleep button
What is the benefit of splitting the flow of information so?
Quoted 3 lines
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
That is very debateable. I might want a quiet mode and would be interested in notifications about thermal data and fan status.
Regards
Oliver
Hi!
Quoted 7 lines
Quoted 7 lines
I wouldn't want to pass all the battery info (UPSes can be even more complex, able to switch on/off individual sockets, etc) through input, just the basic events:
AC power on/off
battery full/normal/low/critical/(fail)
Quoted 7 lines
Quoted 5 lines
Then the other power-related events
Lid open/closed
Power button
Sleep buttonWhat is the benefit of splitting the flow of information so?
Well, if you have power button on usb keyboard -- why should it be handled differently from built-in button?
Quoted 6 lines
Quoted 3 lines
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
That is very debateable. I might want a quiet mode and would be interested in notifications about thermal data and fan status.
Hmm, yes, some thermal notifications are needed. OTOH I'm not sure if all the hardware does sent interrupts for temperature changes (you definitely do not get interrupts for "small" changes that do not cross trip points), and I do not see how you can do interrupts for fan status. Either fans are under Linux control (and kernel could tell you when it turns fan on/off, but...), or they do not exist from Linux's point of few.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Am Freitag, 18. Februar 2005 22:34 schrieb Pavel Machek:
Quoted 2 lines
Well, if you have power button on usb keyboard -- why should it be handled differently from built-in button?
I see no reason. But that tells you that one subsystem should handle that, not which subsystem.
Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
That is very debateable. I might want a quiet mode and would be interested in notifications about thermal data and fan status.
Hmm, yes, some thermal notifications are needed. OTOH I'm not sure if all the hardware does sent interrupts for temperature changes (you definitely do not get interrupts for "small" changes that do not cross
I suspect that this is really done in SMI.
Quoted 4 lines
trip points), and I do not see how you can do interrupts for fan status. Either fans are under Linux control (and kernel could tell you when it turns fan on/off, but...), or they do not exist from Linux's point of few.
They still can have a readable rate, even if not under os control. Nevertheless I don't think you can reasonably define what might interest user space or not and in which detail.
Regards
Oliver
Hi!
Quoted 5 lines
Quoted 2 lines
Well, if you have power button on usb keyboard -- why should it be handled differently from built-in button?
I see no reason. But that tells you that one subsystem should handle that, not which subsystem.
If usb keyboard has power button... I do not think we really want to route that through acpi. And what if acpi is not available? (APM knows about suspend key in weird way, but not about power key).
Quoted 8 lines
Quoted 4 lines
trip points), and I do not see how you can do interrupts for fan status. Either fans are under Linux control (and kernel could tell you when it turns fan on/off, but...), or they do not exist from Linux's point of few.
They still can have a readable rate, even if not under os control. Nevertheless I don't think you can reasonably define what might interest user space or not and in which detail.
Well, we can say that userspace definitely is interested in "power" key ;-).
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Am Samstag, 19. Februar 2005 00:34 schrieb Pavel Machek:
Quoted 11 lines
Hi!
Quoted 5 lines
Quoted 2 lines
Well, if you have power button on usb keyboard -- why should it be handled differently from built-in button?
I see no reason. But that tells you that one subsystem should handle that, not which subsystem.
If usb keyboard has power button... I do not think we really want to route that through acpi. And what if acpi is not available? (APM knows about suspend key in weird way, but not about power key).
I'd suggest to primarily care about acpi. The other important power management subsystems will follow suit.
Quoted 11 lines
Quoted 8 lines
Quoted 4 lines
trip points), and I do not see how you can do interrupts for fan status. Either fans are under Linux control (and kernel could tell you when it turns fan on/off, but...), or they do not exist from Linux's point of few.
They still can have a readable rate, even if not under os control. Nevertheless I don't think you can reasonably define what might interest user space or not and in which detail.
Well, we can say that userspace definitely is interested in "power" key ;-).
I wouldn't call that selfevident. The system might be eg. a ticket vending system and we care only about wake ups from touchscreen, trackball and modem and about volume control keys. I don't think you can make up any rules about what user space is interested or not.
Regards
Oliver
Hi!
Quoted 6 lines
Quoted 3 lines
If usb keyboard has power button... I do not think we really want to route that through acpi. And what if acpi is not available? (APM knows about suspend key in weird way, but not about power key).
I'd suggest to primarily care about acpi. The other important power management subsystems will follow suit.
But... power key is not really a powermanagment and we do not want to have 1000 different ways "deliver info about power key into userspace".
And acpi way of delivery things is not really suitable.... it mixes power key (and similar) with battery alarms etc. ACPI interface is *not* nice, lets not emulate that one.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
trip points), and I do not see how you can do interrupts for fan status. Either fans are under Linux control (and kernel could tell you when it turns fan on/off, but...), or they do not exist from Linux's point of few.
They still can have a readable rate, even if not under os control. Nevertheless I don't think you can reasonably define what might interest user space or not and in which detail.
Quoted 7 lines
Quoted 2 lines
Well, we can say that userspace definitely is interested in "power" key ;-).
I wouldn't call that selfevident. The system might be eg. a ticket vending system and we care only about wake ups from touchscreen, trackball and modem and about volume control keys. I don't think you can make up any rules about what user space is interested or not.
Yes, maybe userspace is not interested in "space" key. In such case userland simply ignores "space" event. I do not know why "power" key should be handled in any other way.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 7 lines · Oliver Neukum
Quoted 2 lines
Well, we can say that userspace definitely is interested in "power" key ;-).
I wouldn't call that selfevident. The system might be eg. a ticket vending system and we care only about wake ups from touchscreen, trackball and modem and about volume control keys. I don't think you can make up any rules about what user space is interested or not.
If noone can tell in advance who will be interested and what to do with it, that looks like a very good reason to go through userspace ..
Xav
Quoted 1 line · Oliver Neukum
What is the benefit of splitting the flow of information so?
It's split already. You get some from input (power and sleep keys on keyboards, sound volume keys and display brightness on some notebooks), some from ACPI events (power keys on notebooks and desktop cases, sound volume, display brightness on other notebooks), some from /proc/acpi/* (battery status, fan status), some from APM, from platform specific devices, from hotplug, from userspace daemons (UPS status).
The question is how to unify it.
Using power.c to simply pass power/sleep keys to the ACPI event pipe could get the input subsystem out of the loop at least. Maybe we could even pass sound keys to it.
It's probably still the best option, though I argued for doing it the other way around - I want to know the pros and cons for all the possible approaches.
Quoted 10 lines
Quoted 3 lines
I think that's all you need to trigger actions. You don't need the exact percentage of the battery, and you don't need the exact AC voltage at input.
That is very debateable. I might want a quiet mode and would be interested in notifications about thermal data and fan status.
Regards
Oliver
Signature · 2 lines
Vojtech Pavlik SuSE Labs, SuSE CR
Hi!
Quoted 9 lines
Quoted 1 line
What is the benefit of splitting the flow of information so?
It's split already. You get some from input (power and sleep keys on keyboards, sound volume keys and display brightness on some notebooks), some from ACPI events (power keys on notebooks and desktop cases, sound volume, display brightness on other notebooks), some from
/proc/acpi/*(battery status, fan status), some from APM, from platform specific devices, from hotplug, from userspace daemons (UPS status).
Quoted 5 lines
The question is how to unify it.
Using
power.cto simply pass power/sleep keys to the ACPI event pipe could get the input subsystem out of the loop at least. Maybe we could even pass sound keys to it.
I do not think passing sound keys through acpi is good idea. acpid does not know how to handle them, and X already know how to get them from input subsystem.
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
Quoted 3 lines
It's probably still the best option, though I argued for doing it the other way around - I want to know the pros and cons for all the possible approaches.
Pavel
Signature · 2 lines
People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
Quoted 13 lines · Pavel Machek
Hi!
Quoted 11 lines
Quoted 1 line
What is the benefit of splitting the flow of information so?
It's split already. You get some from input (power and sleep keys on keyboards, sound volume keys and display brightness on some notebooks), some from ACPI events (power keys on notebooks and desktop cases, sound volume, display brightness on other notebooks), some from
/proc/acpi/*(battery status, fan status), some from APM, from platform specific devices, from hotplug, from userspace daemons (UPS status).The question is how to unify it.
Quoted 7 lines
Quoted 3 lines
Using
power.cto simply pass power/sleep keys to the ACPI event pipe could get the input subsystem out of the loop at least. Maybe we could even pass sound keys to it.I do not think passing sound keys through acpi is good idea. acpid does not know how to handle them, and X already know how to get them from input subsystem.
What X? I am not saying that sound events should go through acpid, but why bringing X here? One may not even run X...
Quoted 5 lines
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not so heavily oriented on ACPI. I wonder if that kernel connector patch should be looked at.
Signature · 1 line
Dmitry
Hi.
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Pavel Machek
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not so heavily oriented on ACPI. I wonder if that kernel connector patch should be looked at.
Absolutely. I've been thinking about this too, but haven't yet found the time to put it down on paper/email yet.
I think we need a very generic system by which changes in anything remotely impacting on power management (kernelspace or userspace, including ACPI, UPS drivers, keyboard handlers, devices etc) can notify events to a userspace daemon. This daemon can act in accordance with user specified policies (changeable on the fly) to implement system level state changes (suspend to ram/disk, shutdown etc), run time power management (shutdown a USB hub that just signalled the removal of its last client), logging and so on. In some cases, it might set policy but not be actively informed of the details of the application of that policy (we don't feedback loops with a process leaving C3 to notify that it's entering C3!).
This implies, of course, not just a generic way of notifying changes, but a generic way of implementing policy.
Sound too ambitious, or am I thinking your thoughts after you?
Regards,
Nigel
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Hi Nigel,
Quoted 15 lines · Nigel Cunningham
Hi.
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Pavel Machek
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not so heavily oriented on ACPI. I wonder if that kernel connector patch should be looked at.
Absolutely. I've been thinking about this too, but haven't yet found the time to put it down on paper/email yet.
Quoted 7 lines
I think we need a very generic system by which changes in anything remotely impacting on power management (kernelspace or userspace, including ACPI, UPS drivers, keyboard handlers, devices etc) can notify events to a userspace daemon. This daemon can act in accordance with user specified policies (changeable on the fly) to implement system level state changes (suspend to ram/disk, shutdown etc), run time power management
Yep.
Quoted 2 lines
(shutdown a USB hub that just signalled the removal of its last client), logging and so on.
This last example - I don't think the daemon should micro-manage, I think USB bus should shutdown the hub automatically without involving userspace.
Quoted 10 lines
In some cases, it might set policy but
not be actively informed of the details of the application of that policy (we don't feedback loops with a process leaving C3 to notify that it's entering C3!).This implies, of course, not just a generic way of notifying changes, but a generic way of implementing policy.
Sound too ambitious, or am I thinking your thoughts after you?
Well, at this moment I only care about delivering the data to userspace, the rest (daemon, policies) is although interesting is out of scope for me.
Signature · 1 line
Dmitry
Hi.
Quoted 26 lines · Dmitry Torokhov
Hi Nigel,
Quoted 15 lines · Nigel Cunningham
Hi.
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Pavel Machek
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not so heavily oriented on ACPI. I wonder if that kernel connector patch should be looked at.
Absolutely. I've been thinking about this too, but haven't yet found the time to put it down on paper/email yet.
Quoted 7 lines
I think we need a very generic system by which changes in anything remotely impacting on power management (kernelspace or userspace, including ACPI, UPS drivers, keyboard handlers, devices etc) can notify events to a userspace daemon. This daemon can act in accordance with user specified policies (changeable on the fly) to implement system level state changes (suspend to ram/disk, shutdown etc), run time power management
Quoted 7 lines
Yep.
Quoted 2 lines
(shutdown a USB hub that just signalled the removal of its last client), logging and so on.
This last example - I don't think the daemon should micro-manage, I think USB bus should shutdown the hub automatically without involving userspace.
Yeah. Sort of contradicted what I said next, didn't I :>
Quoted 5 lines
Quoted 5 lines
In some cases, it might set policy but
not be actively informed of the details of the application of that policy (we don't feedback loops with a process leaving C3 to notify that it's entering C3!).
Quoted 8 lines
Quoted 4 lines
This implies, of course, not just a generic way of notifying changes, but a generic way of implementing policy.
Sound too ambitious, or am I thinking your thoughts after you?
Well, at this moment I only care about delivering the data to userspace, the rest (daemon, policies) is although interesting is out of scope for me.
I think we need to keep the whole picture in mind though - otherwise we might find the design is to inflexible or such like.
Regards,
Nigel
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Quoted 8 lines
Quoted 5 lines
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not so heavily oriented on ACPI. I wonder if that kernel connector patch should be looked at.
Absolutely. I've been thinking about this too, but haven't yet found the time to put it down on paper/email yet.
Checkout DBUS. Its very nice.
Quoted 1 line · Previously James Simmons
Checkout DBUS. Its very nice.
D-BUS is already userspace. netlink however is a nice transport system and there are several existing tools that pass messages from netlink onto D-BUS.
Wichert.
Signature · 2 lines
Wichert Akkerman <[email protected]> It is simple to make things. http://www.wiggy.net/ It is hard to make things simple.
Quoted 7 lines
Quoted 1 line · Previously James Simmons
Checkout DBUS. Its very nice.
D-BUS is already userspace. netlink however is a nice transport system and there are several existing tools that pass messages from netlink onto D-BUS.
That is what I mean. We already have a userspace component.
Quoted 8 lines · James Simmons
Quoted 6 lines
Quoted 1 line · Previously James Simmons
Checkout DBUS. Its very nice.
D-BUS is already userspace. netlink however is a nice transport system and there are several existing tools that pass messages from netlink onto D-BUS.
That is what I mean. We already have a userspace component.
I like the look of it!
Looks like some work has already been done on getting kernel events out to dbus, too. Found this email:
http://mail.gnome.org/archives/utopia-list/2004-July/msg00031.html
Think I'll contact RML and Kay to see what the current state of play is.
Nigel
Signature · 5 lines
Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Checkout DBUS. Its very nice.
D-BUS is already userspace. netlink however is a nice transport system and there are several existing tools that pass messages from netlink onto D-BUS.
That is what I mean. We already have a userspace component.
Quoted 7 lines
I like the look of it!
Looks like some work has already been done on getting kernel events out to dbus, too. Found this email:
http://mail.gnome.org/archives/utopia-list/2004-July/msg00031.htmlThink I'll contact RML and Kay to see what the current state of play is.
DBUS isthe future. I just wish they had programing howto for the average joe to write apps for it.
Quoted 2 lines · Previously James Simmons
DBUS isthe future. I just wish they had programing howto for the average joe to write apps for it.
The docs are good enough in my experience, there just seems to be a gap between the docs and the code. Strangely enough in this case there are documented API bits that are not implemented instead of the other way around as usual.
Wichert.
Signature · 2 lines
Wichert Akkerman <[email protected]> It is simple to make things. http://www.wiggy.net/ It is hard to make things simple.
Quoted 3 lines · Previously Nigel Cunningham
Looks like some work has already been done on getting kernel events out to dbus, too. Found this email:
http://mail.gnome.org/archives/utopia-list/2004-July/msg00031.html
Or http://lists.freedesktop.org/archives/dbus/2005-February/002170.html
or one of the few others that are there.
And the answer to all of those seems to be at HAL.
Wichert.
Signature · 2 lines
Wichert Akkerman <[email protected]> It is simple to make things. http://www.wiggy.net/ It is hard to make things simple.
Hi!
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
The question is how to unify it.
Using
power.cto simply pass power/sleep keys to the ACPI event pipe could get the input subsystem out of the loop at least. Maybe we could even pass sound keys to it.
Quoted 6 lines
Quoted 3 lines
I do not think passing sound keys through acpi is good idea. acpid does not know how to handle them, and X already know how to get them from input subsystem.
What X? I am not saying that sound events should go through acpid, but why bringing X here? One may not even run X...
True, but X is big "existing user", thats why I mentioned it.
Pavel
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
Hi!
Quoted 7 lines
Quoted 4 lines
I believe power and suspend keys should definitely go through input. I'm not that sure about battery... Lid is somewhere in between...
I think we need a generic way of delivering system status changes to userspace. Something like acpid but bigger than that, something not
Yes, we need something like that. But IMNSHO, it should not handle power button. We already have perfectly good way of handling power button through input.
Pavel
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
Quoted 11 lines
Quoted 2 lines
What is the benefit of splitting the flow of information so?
It's split already. You get some from input (power and sleep keys on keyboards, sound volume keys and display brightness on some notebooks), some from ACPI events (power keys on notebooks and desktop cases, sound volume, display brightness on other notebooks), some from
/proc/acpi/*(battery status, fan status), some from APM, from platform specific devices, from hotplug, from userspace daemons (UPS status).The question is how to unify it.
When I wrote power.c I thought there was a common power management interface. I found out I was wrong. I though the new driver model supplied a common method for power management for all platforms
Pavel Machek:
Quoted 4 lines
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI, and it will not work on i386/APM, anyway. I still believe right solution is to add input interface to ACPI.
/proc/acpi/eventsneeds to die, being replaced by input subsystem.
I'm not too familiar with ACPI so I can't really comment on that. The system I'm working on only has APM. I think some attempt needs to be made to use apm if available. As i386 won't support it, lets drop the i386/APM until it does and just keep the arm case.
Regards,
Richard
Quoted 22 lines · Pavel Machek
Hi!
Quoted 19 lines
Quoted 11 lines
Quoted 10 lines
Quoted 2 lines
CONFIG_INPUT_POWERwas enabled - but it is nowhere possible to enable this option.That was written a long time ago before the new power management went in.
On PDA's there is a power button and suspend button. So this was a hook so that the input layer could detect the power/suspend button being presses and then power down or turn off the device. Now that the new power
management is in what should we do?Quoted 1 line
Change
power.cto generate power events like ACPI does, most likely.There was some recent discussion of this on linux-input. It was basically agreed that the input system should pass the request on to ACPI and/or apm and Dmitry Torokhov (cc'd) proposed a patch that did this. His patch needed to be slightly modified to work with arm apm, the final result being:
Quoted 5 lines
Quoted 3 lines
http://www.rpsys.net/openzaurus/2.6.11-rc4/input_power-r1.patch
I can confirm this works well on arm with apm enabled.
It has quite a lot of #ifdefs for CONFIG_APM/CONFIG_ARM/CONFIG_ACPI,
Yes, power.c is an aggregator that transports power events from the input system into whatever power scheme is in use, so there will always be a lot of ifdefs unless we will invent grand unified power interface with userspace. I wonder if we could use kevents.
Quoted 1 line
and it will not work on i386/APM, anyway.
We could add fix i386 APM case but it looks like most people are concentrating on ACPI.
Quoted 3 lines
I still believe right
solution is to add input interface to ACPI./proc/acpi/eventsneeds to die, being replaced by input subsystem.
There are many more events from ACPI that are not related to input, so we need to keep it. Still, I can see buttons converted to input devices which bind to power.c and then transmit requests to acpid through /acpi/proc/event.
Signature · 1 line
Dmitry