diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 23:11:30 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 23:11:30 +0200 |
commit | f58c41cc0427115e3d750ec090020892acf0fb9c (patch) | |
tree | 511fa5c1dd6bb2db1998acbee0bd16d75ae6e6c9 /drivers/power/power_supply_core.c | |
parent | ee7f9d7c7c1d0fde6441be495f6f14eae43af2e0 (diff) | |
parent | e0d1f09e311fafa33b4bfd942c852671ce25ae58 (diff) | |
download | linux-f58c41cc0427115e3d750ec090020892acf0fb9c.tar.bz2 |
Merge branch 'acpi-battery'
* acpi-battery:
ACPI / battery: wakeup the system only when necessary
power_supply: allow power supply devices registered w/o wakeup source
ACPI / battery: introduce support for POWER_SUPPLY_PROP_CAPACITY_LEVEL
ACPI / battery: Accelerate battery resume callback
Diffstat (limited to 'drivers/power/power_supply_core.c')
-rw-r--r-- | drivers/power/power_supply_core.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 26606641fe44..5a5a24e7d43c 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -537,7 +537,7 @@ static void psy_unregister_cooler(struct power_supply *psy) } #endif -int power_supply_register(struct device *parent, struct power_supply *psy) +int __power_supply_register(struct device *parent, struct power_supply *psy, bool ws) { struct device *dev; int rc; @@ -568,7 +568,7 @@ int power_supply_register(struct device *parent, struct power_supply *psy) } spin_lock_init(&psy->changed_lock); - rc = device_init_wakeup(dev, true); + rc = device_init_wakeup(dev, ws); if (rc) goto wakeup_init_failed; @@ -606,8 +606,19 @@ dev_set_name_failed: success: return rc; } + +int power_supply_register(struct device *parent, struct power_supply *psy) +{ + return __power_supply_register(parent, psy, true); +} EXPORT_SYMBOL_GPL(power_supply_register); +int power_supply_register_no_ws(struct device *parent, struct power_supply *psy) +{ + return __power_supply_register(parent, psy, false); +} +EXPORT_SYMBOL_GPL(power_supply_register_no_ws); + void power_supply_unregister(struct power_supply *psy) { cancel_work_sync(&psy->changed_work); |