Re: Battery status

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

 



On Fri, 2005-07-22 at 17:34 +0200, Rodolfo Giometti wrote:
> > Gah. Sorry, you were asking for an answer and I turned this into a
> > design discussion. My opinion: if you're in a hurry, write a simple
> 
> Nonono. It's very interesting what you are saying!
> 

Ok, just remember: you asked for it! :)

> > driver that presents a /proc interface to get to battery information. 
> 
> Ok. Currently I have some time to spend on it... do you have any
> suggestions about I can start developing it in the good way? :)

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}

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.

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?

Clark

-- 
Clark Williams <williams@xxxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part


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

  Powered by Linux