Lower power consumption on suspend.

This commit is contained in:
NIIBE Yutaka
2017-11-15 10:59:55 +09:00
parent e85527d302
commit f4b36b7503
4 changed files with 13 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2017-11-15 NIIBE Yutaka <gniibe@fsij.org>
* src/usb-ccid.c (usb_event_handle): Allow sleep on suspend.
* src/usb_ctrl.c (usb_device_reset): Fix device state.
2017-11-14 NIIBE Yutaka <gniibe@fsij.org>
* src/usb-ccid.c (ccid_usb_reset): Remove

Submodule chopstx updated: 5ac8a1f251...bbe09de209

View File

@@ -1648,10 +1648,12 @@ usb_event_handle (struct usb_dev *dev)
break;
case USB_EVENT_DEVICE_SUSPEND:
chopstx_conf_idle (1);
bDeviceState |= USB_DEVICE_STATE_SUSPEND;
break;
case USB_EVENT_DEVICE_WAKEUP:
chopstx_conf_idle (0);
bDeviceState &= ~USB_DEVICE_STATE_SUSPEND;
break;
@@ -1731,8 +1733,9 @@ ccid_thread (void *arg)
/* RESET handling:
* (1) After DEVICE_RESET, it needs to re-start out of the loop.
* (2) After SET_INTERFACE, the endpoint is reset to RX_NAK.
* It needs to prepare receive again.
* (2) After SET_CONFIGURATION or SET_INTERFACE, the
* endpoint is reset to RX_NAK. It needs to prepare
* receive again.
*/
if (c->application)
{

View File

@@ -218,7 +218,7 @@ usb_device_reset (struct usb_dev *dev)
for (i = 0; i < NUM_INTERFACES; i++)
gnuk_setup_endpoints_for_interface (dev, i, 1);
bDeviceState = USB_DEVICE_STATE_ATTACHED;
bDeviceState = USB_DEVICE_STATE_DEFAULT;
}
#define USB_CCID_REQ_ABORT 0x01