apm.c and multiple battery slots
Quoted 3 lines · Stevie O
I suggest we change the first line to reflect an
overall battery status (i.e. average of all slots
in system).
Sounds like a good idea.
Quoted 3 lines
Then we could add one line for each battery slot, indicating <battery status> <battery flag> <battery left % > <remaining time in seconds>
How about putting each of these lines in a separate proc file? This would avoid changing the format of /proc/apm, which would break things.
--
Thomas
Quoted 7 lines · Thomas Hood
Quoted 3 lines · Stevie O
I suggest we change the first line to reflect an
overall battery status (i.e. average of all slots
in system).Sounds like a good idea.
Quoted 7 lines
Quoted 3 lines
Then we could add one line for each battery slot, indicating <battery status> <battery flag> <battery left % > <remaining time in seconds>
How about putting each of these lines in a separate proc file? This would avoid changing the format of
/proc/apm, which would break things.
Or we could do something similar to what the IDE subsystem does, and have
/proc/apmbat/0 <- battery [slot] 0/proc/apmbat/1 <- battery [slot] 1
.../proc/apmbat/ <- battery [slot] N
I'd actually prefer to call it /proc/apm/ but obviously that won't work :)
--
Stevie-O
Real programmers use COPY CON PROGRAM.EXE
Quoted 7 lines · [email protected] said:
Quoted 3 lines
Then we could add one line for each battery slot, indicating <battery status> <battery flag> <battery left % > <remaining time in seconds>
How about putting each of these lines in a separate proc file? This would avoid changing the format of
/proc/apm, which would break things.
Please don't add an APM-specific interface for batteries. Look at the other code which talks to batteries - the ACPI code, SMBus and numerous other drivers for embedded systems - and design an interface to userspace which can be used by all of them.
Preferably not in /proc.
--
dwmw2
APM and APIC -- multiple batteries (was: apm.c and multiple battery slots)
Quoted 6 lines · David Woodhouse
Please don't add an APM-specific interface for batteries. Look at the other code which talks to batteries - the ACPI code, SMBus and numerous other drivers for embedded systems - and design an interface to userspace which can be used by all of them.
Preferably not in /proc.
Well, the only other interface I know of is device files, and from what I've seen, that seems to be a place where we autoload drivers when needed...
Besides, pretty much everything else in /proc is for transmitting (normally unchangeable, except for the sysctls) information from kernel to userspace. Why not /proc?
--
Now that you mention it, yes, I agree that an APM-specific interface for batteries would make code reuse harder (needing stuff for both APM and ACPI stuff). So we could have /proc/batteries/ maybe?
How does the ACPI stuff handle this? *Does* the ACPI stuff handle this (i.e. multiple batteries)? If so:
Is it a generic interface?
If so, we should let APM use it too.
If not, could we perhaps change it to one?
If not:
I'm ready for suggestions about my original idea :)
--
Stevie-O
Real programmers use COPY CON PROGRAM.EXE
Re: APM and APIC -- multiple batteries (was: apm.c and multiple battery slots)
In reply to Thomas HoodHi!
Quoted 2 lines
How does the ACPI stuff handle this? *Does* the ACPI stuff handle this (i.e. multiple batteries)?
Yes.
Quoted 3 lines
If so:
Is it a generic interface?
If so, we should let APM use it too.
Should be generic enough...
Pavel
Signature · 2 lines
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt, details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.