diff options
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/Kbuild | 1 | ||||
| -rw-r--r-- | include/linux/usb/atmel_usba_udc.h | 1 | ||||
| -rw-r--r-- | include/linux/usb/audio.h | 120 | ||||
| -rw-r--r-- | include/linux/usb/ch9.h | 2 | ||||
| -rw-r--r-- | include/linux/usb/gadget.h | 2 | ||||
| -rw-r--r-- | include/linux/usb/musb.h | 26 | ||||
| -rw-r--r-- | include/linux/usb/otg.h | 35 | ||||
| -rw-r--r-- | include/linux/usb/quirks.h | 3 | ||||
| -rw-r--r-- | include/linux/usb/serial.h | 13 | ||||
| -rw-r--r-- | include/linux/usb/usbnet.h | 21 | ||||
| -rw-r--r-- | include/linux/usb/vstusb.h | 71 |
11 files changed, 177 insertions, 118 deletions
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index 54c446309a2a..29fd73b0bffc 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
| @@ -5,4 +5,3 @@ header-y += gadgetfs.h | |||
| 5 | header-y += midi.h | 5 | header-y += midi.h |
| 6 | header-y += g_printer.h | 6 | header-y += g_printer.h |
| 7 | header-y += tmc.h | 7 | header-y += tmc.h |
| 8 | header-y += vstusb.h | ||
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h index 6311fa2d9f82..baf41c8616e9 100644 --- a/include/linux/usb/atmel_usba_udc.h +++ b/include/linux/usb/atmel_usba_udc.h | |||
| @@ -15,6 +15,7 @@ struct usba_ep_data { | |||
| 15 | 15 | ||
| 16 | struct usba_platform_data { | 16 | struct usba_platform_data { |
| 17 | int vbus_pin; | 17 | int vbus_pin; |
| 18 | int vbus_pin_inverted; | ||
| 18 | int num_ep; | 19 | int num_ep; |
| 19 | struct usba_ep_data ep[0]; | 20 | struct usba_ep_data ep[0]; |
| 20 | }; | 21 | }; |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index eaf9dffe0a01..4d3e450e2b03 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
| 27 | 27 | ||
| 28 | #define UAC_VERSION_1 0x00 | ||
| 29 | #define UAC_VERSION_2 0x20 | ||
| 30 | |||
| 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | 31 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ |
| 29 | #define UAC_HEADER 0x01 | 32 | #define UAC_HEADER 0x01 |
| 30 | #define UAC_INPUT_TERMINAL 0x02 | 33 | #define UAC_INPUT_TERMINAL 0x02 |
| @@ -32,8 +35,17 @@ | |||
| 32 | #define UAC_MIXER_UNIT 0x04 | 35 | #define UAC_MIXER_UNIT 0x04 |
| 33 | #define UAC_SELECTOR_UNIT 0x05 | 36 | #define UAC_SELECTOR_UNIT 0x05 |
| 34 | #define UAC_FEATURE_UNIT 0x06 | 37 | #define UAC_FEATURE_UNIT 0x06 |
| 35 | #define UAC_PROCESSING_UNIT 0x07 | 38 | #define UAC_PROCESSING_UNIT_V1 0x07 |
| 36 | #define UAC_EXTENSION_UNIT 0x08 | 39 | #define UAC_EXTENSION_UNIT_V1 0x08 |
| 40 | |||
| 41 | /* UAC v2.0 types */ | ||
| 42 | #define UAC_EFFECT_UNIT 0x07 | ||
| 43 | #define UAC_PROCESSING_UNIT_V2 0x08 | ||
| 44 | #define UAC_EXTENSION_UNIT_V2 0x09 | ||
| 45 | #define UAC_CLOCK_SOURCE 0x0a | ||
| 46 | #define UAC_CLOCK_SELECTOR 0x0b | ||
| 47 | #define UAC_CLOCK_MULTIPLIER 0x0c | ||
| 48 | #define UAC_SAMPLE_RATE_CONVERTER 0x0d | ||
| 37 | 49 | ||
| 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 50 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
| 39 | #define UAC_AS_GENERAL 0x01 | 51 | #define UAC_AS_GENERAL 0x01 |
| @@ -66,6 +78,10 @@ | |||
| 66 | 78 | ||
| 67 | #define UAC_GET_STAT 0xff | 79 | #define UAC_GET_STAT 0xff |
| 68 | 80 | ||
| 81 | /* Audio class v2.0 handles all the parameter calls differently */ | ||
| 82 | #define UAC2_CS_CUR 0x01 | ||
| 83 | #define UAC2_CS_RANGE 0x02 | ||
| 84 | |||
| 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | 85 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
| 70 | #define UAC_MS_HEADER 0x01 | 86 | #define UAC_MS_HEADER 0x01 |
| 71 | #define UAC_MIDI_IN_JACK 0x02 | 87 | #define UAC_MIDI_IN_JACK 0x02 |
| @@ -81,7 +97,7 @@ | |||
| 81 | 97 | ||
| 82 | /* Terminal Control Selectors */ | 98 | /* Terminal Control Selectors */ |
| 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 99 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
| 84 | struct uac_ac_header_descriptor { | 100 | struct uac_ac_header_descriptor_v1 { |
| 85 | __u8 bLength; /* 8 + n */ | 101 | __u8 bLength; /* 8 + n */ |
| 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 102 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | 103 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
| @@ -95,7 +111,7 @@ struct uac_ac_header_descriptor { | |||
| 95 | 111 | ||
| 96 | /* As above, but more useful for defining your own descriptors: */ | 112 | /* As above, but more useful for defining your own descriptors: */ |
| 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 113 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 98 | struct uac_ac_header_descriptor_##n { \ | 114 | struct uac_ac_header_descriptor_v1_##n { \ |
| 99 | __u8 bLength; \ | 115 | __u8 bLength; \ |
| 100 | __u8 bDescriptorType; \ | 116 | __u8 bDescriptorType; \ |
| 101 | __u8 bDescriptorSubtype; \ | 117 | __u8 bDescriptorSubtype; \ |
| @@ -130,8 +146,12 @@ struct uac_input_terminal_descriptor { | |||
| 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 146 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
| 131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 147 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 |
| 132 | 148 | ||
| 149 | /* Terminals - control selectors */ | ||
| 150 | |||
| 151 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | ||
| 152 | |||
| 133 | /* 4.3.2.2 Output Terminal Descriptor */ | 153 | /* 4.3.2.2 Output Terminal Descriptor */ |
| 134 | struct uac_output_terminal_descriptor { | 154 | struct uac_output_terminal_descriptor_v1 { |
| 135 | __u8 bLength; /* in bytes: 9 */ | 155 | __u8 bLength; /* in bytes: 9 */ |
| 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 156 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 157 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
| @@ -171,7 +191,7 @@ struct uac_feature_unit_descriptor_##ch { \ | |||
| 171 | } __attribute__ ((packed)) | 191 | } __attribute__ ((packed)) |
| 172 | 192 | ||
| 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 193 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 174 | struct uac_as_header_descriptor { | 194 | struct uac_as_header_descriptor_v1 { |
| 175 | __u8 bLength; /* in bytes: 7 */ | 195 | __u8 bLength; /* in bytes: 7 */ |
| 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 196 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 197 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
| @@ -180,6 +200,19 @@ struct uac_as_header_descriptor { | |||
| 180 | __le16 wFormatTag; /* The Audio Data Format */ | 200 | __le16 wFormatTag; /* The Audio Data Format */ |
| 181 | } __attribute__ ((packed)); | 201 | } __attribute__ ((packed)); |
| 182 | 202 | ||
| 203 | struct uac_as_header_descriptor_v2 { | ||
| 204 | __u8 bLength; | ||
| 205 | __u8 bDescriptorType; | ||
| 206 | __u8 bDescriptorSubtype; | ||
| 207 | __u8 bTerminalLink; | ||
| 208 | __u8 bmControls; | ||
| 209 | __u8 bFormatType; | ||
| 210 | __u32 bmFormats; | ||
| 211 | __u8 bNrChannels; | ||
| 212 | __u32 bmChannelConfig; | ||
| 213 | __u8 iChannelNames; | ||
| 214 | } __attribute__((packed)); | ||
| 215 | |||
| 183 | #define UAC_DT_AS_HEADER_SIZE 7 | 216 | #define UAC_DT_AS_HEADER_SIZE 7 |
| 184 | 217 | ||
| 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | 218 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
| @@ -232,11 +265,62 @@ struct uac_format_type_i_discrete_descriptor_##n { \ | |||
| 232 | 265 | ||
| 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 266 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
| 234 | 267 | ||
| 268 | struct uac_format_type_i_ext_descriptor { | ||
| 269 | __u8 bLength; | ||
| 270 | __u8 bDescriptorType; | ||
| 271 | __u8 bDescriptorSubtype; | ||
| 272 | __u8 bFormatType; | ||
| 273 | __u8 bSubslotSize; | ||
| 274 | __u8 bBitResolution; | ||
| 275 | __u8 bHeaderLength; | ||
| 276 | __u8 bControlSize; | ||
| 277 | __u8 bSideBandProtocol; | ||
| 278 | } __attribute__((packed)); | ||
| 279 | |||
| 280 | |||
| 281 | /* Formats - Audio Data Format Type I Codes */ | ||
| 282 | |||
| 283 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | ||
| 284 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 | ||
| 285 | |||
| 286 | struct uac_format_type_ii_discrete_descriptor { | ||
| 287 | __u8 bLength; | ||
| 288 | __u8 bDescriptorType; | ||
| 289 | __u8 bDescriptorSubtype; | ||
| 290 | __u8 bFormatType; | ||
| 291 | __le16 wMaxBitRate; | ||
| 292 | __le16 wSamplesPerFrame; | ||
| 293 | __u8 bSamFreqType; | ||
| 294 | __u8 tSamFreq[][3]; | ||
| 295 | } __attribute__((packed)); | ||
| 296 | |||
| 297 | struct uac_format_type_ii_ext_descriptor { | ||
| 298 | __u8 bLength; | ||
| 299 | __u8 bDescriptorType; | ||
| 300 | __u8 bDescriptorSubtype; | ||
| 301 | __u8 bFormatType; | ||
| 302 | __u16 wMaxBitRate; | ||
| 303 | __u16 wSamplesPerFrame; | ||
| 304 | __u8 bHeaderLength; | ||
| 305 | __u8 bSideBandProtocol; | ||
| 306 | } __attribute__((packed)); | ||
| 307 | |||
| 308 | /* type III */ | ||
| 309 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 | ||
| 310 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 | ||
| 311 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 | ||
| 312 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 | ||
| 313 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
| 314 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
| 315 | |||
| 235 | /* Formats - A.2 Format Type Codes */ | 316 | /* Formats - A.2 Format Type Codes */ |
| 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 | 317 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
| 237 | #define UAC_FORMAT_TYPE_I 0x1 | 318 | #define UAC_FORMAT_TYPE_I 0x1 |
| 238 | #define UAC_FORMAT_TYPE_II 0x2 | 319 | #define UAC_FORMAT_TYPE_II 0x2 |
| 239 | #define UAC_FORMAT_TYPE_III 0x3 | 320 | #define UAC_FORMAT_TYPE_III 0x3 |
| 321 | #define UAC_EXT_FORMAT_TYPE_I 0x81 | ||
| 322 | #define UAC_EXT_FORMAT_TYPE_II 0x82 | ||
| 323 | #define UAC_EXT_FORMAT_TYPE_III 0x83 | ||
| 240 | 324 | ||
| 241 | struct uac_iso_endpoint_descriptor { | 325 | struct uac_iso_endpoint_descriptor { |
| 242 | __u8 bLength; /* in bytes: 7 */ | 326 | __u8 bLength; /* in bytes: 7 */ |
| @@ -252,7 +336,31 @@ struct uac_iso_endpoint_descriptor { | |||
| 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | 336 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
| 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | 337 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
| 254 | 338 | ||
| 339 | /* Audio class v2.0: CLOCK_SOURCE descriptor */ | ||
| 340 | |||
| 341 | struct uac_clock_source_descriptor { | ||
| 342 | __u8 bLength; | ||
| 343 | __u8 bDescriptorType; | ||
| 344 | __u8 bDescriptorSubtype; | ||
| 345 | __u8 bClockID; | ||
| 346 | __u8 bmAttributes; | ||
| 347 | __u8 bmControls; | ||
| 348 | __u8 bAssocTerminal; | ||
| 349 | __u8 iClockSource; | ||
| 350 | } __attribute__((packed)); | ||
| 351 | |||
| 255 | /* A.10.2 Feature Unit Control Selectors */ | 352 | /* A.10.2 Feature Unit Control Selectors */ |
| 353 | |||
| 354 | struct uac_feature_unit_descriptor { | ||
| 355 | __u8 bLength; | ||
| 356 | __u8 bDescriptorType; | ||
| 357 | __u8 bDescriptorSubtype; | ||
| 358 | __u8 bUnitID; | ||
| 359 | __u8 bSourceID; | ||
| 360 | __u8 bControlSize; | ||
| 361 | __u8 controls[0]; /* variable length */ | ||
| 362 | } __attribute__((packed)); | ||
| 363 | |||
| 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 | 364 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
| 257 | #define UAC_MUTE_CONTROL 0x01 | 365 | #define UAC_MUTE_CONTROL 0x01 |
| 258 | #define UAC_VOLUME_CONTROL 0x02 | 366 | #define UAC_VOLUME_CONTROL 0x02 |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 94012e649d86..e58369ff8168 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -775,7 +775,7 @@ enum usb_device_speed { | |||
| 775 | USB_SPEED_UNKNOWN = 0, /* enumerating */ | 775 | USB_SPEED_UNKNOWN = 0, /* enumerating */ |
| 776 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | 776 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ |
| 777 | USB_SPEED_HIGH, /* usb 2.0 */ | 777 | USB_SPEED_HIGH, /* usb 2.0 */ |
| 778 | USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ | 778 | USB_SPEED_WIRELESS, /* wireless (usb 2.5) */ |
| 779 | USB_SPEED_SUPER, /* usb 3.0 */ | 779 | USB_SPEED_SUPER, /* usb 3.0 */ |
| 780 | }; | 780 | }; |
| 781 | 781 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index bbf45d500b6d..f4b7ca516cdd 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #ifndef __LINUX_USB_GADGET_H | 15 | #ifndef __LINUX_USB_GADGET_H |
| 16 | #define __LINUX_USB_GADGET_H | 16 | #define __LINUX_USB_GADGET_H |
| 17 | 17 | ||
| 18 | #include <linux/slab.h> | ||
| 19 | |||
| 18 | struct usb_ep; | 20 | struct usb_ep; |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index d43755669261..7acef0234c0e 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -30,26 +30,26 @@ struct musb_hdrc_eps_bits { | |||
| 30 | struct musb_hdrc_config { | 30 | struct musb_hdrc_config { |
| 31 | /* MUSB configuration-specific details */ | 31 | /* MUSB configuration-specific details */ |
| 32 | unsigned multipoint:1; /* multipoint device */ | 32 | unsigned multipoint:1; /* multipoint device */ |
| 33 | unsigned dyn_fifo:1; /* supports dynamic fifo sizing */ | 33 | unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */ |
| 34 | unsigned soft_con:1; /* soft connect required */ | 34 | unsigned soft_con:1 __deprecated; /* soft connect required */ |
| 35 | unsigned utm_16:1; /* utm data witdh is 16 bits */ | 35 | unsigned utm_16:1 __deprecated; /* utm data witdh is 16 bits */ |
| 36 | unsigned big_endian:1; /* true if CPU uses big-endian */ | 36 | unsigned big_endian:1; /* true if CPU uses big-endian */ |
| 37 | unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ | 37 | unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ |
| 38 | unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ | 38 | unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ |
| 39 | unsigned high_iso_tx:1; /* Tx ep required for HB iso */ | 39 | unsigned high_iso_tx:1; /* Tx ep required for HB iso */ |
| 40 | unsigned high_iso_rx:1; /* Rx ep required for HD iso */ | 40 | unsigned high_iso_rx:1; /* Rx ep required for HD iso */ |
| 41 | unsigned dma:1; /* supports DMA */ | 41 | unsigned dma:1 __deprecated; /* supports DMA */ |
| 42 | unsigned vendor_req:1; /* vendor registers required */ | 42 | unsigned vendor_req:1 __deprecated; /* vendor registers required */ |
| 43 | 43 | ||
| 44 | u8 num_eps; /* number of endpoints _with_ ep0 */ | 44 | u8 num_eps; /* number of endpoints _with_ ep0 */ |
| 45 | u8 dma_channels; /* number of dma channels */ | 45 | u8 dma_channels __deprecated; /* number of dma channels */ |
| 46 | u8 dyn_fifo_size; /* dynamic size in bytes */ | 46 | u8 dyn_fifo_size; /* dynamic size in bytes */ |
| 47 | u8 vendor_ctrl; /* vendor control reg width */ | 47 | u8 vendor_ctrl __deprecated; /* vendor control reg width */ |
| 48 | u8 vendor_stat; /* vendor status reg witdh */ | 48 | u8 vendor_stat __deprecated; /* vendor status reg witdh */ |
| 49 | u8 dma_req_chan; /* bitmask for required dma channels */ | 49 | u8 dma_req_chan __deprecated; /* bitmask for required dma channels */ |
| 50 | u8 ram_bits; /* ram address size */ | 50 | u8 ram_bits; /* ram address size */ |
| 51 | 51 | ||
| 52 | struct musb_hdrc_eps_bits *eps_bits; | 52 | struct musb_hdrc_eps_bits *eps_bits __deprecated; |
| 53 | #ifdef CONFIG_BLACKFIN | 53 | #ifdef CONFIG_BLACKFIN |
| 54 | /* A GPIO controlling VRSEL in Blackfin */ | 54 | /* A GPIO controlling VRSEL in Blackfin */ |
| 55 | unsigned int gpio_vrsel; | 55 | unsigned int gpio_vrsel; |
| @@ -76,6 +76,9 @@ struct musb_hdrc_platform_data { | |||
| 76 | /* (HOST or OTG) msec/2 after VBUS on till power good */ | 76 | /* (HOST or OTG) msec/2 after VBUS on till power good */ |
| 77 | u8 potpgt; | 77 | u8 potpgt; |
| 78 | 78 | ||
| 79 | /* (HOST or OTG) program PHY for external Vbus */ | ||
| 80 | unsigned extvbus:1; | ||
| 81 | |||
| 79 | /* Power the device on or off */ | 82 | /* Power the device on or off */ |
| 80 | int (*set_power)(int state); | 83 | int (*set_power)(int state); |
| 81 | 84 | ||
| @@ -84,6 +87,9 @@ struct musb_hdrc_platform_data { | |||
| 84 | 87 | ||
| 85 | /* MUSB configuration-specific details */ | 88 | /* MUSB configuration-specific details */ |
| 86 | struct musb_hdrc_config *config; | 89 | struct musb_hdrc_config *config; |
| 90 | |||
| 91 | /* Architecture specific board data */ | ||
| 92 | void *board_data; | ||
| 87 | }; | 93 | }; |
| 88 | 94 | ||
| 89 | 95 | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 52bb917641f0..f8302d036a76 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #ifndef __LINUX_USB_OTG_H | 9 | #ifndef __LINUX_USB_OTG_H |
| 10 | #define __LINUX_USB_OTG_H | 10 | #define __LINUX_USB_OTG_H |
| 11 | 11 | ||
| 12 | #include <linux/notifier.h> | ||
| 13 | |||
| 12 | /* OTG defines lots of enumeration states before device reset */ | 14 | /* OTG defines lots of enumeration states before device reset */ |
| 13 | enum usb_otg_state { | 15 | enum usb_otg_state { |
| 14 | OTG_STATE_UNDEFINED = 0, | 16 | OTG_STATE_UNDEFINED = 0, |
| @@ -33,6 +35,14 @@ enum usb_otg_state { | |||
| 33 | OTG_STATE_A_VBUS_ERR, | 35 | OTG_STATE_A_VBUS_ERR, |
| 34 | }; | 36 | }; |
| 35 | 37 | ||
| 38 | enum usb_xceiv_events { | ||
| 39 | USB_EVENT_NONE, /* no events or cable disconnected */ | ||
| 40 | USB_EVENT_VBUS, /* vbus valid event */ | ||
| 41 | USB_EVENT_ID, /* id was grounded */ | ||
| 42 | USB_EVENT_CHARGER, /* usb dedicated charger */ | ||
| 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | ||
| 44 | }; | ||
| 45 | |||
| 36 | #define USB_OTG_PULLUP_ID (1 << 0) | 46 | #define USB_OTG_PULLUP_ID (1 << 0) |
| 37 | #define USB_OTG_PULLDOWN_DP (1 << 1) | 47 | #define USB_OTG_PULLDOWN_DP (1 << 1) |
| 38 | #define USB_OTG_PULLDOWN_DM (1 << 2) | 48 | #define USB_OTG_PULLDOWN_DM (1 << 2) |
| @@ -70,6 +80,9 @@ struct otg_transceiver { | |||
| 70 | struct otg_io_access_ops *io_ops; | 80 | struct otg_io_access_ops *io_ops; |
| 71 | void __iomem *io_priv; | 81 | void __iomem *io_priv; |
| 72 | 82 | ||
| 83 | /* for notification of usb_xceiv_events */ | ||
| 84 | struct blocking_notifier_head notifier; | ||
| 85 | |||
| 73 | /* to pass extra port status to the root hub */ | 86 | /* to pass extra port status to the root hub */ |
| 74 | u16 port_status; | 87 | u16 port_status; |
| 75 | u16 port_change; | 88 | u16 port_change; |
| @@ -110,9 +123,19 @@ struct otg_transceiver { | |||
| 110 | /* for board-specific init logic */ | 123 | /* for board-specific init logic */ |
| 111 | extern int otg_set_transceiver(struct otg_transceiver *); | 124 | extern int otg_set_transceiver(struct otg_transceiver *); |
| 112 | 125 | ||
| 126 | #if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) | ||
| 113 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 127 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
| 114 | extern void usb_nop_xceiv_register(void); | 128 | extern void usb_nop_xceiv_register(void); |
| 115 | extern void usb_nop_xceiv_unregister(void); | 129 | extern void usb_nop_xceiv_unregister(void); |
| 130 | #else | ||
| 131 | static inline void usb_nop_xceiv_register(void) | ||
| 132 | { | ||
| 133 | } | ||
| 134 | |||
| 135 | static inline void usb_nop_xceiv_unregister(void) | ||
| 136 | { | ||
| 137 | } | ||
| 138 | #endif | ||
| 116 | 139 | ||
| 117 | /* helpers for direct access thru low-level io interface */ | 140 | /* helpers for direct access thru low-level io interface */ |
| 118 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | 141 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) |
| @@ -203,6 +226,18 @@ otg_start_srp(struct otg_transceiver *otg) | |||
| 203 | return otg->start_srp(otg); | 226 | return otg->start_srp(otg); |
| 204 | } | 227 | } |
| 205 | 228 | ||
| 229 | /* notifiers */ | ||
| 230 | static inline int | ||
| 231 | otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb) | ||
| 232 | { | ||
| 233 | return blocking_notifier_chain_register(&otg->notifier, nb); | ||
| 234 | } | ||
| 235 | |||
| 236 | static inline void | ||
| 237 | otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb) | ||
| 238 | { | ||
| 239 | blocking_notifier_chain_unregister(&otg->notifier, nb); | ||
| 240 | } | ||
| 206 | 241 | ||
| 207 | /* for OTG controller drivers (and maybe other stuff) */ | 242 | /* for OTG controller drivers (and maybe other stuff) */ |
| 208 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 243 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 2526f3bbd273..0a555dd131fc 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
| @@ -19,4 +19,7 @@ | |||
| 19 | /* device can't handle its Configuration or Interface strings */ | 19 | /* device can't handle its Configuration or Interface strings */ |
| 20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 | 20 | #define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 |
| 21 | 21 | ||
| 22 | /*device will morph if reset, don't use reset for handling errors */ | ||
| 23 | #define USB_QUIRK_RESET_MORPHS 0x00000010 | ||
| 24 | |||
| 22 | #endif /* __LINUX_USB_QUIRKS_H */ | 25 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 1819396ed501..0a458b861933 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -351,14 +351,11 @@ static inline void usb_serial_debug_data(int debug, | |||
| 351 | 351 | ||
| 352 | /* Use our own dbg macro */ | 352 | /* Use our own dbg macro */ |
| 353 | #undef dbg | 353 | #undef dbg |
| 354 | #define dbg(format, arg...) \ | 354 | #define dbg(format, arg...) \ |
| 355 | do { \ | 355 | do { \ |
| 356 | if (debug) \ | 356 | if (debug) \ |
| 357 | printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \ | 357 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ |
| 358 | ## arg); \ | 358 | } while (0) |
| 359 | } while (0) | ||
| 360 | |||
| 361 | |||
| 362 | 359 | ||
| 363 | #endif /* __LINUX_USB_SERIAL_H */ | 360 | #endif /* __LINUX_USB_SERIAL_H */ |
| 364 | 361 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 8ce61359bf73..df1e83dd9a54 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32); | |||
| 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); | 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); |
| 215 | extern int usbnet_nway_reset(struct net_device *net); | 215 | extern int usbnet_nway_reset(struct net_device *net); |
| 216 | 216 | ||
| 217 | /* messaging support includes the interface name, so it must not be | ||
| 218 | * used before it has one ... notably, in minidriver bind() calls. | ||
| 219 | */ | ||
| 220 | #ifdef DEBUG | ||
| 221 | #define devdbg(usbnet, fmt, arg...) \ | ||
| 222 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 223 | #else | ||
| 224 | #define devdbg(usbnet, fmt, arg...) \ | ||
| 225 | ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \ | ||
| 226 | ## arg); 0; }) | ||
| 227 | #endif | ||
| 228 | |||
| 229 | #define deverr(usbnet, fmt, arg...) \ | ||
| 230 | printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 231 | #define devwarn(usbnet, fmt, arg...) \ | ||
| 232 | printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 233 | |||
| 234 | #define devinfo(usbnet, fmt, arg...) \ | ||
| 235 | printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \ | ||
| 236 | |||
| 237 | |||
| 238 | #endif /* __LINUX_USB_USBNET_H */ | 217 | #endif /* __LINUX_USB_USBNET_H */ |
diff --git a/include/linux/usb/vstusb.h b/include/linux/usb/vstusb.h deleted file mode 100644 index 1cfac67191ff..000000000000 --- a/include/linux/usb/vstusb.h +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * File: drivers/usb/misc/vstusb.h | ||
| 3 | * | ||
| 4 | * Purpose: Support for the bulk USB Vernier Spectrophotometers | ||
| 5 | * | ||
| 6 | * Author: EQware Engineering, Inc. | ||
| 7 | * Oregon City, OR, USA 97045 | ||
| 8 | * | ||
| 9 | * Copyright: 2007, 2008 | ||
| 10 | * Vernier Software & Technology | ||
| 11 | * Beaverton, OR, USA 97005 | ||
| 12 | * | ||
| 13 | * Web: www.vernier.com | ||
| 14 | * | ||
| 15 | * This program is free software; you can redistribute it and/or modify | ||
| 16 | * it under the terms of the GNU General Public License version 2 as | ||
| 17 | * published by the Free Software Foundation. | ||
| 18 | * | ||
| 19 | *****************************************************************************/ | ||
| 20 | /***************************************************************************** | ||
| 21 | * | ||
| 22 | * The vstusb module is a standard usb 'client' driver running on top of the | ||
| 23 | * standard usb host controller stack. | ||
| 24 | * | ||
| 25 | * In general, vstusb supports standard bulk usb pipes. It supports multiple | ||
| 26 | * devices and multiple pipes per device. | ||
| 27 | * | ||
| 28 | * The vstusb driver supports two interfaces: | ||
| 29 | * 1 - ioctl SEND_PIPE/RECV_PIPE - a general bulk write/read msg | ||
| 30 | * interface to any pipe with timeout support; | ||
| 31 | * 2 - standard read/write with ioctl config - offers standard read/write | ||
| 32 | * interface with ioctl configured pipes and timeouts. | ||
| 33 | * | ||
| 34 | * Both interfaces can be signal from other process and will abort its i/o | ||
| 35 | * operation. | ||
| 36 | * | ||
| 37 | * A timeout of 0 means NO timeout. The user can still terminate the read via | ||
| 38 | * signal. | ||
| 39 | * | ||
| 40 | * If using multiple threads with this driver, the user should ensure that | ||
| 41 | * any reads, writes, or ioctls are complete before closing the device. | ||
| 42 | * Changing read/write timeouts or pipes takes effect on next read/write. | ||
| 43 | * | ||
| 44 | *****************************************************************************/ | ||
| 45 | |||
| 46 | struct vstusb_args { | ||
| 47 | union { | ||
| 48 | /* this struct is used for IOCTL_VSTUSB_SEND_PIPE, * | ||
| 49 | * IOCTL_VSTUSB_RECV_PIPE, and read()/write() fops */ | ||
| 50 | struct { | ||
| 51 | void __user *buffer; | ||
| 52 | size_t count; | ||
| 53 | unsigned int timeout_ms; | ||
| 54 | int pipe; | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* this one is used for IOCTL_VSTUSB_CONFIG_RW */ | ||
| 58 | struct { | ||
| 59 | int rd_pipe; | ||
| 60 | int rd_timeout_ms; | ||
| 61 | int wr_pipe; | ||
| 62 | int wr_timeout_ms; | ||
| 63 | }; | ||
| 64 | }; | ||
| 65 | }; | ||
| 66 | |||
| 67 | #define VST_IOC_MAGIC 'L' | ||
| 68 | #define VST_IOC_FIRST 0x20 | ||
| 69 | #define IOCTL_VSTUSB_SEND_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST) | ||
| 70 | #define IOCTL_VSTUSB_RECV_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 1) | ||
| 71 | #define IOCTL_VSTUSB_CONFIG_RW _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 2) | ||
