Patch to hal-spec : 1/6-pmu-acpi

Sjoerd Simons sjoerd at luon.net
Thu Jan 13 13:58:22 PST 2005


On Thu, Jan 13, 2005 at 09:33:56PM +0000, Richard Hughes wrote:
> On Thu, 13 Jan 2005 20:50:39 +0100, Sjoerd Simons wrote:
> 
> > On Thu, Jan 13, 2005 at 07:11:27PM +0000, Richard Hughes wrote:
> >> On Thu, 13 Jan 2005 19:17:49 +0100, Sjoerd Simons wrote:
> >> 
> >> > On Wed, Jan 12, 2005 at 07:07:07PM -0500, David Zeuthen wrote:
> >> >> 
> >> >> OK, so here I assume that all device objects with system.*
> >> >> properties will also have either acpi.* or pmu.* properties,
> >> >> right?
> >> >> 
> >> >> Should also have pmu.device that gives the device file, e.g. /dev/pmu
> >> >> (remember, udev may call it something else!).
> >> > 
> >> > Does this mean that every device with capability pmu copies this
> >> > information?  Wouldn't it be better to have one pmu object with version and
> >> > device node info and let the others refer to it ?
> >> 
> >> What about just adding to the linux namespace (and set by the root node): 
> >> 
> >> key: linux.pmu_device (optional)
> >> desc: The PMU character device that HAL can access. PMU is the Power
> >> Management Unit found in various PPC based systems.
> >> 
> >> Then acpi_button.c can use the system.button namespace, and then only with
> >> ACPI, it uses the acpi. properties. (namely acpi.proc_path which is bound
> >> to each node)
> >> Does PMU have any node-specific data? I don't know anything about PMU,
> >> other than PMUD is used to query it. 
> > 
> > Not really it's pretty simple.. Most stuff it knows is exported through
> > /proc, for some things you need to query/write to it though..
> > 
> 
> proc where? Because if it uses a different proc entry for each (or some)
> device, it's going to need the PMU version of *proc_path*.
> 
> Have you got a how-to on the PMU proc structure? or can you do me a tree
> /proc/*

$ tree /proc/pmu
  /proc/pmu
  |-- battery_0
  |-- info
  |-- interrupts
  `-- options

$ cat battery_0
flags      : 00000011
charge     : 3328
max_charge : 3329
current    : 0
voltage    : 12484
time rem.  : 0

$ cat info
PMU driver version     : 2
PMU firmware version   : 0c
AC Power               : 1
Battery count          : 1

Interrupts is just some statistics and options can be used to indicate whether
or not you want it to wake up from suspend when the lid opens.. And some other
option of which i don't know the meaning :)

So the pretty standard stuff is available in /proc. To query/change the 
backlight level of the builtin screen and to put the machine in suspend you 
need to use /dev/pmu directly. 

Just for completeness for the lid you need /dev/adb (adb bus), for the fan
speed and temperatures some files in /sys (don't know if the location is
standard for all models) and for the light sensor you talk to an i2c device
(/dev/i2c-4 on my system, but you can detect which one you need)

  Sjoerd
-- 
Don't make a big deal out of everything; just deal with everything.
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list