From: Rodolfo Giometti <giometti@linux.it>
To: Clark Williams <williams@redhat.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Battery status
Date: Sat, 23 Jul 2005 14:17:00 +0200 [thread overview]
Message-ID: <20050723121700.GK21044@enneenne.com> (raw)
In-Reply-To: <1122059285.10743.30.camel@riff>
[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]
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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-07-23 12:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 14:22 Battery status Rodolfo Giometti
2005-07-22 14:53 ` Clark Williams
2005-07-22 15:14 ` Rodolfo Giometti
2005-07-22 15:25 ` Clark Williams
2005-07-22 15:34 ` Rodolfo Giometti
2005-07-22 19:08 ` Clark Williams
2005-07-23 12:17 ` Rodolfo Giometti [this message]
2005-07-22 19:17 ` Ralf Baechle
2005-07-22 21:10 ` Clark Williams
2005-07-22 21:23 ` Ralf Baechle
2005-07-22 22:07 ` Clark Williams
2005-07-22 22:16 ` Ralf Baechle
2005-07-22 23:14 ` Alan Cox
2005-07-25 12:00 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050723121700.GK21044@enneenne.com \
--to=giometti@linux.it \
--cc=linux-mips@linux-mips.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox