All of lore.kernel.org
 help / color / mirror / Atom feed
* Exporting struct power_supply.use_for_apm
@ 2011-06-22 14:25 Richard Hughes
  2011-06-22 15:38 ` Anton Vorontsov
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Hughes @ 2011-06-22 14:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: cbou, spyro, Bastien Nocera

Hi, if this isn't the correct mailing list please yell. I'm the author
of upower which is a userspace service that presents the power devices
in the system as a DBus interface for the session to use.

In struct power_supply there is a boolean use_for_apm which seems to
be 1 for devices actually powering the system, and 0 for devices
attached to the machine. Would this be sane to export into sysfs as
something sane?

The reason I ask, is that upower has to decide if the system as a
whole has several high level states, e.g. "low-power" or
"critically-low-power" and for that it needs to decide if the battery
backing the power supply device is critical to the system power state.
This would mean that a ACPI battery or UPS running low would mean the
system is low, but a USB mouse or a wacom tablet would not prompt the
low power warning.

This email has been triggered by a bug report :
https://bugs.freedesktop.org/show_bug.cgi?id=38569 in which the kernel
patch http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=59d2334ac9f4255f5f8f3e4e1bf41653e0bba99e;hp=4da361b69102cdffe73006771eae7504d2cb8736
added the power_supply device which confuses upower.

The alternative is to change the wacom power_supply code from
type=POWER_SUPPLY_TYPE_BATTERY to something else, e.g.
POWER_SUPPLY_TYPE_ACCESSORY which upower can easily key from. I really
don't want to blacklist "battery_wacom" as that seems like such a
hack.

Thanks for any comments,

Richard.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-22 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22 14:25 Exporting struct power_supply.use_for_apm Richard Hughes
2011-06-22 15:38 ` Anton Vorontsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.