DeviceKit-power future plans

Richard Hughes hughsient at gmail.com
Tue Aug 5 00:29:59 PDT 2008


You might have noticed [1] I've spent the last couple of days working on
DeviceKit-power. It's now more than just a bare shell, and has 80% of
the functionality of HAL. I'll spend the majority of today also working
on it, and hopefully them I can start porting gnome-power-manager to use
the new code.

Changes I have done:

* split apart some of the logic into separate GObjects and object
structs for modularity
* add the suspend and hibernate hooks in properly (just supporting
pm-utils) -- quirks still to do.
* Move a lot of the time prediction stuff in g-p-m down into DK-power
* Made it trivial to get system battery state (HAL is hard)

Changes I want to do:

* add a proper unit test suite
* add the UPS hooks for either NUT or direct access
* share some common code where it makes sense, e.g.
compute_object_path_from_basename and the sysfs stuff
* maybe add in the kernel pm_qos stuff for power saving, as it fits
quite well in the DK-power architecture.
* add helpers for stuff like CSR mice and kerboards (maybe)

The things I am most concerned about are:

 * bloating the public D-Bus interfaces
 * avoiding feature creep by adding power device topologies or support
for obsolete technologies (/proc/acpi, /dev/apm)

Hopefully in a few days time DK-power will be able to do all the stuff
HAL can do, and a little bit more. I'll post another mail when there's
more to show, but here's a nice teaser:

[hughsie at hughsie-work devicekit-power]$ devkit-power --dump
Device: /sources/BAT0
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
  vendor:               SANYO
  model:                42T4504
  serial:               6908
  power supply:         yes
  updated:              Tue Aug  5 08:23:02 2008 (34 seconds ago)
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    energy:              52.43 Wh
    energy-empty:        0 Wh
    energy-full:         52.43 Wh
    energy-full-design:  56.16 Wh
    energy-rate:         0 W
    percentage:          100%
    capacity:            100%
    technology:          lithium-ion
  statistics (charge)
    43542 seconds	57.43 (discharging)
    43572 seconds	57.74 (discharging)
    43602 seconds	58.04 (discharging)
    43632 seconds	58.39 (discharging)
  statistics (rate)
    43542 seconds	18.16 (discharging)
    43572 seconds	17.73 (discharging)
    43602 seconds	18.27 (discharging)
    43632 seconds	19.88 (discharging)
Device: /sources/AC
  native-path:          /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:01/PNP0C09:00/ACPI0003:00/power_supply/AC
  power supply:         yes
  updated:              Tue Aug  5 08:23:02 2008 (34 seconds ago)
  line-power
    online:             yes

Anyway, as usual comments/suggestions always welcome.

Richard.

[1] http://gitweb.freedesktop.org/?p=devicekit/devicekit-power.git;a=summary



More information about the devkit-devel mailing list