diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb.h | 5 | ||||
-rw-r--r-- | include/linux/usb/composite.h | 6 | ||||
-rw-r--r-- | include/linux/usb/ehci_def.h | 23 | ||||
-rw-r--r-- | include/linux/usb/functionfs.h | 6 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 31 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 11 | ||||
-rw-r--r-- | include/linux/usb/quirks.h | 4 | ||||
-rw-r--r-- | include/linux/usb/ulpi.h | 40 |
8 files changed, 107 insertions, 19 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index d5922a877994..35fe6ab222bb 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -127,6 +127,8 @@ enum usb_interface_condition { | |||
127 | * queued reset so that usb_cancel_queued_reset() doesn't try to | 127 | * queued reset so that usb_cancel_queued_reset() doesn't try to |
128 | * remove from the workqueue when running inside the worker | 128 | * remove from the workqueue when running inside the worker |
129 | * thread. See __usb_queue_reset_device(). | 129 | * thread. See __usb_queue_reset_device(). |
130 | * @resetting_device: USB core reset the device, so use alt setting 0 as | ||
131 | * current; needs bandwidth alloc after reset. | ||
130 | * | 132 | * |
131 | * USB device drivers attach to interfaces on a physical device. Each | 133 | * USB device drivers attach to interfaces on a physical device. Each |
132 | * interface encapsulates a single high level function, such as feeding | 134 | * interface encapsulates a single high level function, such as feeding |
@@ -843,7 +845,7 @@ struct usb_driver { | |||
843 | 845 | ||
844 | void (*disconnect) (struct usb_interface *intf); | 846 | void (*disconnect) (struct usb_interface *intf); |
845 | 847 | ||
846 | int (*ioctl) (struct usb_interface *intf, unsigned int code, | 848 | int (*unlocked_ioctl) (struct usb_interface *intf, unsigned int code, |
847 | void *buf); | 849 | void *buf); |
848 | 850 | ||
849 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 851 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
@@ -1015,6 +1017,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1015 | * is a different endpoint (and pipe) from "out" endpoint two. | 1017 | * is a different endpoint (and pipe) from "out" endpoint two. |
1016 | * The current configuration controls the existence, type, and | 1018 | * The current configuration controls the existence, type, and |
1017 | * maximum packet size of any given endpoint. | 1019 | * maximum packet size of any given endpoint. |
1020 | * @stream_id: the endpoint's stream ID for bulk streams | ||
1018 | * @dev: Identifies the USB device to perform the request. | 1021 | * @dev: Identifies the USB device to perform the request. |
1019 | * @status: This is read in non-iso completion functions to get the | 1022 | * @status: This is read in non-iso completion functions to get the |
1020 | * status of the particular request. ISO requests only use it | 1023 | * status of the particular request. ISO requests only use it |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 139353efad34..890bc1472190 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -276,6 +276,8 @@ struct usb_composite_driver { | |||
276 | int (*bind)(struct usb_composite_dev *); | 276 | int (*bind)(struct usb_composite_dev *); |
277 | int (*unbind)(struct usb_composite_dev *); | 277 | int (*unbind)(struct usb_composite_dev *); |
278 | 278 | ||
279 | void (*disconnect)(struct usb_composite_dev *); | ||
280 | |||
279 | /* global suspend hooks */ | 281 | /* global suspend hooks */ |
280 | void (*suspend)(struct usb_composite_dev *); | 282 | void (*suspend)(struct usb_composite_dev *); |
281 | void (*resume)(struct usb_composite_dev *); | 283 | void (*resume)(struct usb_composite_dev *); |
@@ -342,6 +344,10 @@ struct usb_composite_dev { | |||
342 | }; | 344 | }; |
343 | 345 | ||
344 | extern int usb_string_id(struct usb_composite_dev *c); | 346 | extern int usb_string_id(struct usb_composite_dev *c); |
347 | extern int usb_string_ids_tab(struct usb_composite_dev *c, | ||
348 | struct usb_string *str); | ||
349 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | ||
350 | |||
345 | 351 | ||
346 | /* messaging utils */ | 352 | /* messaging utils */ |
347 | #define DBG(d, fmt, args...) \ | 353 | #define DBG(d, fmt, args...) \ |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 80287af2a738..2e262cb15425 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -39,6 +39,12 @@ struct ehci_caps { | |||
39 | #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ | 39 | #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ |
40 | 40 | ||
41 | u32 hcc_params; /* HCCPARAMS - offset 0x8 */ | 41 | u32 hcc_params; /* HCCPARAMS - offset 0x8 */ |
42 | /* EHCI 1.1 addendum */ | ||
43 | #define HCC_32FRAME_PERIODIC_LIST(p) ((p)&(1 << 19)) | ||
44 | #define HCC_PER_PORT_CHANGE_EVENT(p) ((p)&(1 << 18)) | ||
45 | #define HCC_LPM(p) ((p)&(1 << 17)) | ||
46 | #define HCC_HW_PREFETCH(p) ((p)&(1 << 16)) | ||
47 | |||
42 | #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ | 48 | #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ |
43 | #define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */ | 49 | #define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */ |
44 | #define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */ | 50 | #define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */ |
@@ -54,6 +60,13 @@ struct ehci_regs { | |||
54 | 60 | ||
55 | /* USBCMD: offset 0x00 */ | 61 | /* USBCMD: offset 0x00 */ |
56 | u32 command; | 62 | u32 command; |
63 | |||
64 | /* EHCI 1.1 addendum */ | ||
65 | #define CMD_HIRD (0xf<<24) /* host initiated resume duration */ | ||
66 | #define CMD_PPCEE (1<<15) /* per port change event enable */ | ||
67 | #define CMD_FSP (1<<14) /* fully synchronized prefetch */ | ||
68 | #define CMD_ASPE (1<<13) /* async schedule prefetch enable */ | ||
69 | #define CMD_PSPE (1<<12) /* periodic schedule prefetch enable */ | ||
57 | /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ | 70 | /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ |
58 | #define CMD_PARK (1<<11) /* enable "park" on async qh */ | 71 | #define CMD_PARK (1<<11) /* enable "park" on async qh */ |
59 | #define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ | 72 | #define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ |
@@ -67,6 +80,7 @@ struct ehci_regs { | |||
67 | 80 | ||
68 | /* USBSTS: offset 0x04 */ | 81 | /* USBSTS: offset 0x04 */ |
69 | u32 status; | 82 | u32 status; |
83 | #define STS_PPCE_MASK (0xff<<16) /* Per-Port change event 1-16 */ | ||
70 | #define STS_ASS (1<<15) /* Async Schedule Status */ | 84 | #define STS_ASS (1<<15) /* Async Schedule Status */ |
71 | #define STS_PSS (1<<14) /* Periodic Schedule Status */ | 85 | #define STS_PSS (1<<14) /* Periodic Schedule Status */ |
72 | #define STS_RECL (1<<13) /* Reclamation */ | 86 | #define STS_RECL (1<<13) /* Reclamation */ |
@@ -100,6 +114,14 @@ struct ehci_regs { | |||
100 | 114 | ||
101 | /* PORTSC: offset 0x44 */ | 115 | /* PORTSC: offset 0x44 */ |
102 | u32 port_status[0]; /* up to N_PORTS */ | 116 | u32 port_status[0]; /* up to N_PORTS */ |
117 | /* EHCI 1.1 addendum */ | ||
118 | #define PORTSC_SUSPEND_STS_ACK 0 | ||
119 | #define PORTSC_SUSPEND_STS_NYET 1 | ||
120 | #define PORTSC_SUSPEND_STS_STALL 2 | ||
121 | #define PORTSC_SUSPEND_STS_ERR 3 | ||
122 | |||
123 | #define PORT_DEV_ADDR (0x7f<<25) /* device address */ | ||
124 | #define PORT_SSTS (0x3<<23) /* suspend status */ | ||
103 | /* 31:23 reserved */ | 125 | /* 31:23 reserved */ |
104 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ | 126 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ |
105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 127 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
@@ -115,6 +137,7 @@ struct ehci_regs { | |||
115 | #define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */ | 137 | #define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */ |
116 | /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ | 138 | /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ |
117 | /* 9 reserved */ | 139 | /* 9 reserved */ |
140 | #define PORT_LPM (1<<9) /* LPM transaction */ | ||
118 | #define PORT_RESET (1<<8) /* reset port */ | 141 | #define PORT_RESET (1<<8) /* reset port */ |
119 | #define PORT_SUSPEND (1<<7) /* suspend port */ | 142 | #define PORT_SUSPEND (1<<7) /* suspend port */ |
120 | #define PORT_RESUME (1<<6) /* resume it */ | 143 | #define PORT_RESUME (1<<6) /* resume it */ |
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index a34a2a043b21..6f649c13193b 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
@@ -180,9 +180,9 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | |||
180 | static void functionfs_unbind(struct ffs_data *ffs) | 180 | static void functionfs_unbind(struct ffs_data *ffs) |
181 | __attribute__((nonnull)); | 181 | __attribute__((nonnull)); |
182 | 182 | ||
183 | static int functionfs_add(struct usb_composite_dev *cdev, | 183 | static int functionfs_bind_config(struct usb_composite_dev *cdev, |
184 | struct usb_configuration *c, | 184 | struct usb_configuration *c, |
185 | struct ffs_data *ffs) | 185 | struct ffs_data *ffs) |
186 | __attribute__((warn_unused_result, nonnull)); | 186 | __attribute__((warn_unused_result, nonnull)); |
187 | 187 | ||
188 | 188 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 2e3a4ea1a3da..3b571f1ffbb3 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -89,18 +89,33 @@ struct usb_hcd { | |||
89 | */ | 89 | */ |
90 | const struct hc_driver *driver; /* hw-specific hooks */ | 90 | const struct hc_driver *driver; /* hw-specific hooks */ |
91 | 91 | ||
92 | /* Flags that need to be manipulated atomically */ | 92 | /* Flags that need to be manipulated atomically because they can |
93 | * change while the host controller is running. Always use | ||
94 | * set_bit() or clear_bit() to change their values. | ||
95 | */ | ||
93 | unsigned long flags; | 96 | unsigned long flags; |
94 | #define HCD_FLAG_HW_ACCESSIBLE 0x00000001 | 97 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ |
95 | #define HCD_FLAG_SAW_IRQ 0x00000002 | 98 | #define HCD_FLAG_SAW_IRQ 1 |
99 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ | ||
100 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ | ||
101 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ | ||
102 | |||
103 | /* The flags can be tested using these macros; they are likely to | ||
104 | * be slightly faster than test_bit(). | ||
105 | */ | ||
106 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) | ||
107 | #define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ)) | ||
108 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) | ||
109 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) | ||
110 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) | ||
96 | 111 | ||
112 | /* Flags that get set only during HCD registration or removal. */ | ||
97 | unsigned rh_registered:1;/* is root hub registered? */ | 113 | unsigned rh_registered:1;/* is root hub registered? */ |
114 | unsigned rh_pollable:1; /* may we poll the root hub? */ | ||
98 | 115 | ||
99 | /* The next flag is a stopgap, to be removed when all the HCDs | 116 | /* The next flag is a stopgap, to be removed when all the HCDs |
100 | * support the new root-hub polling mechanism. */ | 117 | * support the new root-hub polling mechanism. */ |
101 | unsigned uses_new_polling:1; | 118 | unsigned uses_new_polling:1; |
102 | unsigned poll_rh:1; /* poll for rh status? */ | ||
103 | unsigned poll_pending:1; /* status has changed? */ | ||
104 | unsigned wireless:1; /* Wireless USB HCD */ | 119 | unsigned wireless:1; /* Wireless USB HCD */ |
105 | unsigned authorized_default:1; | 120 | unsigned authorized_default:1; |
106 | unsigned has_tt:1; /* Integrated TT in root hub */ | 121 | unsigned has_tt:1; /* Integrated TT in root hub */ |
@@ -198,7 +213,7 @@ struct hc_driver { | |||
198 | * a whole, not just the root hub; they're for PCI bus glue. | 213 | * a whole, not just the root hub; they're for PCI bus glue. |
199 | */ | 214 | */ |
200 | /* called after suspending the hub, before entering D3 etc */ | 215 | /* called after suspending the hub, before entering D3 etc */ |
201 | int (*pci_suspend)(struct usb_hcd *hcd); | 216 | int (*pci_suspend)(struct usb_hcd *hcd, bool do_wakeup); |
202 | 217 | ||
203 | /* called after entering D0 (etc), before resuming the hub */ | 218 | /* called after entering D0 (etc), before resuming the hub */ |
204 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); | 219 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); |
@@ -299,6 +314,10 @@ struct hc_driver { | |||
299 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, | 314 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, |
300 | struct usb_tt *tt, gfp_t mem_flags); | 315 | struct usb_tt *tt, gfp_t mem_flags); |
301 | int (*reset_device)(struct usb_hcd *, struct usb_device *); | 316 | int (*reset_device)(struct usb_hcd *, struct usb_device *); |
317 | /* Notifies the HCD after a device is connected and its | ||
318 | * address is set | ||
319 | */ | ||
320 | int (*update_device)(struct usb_hcd *, struct usb_device *); | ||
302 | }; | 321 | }; |
303 | 322 | ||
304 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 323 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index f8302d036a76..545cba73ccaf 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -43,13 +43,6 @@ enum usb_xceiv_events { | |||
43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define USB_OTG_PULLUP_ID (1 << 0) | ||
47 | #define USB_OTG_PULLDOWN_DP (1 << 1) | ||
48 | #define USB_OTG_PULLDOWN_DM (1 << 2) | ||
49 | #define USB_OTG_EXT_VBUS_INDICATOR (1 << 3) | ||
50 | #define USB_OTG_DRV_VBUS (1 << 4) | ||
51 | #define USB_OTG_DRV_VBUS_EXT (1 << 5) | ||
52 | |||
53 | struct otg_transceiver; | 46 | struct otg_transceiver; |
54 | 47 | ||
55 | /* for transceivers connected thru an ULPI interface, the user must | 48 | /* for transceivers connected thru an ULPI interface, the user must |
@@ -146,10 +139,10 @@ static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | |||
146 | return -EINVAL; | 139 | return -EINVAL; |
147 | } | 140 | } |
148 | 141 | ||
149 | static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val) | 142 | static inline int otg_io_write(struct otg_transceiver *otg, u32 val, u32 reg) |
150 | { | 143 | { |
151 | if (otg->io_ops && otg->io_ops->write) | 144 | if (otg->io_ops && otg->io_ops->write) |
152 | return otg->io_ops->write(otg, reg, val); | 145 | return otg->io_ops->write(otg, val, reg); |
153 | 146 | ||
154 | return -EINVAL; | 147 | return -EINVAL; |
155 | } | 148 | } |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 16b7f3347545..3e93de7ecbc3 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -26,4 +26,8 @@ | |||
26 | and can't handle talking to these interfaces */ | 26 | and can't handle talking to these interfaces */ |
27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 | 27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 |
28 | 28 | ||
29 | /* device needs a pause during initialization, after we read the device | ||
30 | descriptor */ | ||
31 | #define USB_QUIRK_DELAY_INIT 0x00000040 | ||
32 | |||
29 | #endif /* __LINUX_USB_QUIRKS_H */ | 33 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 2369d07c3c87..82b1507f4735 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h | |||
@@ -11,6 +11,42 @@ | |||
11 | #ifndef __LINUX_USB_ULPI_H | 11 | #ifndef __LINUX_USB_ULPI_H |
12 | #define __LINUX_USB_ULPI_H | 12 | #define __LINUX_USB_ULPI_H |
13 | 13 | ||
14 | #include <linux/usb/otg.h> | ||
15 | /*-------------------------------------------------------------------------*/ | ||
16 | |||
17 | /* | ||
18 | * ULPI Flags | ||
19 | */ | ||
20 | #define ULPI_OTG_ID_PULLUP (1 << 0) | ||
21 | #define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1) | ||
22 | #define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2) | ||
23 | #define ULPI_OTG_DISCHRGVBUS (1 << 3) | ||
24 | #define ULPI_OTG_CHRGVBUS (1 << 4) | ||
25 | #define ULPI_OTG_DRVVBUS (1 << 5) | ||
26 | #define ULPI_OTG_DRVVBUS_EXT (1 << 6) | ||
27 | #define ULPI_OTG_EXTVBUSIND (1 << 7) | ||
28 | |||
29 | #define ULPI_IC_6PIN_SERIAL (1 << 8) | ||
30 | #define ULPI_IC_3PIN_SERIAL (1 << 9) | ||
31 | #define ULPI_IC_CARKIT (1 << 10) | ||
32 | #define ULPI_IC_CLKSUSPM (1 << 11) | ||
33 | #define ULPI_IC_AUTORESUME (1 << 12) | ||
34 | #define ULPI_IC_EXTVBUS_INDINV (1 << 13) | ||
35 | #define ULPI_IC_IND_PASSTHRU (1 << 14) | ||
36 | #define ULPI_IC_PROTECT_DIS (1 << 15) | ||
37 | |||
38 | #define ULPI_FC_HS (1 << 16) | ||
39 | #define ULPI_FC_FS (1 << 17) | ||
40 | #define ULPI_FC_LS (1 << 18) | ||
41 | #define ULPI_FC_FS4LS (1 << 19) | ||
42 | #define ULPI_FC_TERMSEL (1 << 20) | ||
43 | #define ULPI_FC_OP_NORM (1 << 21) | ||
44 | #define ULPI_FC_OP_NODRV (1 << 22) | ||
45 | #define ULPI_FC_OP_DIS_NRZI (1 << 23) | ||
46 | #define ULPI_FC_OP_NSYNC_NEOP (1 << 24) | ||
47 | #define ULPI_FC_RST (1 << 25) | ||
48 | #define ULPI_FC_SUSPM (1 << 26) | ||
49 | |||
14 | /*-------------------------------------------------------------------------*/ | 50 | /*-------------------------------------------------------------------------*/ |
15 | 51 | ||
16 | /* | 52 | /* |
@@ -58,6 +94,10 @@ | |||
58 | 94 | ||
59 | /*-------------------------------------------------------------------------*/ | 95 | /*-------------------------------------------------------------------------*/ |
60 | 96 | ||
97 | /* | ||
98 | * Register Bits | ||
99 | */ | ||
100 | |||
61 | /* Function Control */ | 101 | /* Function Control */ |
62 | #define ULPI_FUNC_CTRL_XCVRSEL (1 << 0) | 102 | #define ULPI_FUNC_CTRL_XCVRSEL (1 << 0) |
63 | #define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0) | 103 | #define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0) |