diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/usb/c67x00.h | 48 | ||||
| -rw-r--r-- | include/linux/usb/ch9.h | 12 | ||||
| -rw-r--r-- | include/linux/usb/gadget.h | 21 |
3 files changed, 80 insertions, 1 deletions
diff --git a/include/linux/usb/c67x00.h b/include/linux/usb/c67x00.h new file mode 100644 index 000000000000..83c6b45470ca --- /dev/null +++ b/include/linux/usb/c67x00.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * usb_c67x00.h: platform definitions for the Cypress C67X00 USB chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2006-2008 Barco N.V. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
| 19 | * MA 02110-1301 USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef _LINUX_USB_C67X00_H | ||
| 23 | #define _LINUX_USB_C67X00_H | ||
| 24 | |||
| 25 | /* SIE configuration */ | ||
| 26 | #define C67X00_SIE_UNUSED 0 | ||
| 27 | #define C67X00_SIE_HOST 1 | ||
| 28 | #define C67X00_SIE_PERIPHERAL_A 2 /* peripheral on A port */ | ||
| 29 | #define C67X00_SIE_PERIPHERAL_B 3 /* peripheral on B port */ | ||
| 30 | |||
| 31 | #define c67x00_sie_config(config, n) (((config)>>(4*(n)))&0x3) | ||
| 32 | |||
| 33 | #define C67X00_SIE1_UNUSED (C67X00_SIE_UNUSED << 0) | ||
| 34 | #define C67X00_SIE1_HOST (C67X00_SIE_HOST << 0) | ||
| 35 | #define C67X00_SIE1_PERIPHERAL_A (C67X00_SIE_PERIPHERAL_A << 0) | ||
| 36 | #define C67X00_SIE1_PERIPHERAL_B (C67X00_SIE_PERIPHERAL_B << 0) | ||
| 37 | |||
| 38 | #define C67X00_SIE2_UNUSED (C67X00_SIE_UNUSED << 4) | ||
| 39 | #define C67X00_SIE2_HOST (C67X00_SIE_HOST << 4) | ||
| 40 | #define C67X00_SIE2_PERIPHERAL_A (C67X00_SIE_PERIPHERAL_A << 4) | ||
| 41 | #define C67X00_SIE2_PERIPHERAL_B (C67X00_SIE_PERIPHERAL_B << 4) | ||
| 42 | |||
| 43 | struct c67x00_platform_data { | ||
| 44 | int sie_config; /* SIEs config (C67X00_SIEx_*) */ | ||
| 45 | unsigned long hpi_regstep; /* Step between HPI registers */ | ||
| 46 | }; | ||
| 47 | |||
| 48 | #endif /* _LINUX_USB_C67X00_H */ | ||
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 7e0d3084f76c..73a2f4eb1f7a 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -455,7 +455,7 @@ struct usb_encryption_descriptor { | |||
| 455 | 455 | ||
| 456 | /*-------------------------------------------------------------------------*/ | 456 | /*-------------------------------------------------------------------------*/ |
| 457 | 457 | ||
| 458 | /* USB_DT_BOS: group of wireless capabilities */ | 458 | /* USB_DT_BOS: group of device-level capabilities */ |
| 459 | struct usb_bos_descriptor { | 459 | struct usb_bos_descriptor { |
| 460 | __u8 bLength; | 460 | __u8 bLength; |
| 461 | __u8 bDescriptorType; | 461 | __u8 bDescriptorType; |
| @@ -501,6 +501,16 @@ struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ | |||
| 501 | __u8 bReserved; | 501 | __u8 bReserved; |
| 502 | } __attribute__((packed)); | 502 | } __attribute__((packed)); |
| 503 | 503 | ||
| 504 | #define USB_CAP_TYPE_EXT 2 | ||
| 505 | |||
| 506 | struct usb_ext_cap_descriptor { /* Link Power Management */ | ||
| 507 | __u8 bLength; | ||
| 508 | __u8 bDescriptorType; | ||
| 509 | __u8 bDevCapabilityType; | ||
| 510 | __u8 bmAttributes; | ||
| 511 | #define USB_LPM_SUPPORT (1 << 1) /* supports LPM */ | ||
| 512 | } __attribute__((packed)); | ||
| 513 | |||
| 504 | /*-------------------------------------------------------------------------*/ | 514 | /*-------------------------------------------------------------------------*/ |
| 505 | 515 | ||
| 506 | /* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with | 516 | /* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index d8128f7102c9..cf468fbdbf8e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -114,6 +114,8 @@ struct usb_ep_ops { | |||
| 114 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | 114 | int (*dequeue) (struct usb_ep *ep, struct usb_request *req); |
| 115 | 115 | ||
| 116 | int (*set_halt) (struct usb_ep *ep, int value); | 116 | int (*set_halt) (struct usb_ep *ep, int value); |
| 117 | int (*set_wedge) (struct usb_ep *ep); | ||
| 118 | |||
| 117 | int (*fifo_status) (struct usb_ep *ep); | 119 | int (*fifo_status) (struct usb_ep *ep); |
| 118 | void (*fifo_flush) (struct usb_ep *ep); | 120 | void (*fifo_flush) (struct usb_ep *ep); |
| 119 | }; | 121 | }; |
| @@ -349,6 +351,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep) | |||
| 349 | } | 351 | } |
| 350 | 352 | ||
| 351 | /** | 353 | /** |
| 354 | * usb_ep_set_wedge - sets the halt feature and ignores clear requests | ||
| 355 | * @ep: the endpoint being wedged | ||
| 356 | * | ||
| 357 | * Use this to stall an endpoint and ignore CLEAR_FEATURE(HALT_ENDPOINT) | ||
| 358 | * requests. If the gadget driver clears the halt status, it will | ||
| 359 | * automatically unwedge the endpoint. | ||
| 360 | * | ||
| 361 | * Returns zero on success, else negative errno. | ||
| 362 | */ | ||
| 363 | static inline int | ||
| 364 | usb_ep_set_wedge(struct usb_ep *ep) | ||
| 365 | { | ||
| 366 | if (ep->ops->set_wedge) | ||
| 367 | return ep->ops->set_wedge(ep); | ||
| 368 | else | ||
| 369 | return ep->ops->set_halt(ep, 1); | ||
| 370 | } | ||
| 371 | |||
| 372 | /** | ||
| 352 | * usb_ep_fifo_status - returns number of bytes in fifo, or error | 373 | * usb_ep_fifo_status - returns number of bytes in fifo, or error |
| 353 | * @ep: the endpoint whose fifo status is being checked. | 374 | * @ep: the endpoint whose fifo status is being checked. |
| 354 | * | 375 | * |
