Re: Battery status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx
Linux Device Driver                             giometti@xxxxxxxxxxxx
Embedded Systems                     home page: giometti.enneenne.com
UNIX programming                     phone:     +39 349 2432127

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux