Re: Battery status

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

 



On Fri, 2005-07-22 at 17:14 +0200, Rodolfo Giometti wrote:
> On Fri, Jul 22, 2005 at 09:53:56AM -0500, Clark Williams wrote:
> > You might want to look at how acpi is presented in the /proc interface.
> > You could hook your battery status routines into the acpi entries:
> > 
> > 	/proc/acpi/battery/BAT0/{alarm,info,status} 
> 
> I see... but in «drivers/acpi/Kconfig» I notice that this driver
> depends on «IA64 || X86». Do you think I can activate it even for MIPS
> arch? :-o

/me goes and actually *looks* at the acpi driver(s)

I would recommend writing a completely separate driver that just
provides the hook(s) to get to battery and any other info you want to
provide. I did it on another platform (can't seem to find that code
though) mainly to use the /proc/acpi/event interface and receive button
presses and things like that. Something like a fake-acpi.c that various
platform folks could use to translate their events into the acpi
interface. 

That's kinda hokey now that I actually wrote it down and looked at it.
Maybe what we need to do is put together a framework somewhat like the
way acpi presents state information, but not called acpi (wouldn't want
someone thinking that we'd ported the acpi interpreter to MIPS :). I'm
not even sure if it should go into /proc or /sys. 

I just liked the fact that the event interface and the status interfaces
were presented in somewhat logical fashion to user space, such that a
shell script could be used to gather information or manipulate the state
(e.g. 'echo 3 >/proc/acpi/sleep' to suspend to RAM). 

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
driver that presents a /proc interface to get to battery information. 

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