aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-02-10 15:24:00 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:34 -0400
commitdbe0dbb7dfda52140d3469d7035a08dfa874fca2 (patch)
treefca93c36c284a789f607e559f3f9e8d6df1dff9e
parentc4504a7eb9c4c491e6f31b28169dd49e9bacc8ec (diff)
USB: defines for USB "Link Power Management" (LPM) ECN
There's a new PM-related change notice for the USB 2.0 specification called "Link Power Management" (LPM). It defines a new "L1 Suspend" state which resembles the current (L2) suspend state, except that it can be entered and exited much more quickly. It should thus be more useful for runtime PM, even though it doesn't mandate reduced power draw from VBUS. This patch provides the relevant #defines for usbcore. Actually implementing these mechanisms requires host silicon that can generate new USB packets, plus hubs handling some new requests and peripherals which understand the new packets. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/hcd.h2
-rw-r--r--drivers/usb/core/hub.h8
-rw-r--r--include/linux/usb/ch9.h14
3 files changed, 18 insertions, 6 deletions
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 2d1c3d5e47b8..2c086b8460b1 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -28,7 +28,7 @@
28/* 28/*
29 * USB Packet IDs (PIDs) 29 * USB Packet IDs (PIDs)
30 */ 30 */
31#define USB_PID_UNDEF_0 0xf0 31#define USB_PID_EXT 0xf0 /* USB 2.0 LPM ECN */
32#define USB_PID_OUT 0xe1 32#define USB_PID_OUT 0xe1
33#define USB_PID_ACK 0xd2 33#define USB_PID_ACK 0xd2
34#define USB_PID_DATA0 0xc3 34#define USB_PID_DATA0 0xc3
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 1551aed65e05..d672cd81a3e4 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -41,9 +41,10 @@
41 */ 41 */
42#define USB_PORT_FEAT_CONNECTION 0 42#define USB_PORT_FEAT_CONNECTION 0
43#define USB_PORT_FEAT_ENABLE 1 43#define USB_PORT_FEAT_ENABLE 1
44#define USB_PORT_FEAT_SUSPEND 2 44#define USB_PORT_FEAT_SUSPEND 2 /* L2 suspend */
45#define USB_PORT_FEAT_OVER_CURRENT 3 45#define USB_PORT_FEAT_OVER_CURRENT 3
46#define USB_PORT_FEAT_RESET 4 46#define USB_PORT_FEAT_RESET 4
47#define USB_PORT_FEAT_L1 5 /* L1 suspend */
47#define USB_PORT_FEAT_POWER 8 48#define USB_PORT_FEAT_POWER 8
48#define USB_PORT_FEAT_LOWSPEED 9 49#define USB_PORT_FEAT_LOWSPEED 9
49#define USB_PORT_FEAT_HIGHSPEED 10 50#define USB_PORT_FEAT_HIGHSPEED 10
@@ -54,6 +55,7 @@
54#define USB_PORT_FEAT_C_RESET 20 55#define USB_PORT_FEAT_C_RESET 20
55#define USB_PORT_FEAT_TEST 21 56#define USB_PORT_FEAT_TEST 21
56#define USB_PORT_FEAT_INDICATOR 22 57#define USB_PORT_FEAT_INDICATOR 22
58#define USB_PORT_FEAT_C_PORT_L1 23
57 59
58/* 60/*
59 * Hub Status and Hub Change results 61 * Hub Status and Hub Change results
@@ -73,7 +75,8 @@ struct usb_port_status {
73#define USB_PORT_STAT_SUSPEND 0x0004 75#define USB_PORT_STAT_SUSPEND 0x0004
74#define USB_PORT_STAT_OVERCURRENT 0x0008 76#define USB_PORT_STAT_OVERCURRENT 0x0008
75#define USB_PORT_STAT_RESET 0x0010 77#define USB_PORT_STAT_RESET 0x0010
76/* bits 5 to 7 are reserved */ 78#define USB_PORT_STAT_L1 0x0020
79/* bits 6 to 7 are reserved */
77#define USB_PORT_STAT_POWER 0x0100 80#define USB_PORT_STAT_POWER 0x0100
78#define USB_PORT_STAT_LOW_SPEED 0x0200 81#define USB_PORT_STAT_LOW_SPEED 0x0200
79#define USB_PORT_STAT_HIGH_SPEED 0x0400 82#define USB_PORT_STAT_HIGH_SPEED 0x0400
@@ -91,6 +94,7 @@ struct usb_port_status {
91#define USB_PORT_STAT_C_SUSPEND 0x0004 94#define USB_PORT_STAT_C_SUSPEND 0x0004
92#define USB_PORT_STAT_C_OVERCURRENT 0x0008 95#define USB_PORT_STAT_C_OVERCURRENT 0x0008
93#define USB_PORT_STAT_C_RESET 0x0010 96#define USB_PORT_STAT_C_RESET 0x0010
97#define USB_PORT_STAT_C_L1 0x0020
94 98
95/* 99/*
96 * wHubCharacteristics (masks) 100 * wHubCharacteristics (masks)
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 7e1da17ca7ce..61fcbc2b97da 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -66,8 +66,8 @@
66#define USB_RECIP_ENDPOINT 0x02 66#define USB_RECIP_ENDPOINT 0x02
67#define USB_RECIP_OTHER 0x03 67#define USB_RECIP_OTHER 0x03
68/* From Wireless USB 1.0 */ 68/* From Wireless USB 1.0 */
69#define USB_RECIP_PORT 0x04 69#define USB_RECIP_PORT 0x04
70#define USB_RECIP_RPIPE 0x05 70#define USB_RECIP_RPIPE 0x05
71 71
72/* 72/*
73 * Standard requests, for the bRequest field of a SETUP packet. 73 * Standard requests, for the bRequest field of a SETUP packet.
@@ -102,10 +102,16 @@
102#define USB_REQ_LOOPBACK_DATA_READ 0x16 102#define USB_REQ_LOOPBACK_DATA_READ 0x16
103#define USB_REQ_SET_INTERFACE_DS 0x17 103#define USB_REQ_SET_INTERFACE_DS 0x17
104 104
105/* The Link Power Mangement (LPM) ECN defines USB_REQ_TEST_AND_SET command,
106 * used by hubs to put ports into a new L1 suspend state, except that it
107 * forgot to define its number ...
108 */
109
105/* 110/*
106 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and 111 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
107 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there 112 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
108 * are at most sixteen features of each type.) 113 * are at most sixteen features of each type.) Hubs may also support a
114 * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
109 */ 115 */
110#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ 116#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
111#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ 117#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
@@ -575,6 +581,8 @@ enum usb_device_state {
575 /* NOTE: there are actually four different SUSPENDED 581 /* NOTE: there are actually four different SUSPENDED
576 * states, returning to POWERED, DEFAULT, ADDRESS, or 582 * states, returning to POWERED, DEFAULT, ADDRESS, or
577 * CONFIGURED respectively when SOF tokens flow again. 583 * CONFIGURED respectively when SOF tokens flow again.
584 * At this level there's no difference between L1 and L2
585 * suspend states. (L2 being original USB 1.1 suspend.)
578 */ 586 */
579}; 587};
580 588