linux-mips
[Top] [All Lists]

Re: Battery status

To: Clark Williams <williams@redhat.com>
Subject: Re: Battery status
From: Rodolfo Giometti <giometti@linux.it>
Date: Sat, 23 Jul 2005 14:17:00 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <1122059285.10743.30.camel@riff>
Organization: Programmi e soluzioni GNU/Linux
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20050722142205.GE21044@enneenne.com> <1122044036.10743.5.camel@riff> <20050722151402.GG21044@enneenne.com> <1122045924.10743.16.camel@riff> <20050722153453.GI21044@enneenne.com> <1122059285.10743.30.camel@riff>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.6+20040722i
On Fri, Jul 22, 2005 at 02:08:05PM -0500, Clark Williams wrote:
> I would start out deciding where the user-space interface would live. If
> it were me, I'd probably create a /proc entry called <myplatform> (where
> <myplatform> == whatever mips platform you're using, e.g. malta4kc),
> then put proc entries for whatevery you're interested in in there. For
> example, I'd do battery like this:
> 
>       /proc/malta4kc/battery/{info,status}

But, doing like this you break userland compatibility... I'd like use
already written code for battery management, not write new one. :)

> So that if you cat the info entry, you'd get the make, model, capacity,
> etc. If you cat the state entry, you'll get remaining charge, charging
> state, discharge rate, etc. Anyway, that's good enough to start with and
> if later you want to make it more generic, you can get more opinions on
> where it should live in the filesystem.

I see. However I think is better implement «standard» files like:

   /proc/acpi/battery/BATT/{alarm, info, state}

> Then, I'd go look at some driver modules that manage /proc entries (like
> the acpi stuff). To start with I'd put a skeleton in place that
> responded with fixed values, then write up some underlying routines to
> actually grab stuff from the battery in response to a read from
> the /proc entry.
> 
> What platform are you doing this for?

A custum board based on Alchemy Au1100.

However I've already ported the file «arch/arm/kernel/apm.c» for non
i386 architectures and it seems working good. :) Even if it implements
APM features.

Now I'll do some tests with userland code (GPE) and after that I'll
consider if I have to start with ACPI also.

Thanks a lot for your suggestion! Hope to send you a patch as soon as
possible.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@linux.it
Linux Device Driver                             giometti@enneenne.com
Embedded Systems                     home page: giometti.enneenne.com
UNIX programming                     phone:     +39 349 2432127

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>