public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: apm.c and multiple battery slots
@ 2002-02-03  2:58 Thomas Hood
  2002-02-03  6:53 ` Stevie O
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thomas Hood @ 2002-02-03  2:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Rothwell

Stevie O <stevie@qrpff.net> wrote:
> 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.

> 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


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: apm.c and multiple battery slots
@ 2002-02-02 13:30 Thomas Hood
  2002-02-02 21:23 ` Stevie O
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Hood @ 2002-02-02 13:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stevie O, Stephen Rothwell

> I went to apm.c to look into patching it to support
> multiple batteries.
> I found this function:
>   static int apm_get_battery_status(which, status, bat,
>                                     life, nbat <- battery #)
> but it's #if 0'd out, and isn't referred to anywhere in the code.
> I looked at the changelog in the file to try to determine when
> it stopped being used, and why, but I found no useful information,
> and I can't even ask the person who did it, since they didn't
> tell me they did...

I am not the author, so the following is speculation.
My guess is that apm_get_battery_status() was written to
support multiple batteries (supported by APM 1.2 only) but
that the authors never got around to providing a user
interface to this functionality; so it remains ifdeffed out.
(Hence the function never "stopped" being used.)

The current official maintainer of the driver is Stephen Rothwell.

Stephen: How do you think the info about the second battery
might be furnished to the user?

--
Thomas








^ permalink raw reply	[flat|nested] 8+ messages in thread
* apm.c and multiple battery slots
@ 2002-02-02  4:58 Stevie O
  0 siblings, 0 replies; 8+ messages in thread
From: Stevie O @ 2002-02-02  4:58 UTC (permalink / raw)
  To: linux-kernel

I have an Inspiron 8100 and 2.4.13-ac5, with apmd-final. (I'm holding off 
upgrading until I stop seeing so much stuff about VM problems on lkml). It 
has two battery slots, left and right.

If I put the battery in the left slot and run 'apm' I get

AC on-line, battery charging: 84% (4:12)

If I take out the battery and run apm I get

AC on-line, no system battery

If I put it into the right slot I get

AC on-line

and /proc/apm says I have -1% battery free and -1 minutes remaining ;)

--

The battery was designed to go into the right slot, not the left (left is 
where the floppy drive goes).

--

I went to apm.c to look into patching it to support multiple batteries.

I found this function:
static int apm_get_battery_status(which, status, bat, life, nbat <- battery #)

but it's #if 0'd out, and isn't referred to anywhere in the code. I looked 
at the changelog in the file to try to determine when it stopped being 
used, and why, but I found no useful information, and I can't even ask the 
person who did it, since they didn't tell me they did...


--
Stevie-O

Real programmers use COPY CON PROGRAM.EXE


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

end of thread, other threads:[~2002-02-05 17:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-03  2:58 apm.c and multiple battery slots Thomas Hood
2002-02-03  6:53 ` Stevie O
2002-02-03 12:01 ` David Woodhouse
2002-02-04  2:55 ` APM and APIC -- multiple batteries (was: apm.c and multiple battery slots) Stevie O
2002-02-05 13:54   ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2002-02-02 13:30 apm.c and multiple battery slots Thomas Hood
2002-02-02 21:23 ` Stevie O
2002-02-02  4:58 Stevie O

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox