From: Linus Torvalds Date: Thu, 12 Jan 2012 02:53:05 +0000 (-0800) Subject: Merge git://git.infradead.org/battery-2.6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b24ca57e7625bc304e77bc429693ad32a691eb16;p=linux-beck.git Merge git://git.infradead.org/battery-2.6 * git://git.infradead.org/battery-2.6: (68 commits) power_supply: Mark da9052 driver as broken power_supply: Drop usage of nowarn variant of sysfs_create_link() s3c_adc_battery: Average over more than one adc sample power_supply: Add DA9052 battery driver isp1704_charger: Fix missing check jz4740-battery: Fix signedness bug power_supply: Assume mains power by default sbs-battery: Fix devicetree match table ARM: rx51: Add bq27200 i2c board info sbs-battery: Change power supply name devicetree-bindings: Propagate bq20z75->sbs rename to dt bindings devicetree-bindings: Add vendor entry for Smart Battery Systems sbs-battery: Rename internals to new name bq20z75: Rename to sbs-battery wm97xx_battery: Use DEFINE_MUTEX() for work_lock max8997_charger: Remove duplicate module.h lp8727_charger: Some minor fixes for the header lp8727_charger: Add header file power_supply: Convert drivers/power/* to use module_platform_driver() power_supply: Add "unknown" in power supply type ... --- b24ca57e7625bc304e77bc429693ad32a691eb16 diff --cc Documentation/devicetree/bindings/vendor-prefixes.txt index 18626965159e,9f7bef601e0e..6fdb450b05fb --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@@ -34,11 -32,10 +34,12 @@@ powervr Imagination Technologie qcom Qualcomm, Inc. ramtron Ramtron International samsung Samsung Semiconductor + sbs Smart Battery System schindler Schindler +sil Silicon Image simtek sirf SiRF Technology, Inc. +st STMicroelectronics stericsson ST-Ericsson ti Texas Instruments xlnx Xilinx diff --cc drivers/hid/hid-wiimote-core.c index 61881b35c670,fc0b4db5dab3..fc253b472f9d --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c @@@ -52,9 -136,56 +52,10 @@@ static __u16 wiiproto_keymap[] = }; static enum power_supply_property wiimote_battery_props[] = { - POWER_SUPPLY_PROP_CAPACITY + POWER_SUPPLY_PROP_CAPACITY, + POWER_SUPPLY_PROP_SCOPE, }; -/* requires the state.lock spinlock to be held */ -static inline bool wiimote_cmd_pending(struct wiimote_data *wdata, int cmd, - __u32 opt) -{ - return wdata->state.cmd == cmd && wdata->state.opt == opt; -} - -/* requires the state.lock spinlock to be held */ -static inline void wiimote_cmd_complete(struct wiimote_data *wdata) -{ - wdata->state.cmd = WIIPROTO_REQ_NULL; - complete(&wdata->state.ready); -} - -static inline int wiimote_cmd_acquire(struct wiimote_data *wdata) -{ - return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0; -} - -/* requires the state.lock spinlock to be held */ -static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd, - __u32 opt) -{ - INIT_COMPLETION(wdata->state.ready); - wdata->state.cmd = cmd; - wdata->state.opt = opt; -} - -static inline void wiimote_cmd_release(struct wiimote_data *wdata) -{ - mutex_unlock(&wdata->state.sync); -} - -static inline int wiimote_cmd_wait(struct wiimote_data *wdata) -{ - int ret; - - ret = wait_for_completion_interruptible_timeout(&wdata->state.ready, HZ); - if (ret < 0) - return -ERESTARTSYS; - else if (ret == 0) - return -EIO; - else - return 0; -} - static ssize_t wiimote_hid_send(struct hid_device *hdev, __u8 *buffer, size_t count) {