From: Jeremy Fitzhardinge <hidden> Date: 2011-12-09 22:43:45
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
--
1.7.7.3
From: Jeremy Fitzhardinge <hidden> Date: 2011-12-09 22:43:35
The Wacom and Wiimote HID drivers register power supplies for themselves
to indicate their battery levels. Make those power supplies device scope.
Signed-off-by: Jeremy Fitzhardinge <redacted>
Cc: Jiri Kosina <redacted>
---
drivers/hid/hid-wacom.c | 12 ++++++++++--
drivers/hid/hid-wiimote.c | 8 +++++++-
2 files changed, 17 insertions(+), 3 deletions(-)
@@ -136,7 +136,8 @@ static __u16 wiiproto_keymap[] = {};staticenumpower_supply_propertywiimote_battery_props[]={-POWER_SUPPLY_PROP_CAPACITY+POWER_SUPPLY_PROP_CAPACITY,+POWER_SUPPLY_PROP_SCOPE,};/* requires the state.lock spinlock to be held */
@@ -468,6 +469,11 @@ static int wiimote_battery_get_property(struct power_supply *psy,intret=0,state;unsignedlongflags;+if(psp==POWER_SUPPLY_PROP_SCOPE){+val->intval=POWER_SUPPLY_SCOPE_DEVICE;+return0;+}+ret=wiimote_cmd_acquire(wdata);if(ret)returnret;
From: Jeremy Fitzhardinge <hidden> Date: 2011-12-09 22:43:38
This adds a "scope" attribute to a power_supply, which indicates how
much of the system it powers. It appears in sysfs as "scope" or in
the uevent file as POWER_SUPPLY_SCOPE=. There are presently three
possible values:
Unknown - unknown power topology
System - the power supply powers the whole system
Device - it powers a specific device, or tree of devices
A power supply which doesn't have a "scope" attribute should be assumed to
have "System" scope.
In general, usermode should assume that loss of all System-scoped power
supplies will power off the whole system, but any single one is sufficient
to power the system.
Signed-off-by: Jeremy Fitzhardinge <redacted>
Cc: Richard Hughes <redacted>
---
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
From: Jeremy Fitzhardinge <hidden> Date: 2011-12-09 22:43:42
Make the relationship between the Wiimote and Wacom self-powered HID
devices and their power supply explicit by adding a "powers" link.
Signed-off-by: Jeremy Fitzhardinge <redacted>
Cc: Jiri Kosina <redacted>
---
drivers/hid/hid-wacom.c | 4 ++++
drivers/hid/hid-wiimote.c | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
From: Jeremy Fitzhardinge <hidden> Date: 2011-12-09 22:44:23
If a power supply has a scope of "Device", then allow the power supply
to indicate what device it actually powers. This is represented in the
power supply's sysfs directory as a symlink named "powers", which points to
the sysfs directory of the powered device.
If the device has children, then the sub-devices are also powered by
the same power supply.
Signed-off-by: Jeremy Fitzhardinge <redacted>
Cc: Richard Hughes <redacted>
---
drivers/power/power_supply_core.c | 7 +++++++
include/linux/power_supply.h | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
Anton, in case you are going to take this patchset, I think it makes sense
to take it through your tree. In that case, please add
Signed-off-by: Jiri Kosina [off-list ref]
to the two patches touching drivers/hid/. Thanks,
--
Jiri Kosina
SUSE Labs
From: Jeremy Fitzhardinge <hidden> Date: 2011-12-19 06:26:49
Ping?
On 12/09/2011 02:43 PM, Jeremy Fitzhardinge wrote:
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
Anton, if you are not going to take this patchset for whatever reason, but
are fine with the changes, feel free to just provide Ack for the patches
touching drivers/power, and I'll take them through hid tree.
Thanks.
On 12/09/2011 02:43 PM, Jeremy Fitzhardinge wrote:
quoted
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
Anton, if you are not going to take this patchset for whatever reason, but
are fine with the changes, feel free to just provide Ack for the patches
touching drivers/power, and I'll take them through hid tree.
Anton, hello?
quoted
On 12/09/2011 02:43 PM, Jeremy Fitzhardinge wrote:
quoted
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
From: Anton Vorontsov <hidden> Date: 2012-01-04 05:11:47
On Fri, Dec 09, 2011 at 02:43:15PM -0800, Jeremy Fitzhardinge wrote:
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
Pulled into battery-2.6.git, thank you!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
This series adds a "scope" attribute to power supplies, to indicate
whether it powers the whole system ("System") or just some subset of
the devices ("Device"). This allows upowerd to distinguish between
system-wide power supplies and self-powered devices such as cordless
mice.
This series also adds a "powers" link to power supplies, so that if
they're scope=Device, they can specifically indicate which device
tree they power.
Updates since last post:
- Add more complete documentation to scope and "powers" links
- Remove unnecessary scopes on System power supplies
- Make HID battery supplies Device, and add "powers" pointers
for them.
This can also be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git power-supply-scope
Jeremy Fitzhardinge (4):
power_supply: add SCOPE attribute to power supplies
power_supply: allow a power supply to explicitly point to powered
device
power_supply: add scope properties to some self-powered HID devices
power_supply: add "powers" links to self-powered HID devices
drivers/hid/hid-wacom.c | 16 ++++++++++++++--
drivers/hid/hid-wiimote.c | 10 +++++++++-
drivers/power/power_supply_core.c | 7 +++++++
drivers/power/power_supply_sysfs.c | 6 ++++++
include/linux/power_supply.h | 8 ++++++++
5 files changed, 44 insertions(+), 3 deletions(-)
Pulled into battery-2.6.git, thank you!
Thanks. Looking at the tree ... in case you are going to rebase the
branch, please add
Signed-off-by: Jiri Kosina [off-list ref]
or at least
Acked-by: Jiri Kosina [off-list ref]
to patches touching drivers/hid. Thanks,
--
Jiri Kosina
SUSE Labs
From: Anton Vorontsov <hidden> Date: 2012-01-04 12:57:18
On Wed, Jan 04, 2012 at 01:48:40PM +0100, Jiri Kosina wrote:
[...]
quoted
Pulled into battery-2.6.git, thank you!
Thanks. Looking at the tree ... in case you are going to rebase the
branch, please add
Signed-off-by: Jiri Kosina [off-list ref]
or at least
Acked-by: Jiri Kosina [off-list ref]
to patches touching drivers/hid. Thanks,
Yeah, since I just pulled that tree, I didn't have a chance to insert
your Ack. But if I ever rebase the tree, I'll add it.
In any case, I'll mention your ack when I send a pull request to
Linus.
Thanks!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com