[PATCH 2/3] HID: usbhid: enable autosuspend for devices whose ...

2017-06-08 Thread Yueyao Zhu
From: Yueyao Zhu usage pages only points to CONSUMER. This allows autosuspend to be enabled and thus power saved on CONSUMER hid devices. Yet hid devices use other usage pages are not affected, e.g. keyboard, mouse. Signed-off-by: Yueyao Zhu --- drivers/hid/usbhid/hid-core.c | 37

[PATCH 0/3] USB: add API for interface driver to vote for autosuspend

2017-06-08 Thread Yueyao Zhu
From: Yueyao Zhu Currently, if a USB driver would like to enable autosuspend on the USB device, usb_enable_autosuspend() seems to be the only option. However, this acts on the device level, and other interfaces might not desire to autosuspend the USB device. For example, for the usb digital

[PATCH 1/3] USB: add API for interface driver to vote for autosuspend

2017-06-08 Thread Yueyao Zhu
From: Yueyao Zhu An interface driver can allow/disallow autosuspend power control for an interface, and if all the interfaces of the active configuration are allowed for autosuspend, autosuspend should be enabled on the usb device. Signed-off-by: Yueyao Zhu --- drivers/usb/core/driver.c | 55

[PATCH 3/3] sound: usb: allow interfaces that the driver claims to autosuspend

2017-06-08 Thread Yueyao Zhu
From: Yueyao Zhu Instead of calling usb_enable_autosuspend() to change the configuration of a USB device as an interface driver, enable autosuspend for every interfaces that the driver claims. Signed-off-by: Yueyao Zhu --- sound/usb/card.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH] staging: typec: fusb302: Fix chip->vbus_present init value

2017-05-04 Thread Yueyao Zhu
FUSB_REG_STATUS0 & FUSB_REG_STATUS0_VBUSOK = 0x40 & 0x80 is always zero. Fix the code to what it is intended to be: check the VBUSOK bit of the value read from address FUSB_REG_STATUS0. Reported-by: Dan Carpenter Cc: Guenter Roeck Signed-off-by: Yueyao Zhu --- drivers/staging/typec