diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 13:23:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 13:23:47 -0400 |
| commit | 9fc377799bc9bfd8d5cb35d0d1ea2e2458cbdbb3 (patch) | |
| tree | fe93603b4e33dd50ff5f95ff769a0748b230cdf9 /include/linux | |
| parent | 5e23ae49960d05f578a73ecd19749c45af682c2b (diff) | |
| parent | e387ef5c47ddeaeaa3cbdc54424cdb7a28dae2c0 (diff) | |
Merge tag 'usb-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg Kroah-Hartman:
"Here's the big USB patch set for the 3.6-rc1 merge window.
Lots of little changes in here, primarily for gadget controllers and
drivers. There's some scsi changes that I think also went in through
the scsi tree, but they merge just fine. All of these patches have
been in the linux-next tree for a while now.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
Fix up trivial conflicts in include/scsi/scsi_device.h (same libata
conflict that Jeff had already encountered)
* tag 'usb-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (207 commits)
usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams
usb: Add quirk detection based on interface information
usb: s3c-hsotg: Add header file protection macros in s3c-hsotg.h
USB: ehci-s5p: Add vbus setup function to the s5p ehci glue layer
USB: add USB_VENDOR_AND_INTERFACE_INFO() macro
USB: notify phy when root hub port connect change
USB: remove 8 bytes of padding from usb_host_interface on 64 bit builds
USB: option: add ZTE MF821D
USB: sierra: QMI mode MC7710 moved to qcserial
USB: qcserial: adding Sierra Wireless devices
USB: qcserial: support generic Qualcomm serial ports
USB: qcserial: make probe more flexible
USB: qcserial: centralize probe exit path
USB: qcserial: consolidate usb_set_interface calls
USB: ehci-s5p: Add support for device tree
USB: ohci-exynos: Add support for device tree
USB: ehci-omap: fix compile failure(v1)
usb: host: tegra: pass correct pointer in ehci_setup()
USB: ehci-fsl: Update ifdef check to work on 64-bit ppc
USB: serial: keyspan: Removed unrequired parentheses.
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mod_devicetable.h | 10 | ||||
| -rw-r--r-- | include/linux/platform_data/s3c-hsotg.h | 5 | ||||
| -rw-r--r-- | include/linux/usb.h | 59 | ||||
| -rw-r--r-- | include/linux/usb/chipidea.h | 14 | ||||
| -rw-r--r-- | include/linux/usb/ehci_def.h | 28 | ||||
| -rw-r--r-- | include/linux/usb/hcd.h | 6 | ||||
| -rw-r--r-- | include/linux/usb/musb-omap.h | 30 | ||||
| -rw-r--r-- | include/linux/usb/otg.h | 67 | ||||
| -rw-r--r-- | include/linux/usb/renesas_usbhs.h | 8 | ||||
| -rw-r--r-- | include/linux/usb/uas.h | 40 | ||||
| -rw-r--r-- | include/linux/usbdevice_fs.h | 8 |
11 files changed, 257 insertions, 18 deletions
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 5db93821f9c7..6955045199b0 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -78,6 +78,9 @@ struct ieee1394_device_id { | |||
| 78 | * of a given interface; other interfaces may support other classes. | 78 | * of a given interface; other interfaces may support other classes. |
| 79 | * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass. | 79 | * @bInterfaceSubClass: Subclass of interface; associated with bInterfaceClass. |
| 80 | * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass. | 80 | * @bInterfaceProtocol: Protocol of interface; associated with bInterfaceClass. |
| 81 | * @bInterfaceNumber: Number of interface; composite devices may use | ||
| 82 | * fixed interface numbers to differentiate between vendor-specific | ||
| 83 | * interfaces. | ||
| 81 | * @driver_info: Holds information used by the driver. Usually it holds | 84 | * @driver_info: Holds information used by the driver. Usually it holds |
| 82 | * a pointer to a descriptor understood by the driver, or perhaps | 85 | * a pointer to a descriptor understood by the driver, or perhaps |
| 83 | * device flags. | 86 | * device flags. |
| @@ -115,8 +118,12 @@ struct usb_device_id { | |||
| 115 | __u8 bInterfaceSubClass; | 118 | __u8 bInterfaceSubClass; |
| 116 | __u8 bInterfaceProtocol; | 119 | __u8 bInterfaceProtocol; |
| 117 | 120 | ||
| 121 | /* Used for vendor-specific interface matches */ | ||
| 122 | __u8 bInterfaceNumber; | ||
| 123 | |||
| 118 | /* not matched against */ | 124 | /* not matched against */ |
| 119 | kernel_ulong_t driver_info; | 125 | kernel_ulong_t driver_info |
| 126 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
| 120 | }; | 127 | }; |
| 121 | 128 | ||
| 122 | /* Some useful macros to use to create struct usb_device_id */ | 129 | /* Some useful macros to use to create struct usb_device_id */ |
| @@ -130,6 +137,7 @@ struct usb_device_id { | |||
| 130 | #define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080 | 137 | #define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080 |
| 131 | #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 | 138 | #define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100 |
| 132 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 | 139 | #define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200 |
| 140 | #define USB_DEVICE_ID_MATCH_INT_NUMBER 0x0400 | ||
| 133 | 141 | ||
| 134 | #define HID_ANY_ID (~0) | 142 | #define HID_ANY_ID (~0) |
| 135 | #define HID_BUS_ANY 0xffff | 143 | #define HID_BUS_ANY 0xffff |
diff --git a/include/linux/platform_data/s3c-hsotg.h b/include/linux/platform_data/s3c-hsotg.h index 97ec12c2ded4..8b79e0967f9c 100644 --- a/include/linux/platform_data/s3c-hsotg.h +++ b/include/linux/platform_data/s3c-hsotg.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #ifndef __LINUX_USB_S3C_HSOTG_H | ||
| 16 | #define __LINUX_USB_S3C_HSOTG_H | ||
| 17 | |||
| 15 | enum s3c_hsotg_dmamode { | 18 | enum s3c_hsotg_dmamode { |
| 16 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ | 19 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ |
| 17 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ | 20 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ |
| @@ -33,3 +36,5 @@ struct s3c_hsotg_plat { | |||
| 33 | }; | 36 | }; |
| 34 | 37 | ||
| 35 | extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd); | 38 | extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd); |
| 39 | |||
| 40 | #endif /* __LINUX_USB_S3C_HSOTG_H */ | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index dea39dc551d4..30d1ae38eab1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -77,14 +77,15 @@ struct usb_host_endpoint { | |||
| 77 | struct usb_host_interface { | 77 | struct usb_host_interface { |
| 78 | struct usb_interface_descriptor desc; | 78 | struct usb_interface_descriptor desc; |
| 79 | 79 | ||
| 80 | int extralen; | ||
| 81 | unsigned char *extra; /* Extra descriptors */ | ||
| 82 | |||
| 80 | /* array of desc.bNumEndpoint endpoints associated with this | 83 | /* array of desc.bNumEndpoint endpoints associated with this |
| 81 | * interface setting. these will be in no particular order. | 84 | * interface setting. these will be in no particular order. |
| 82 | */ | 85 | */ |
| 83 | struct usb_host_endpoint *endpoint; | 86 | struct usb_host_endpoint *endpoint; |
| 84 | 87 | ||
| 85 | char *string; /* iInterface string, if present */ | 88 | char *string; /* iInterface string, if present */ |
| 86 | unsigned char *extra; /* Extra descriptors */ | ||
| 87 | int extralen; | ||
| 88 | }; | 89 | }; |
| 89 | 90 | ||
| 90 | enum usb_interface_condition { | 91 | enum usb_interface_condition { |
| @@ -331,6 +332,11 @@ struct usb_bus { | |||
| 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 332 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
| 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 333 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 334 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
| 335 | unsigned no_stop_on_short:1; /* | ||
| 336 | * Quirk: some controllers don't stop | ||
| 337 | * the ep queue on a short transfer | ||
| 338 | * with the URB_SHORT_NOT_OK flag set. | ||
| 339 | */ | ||
| 334 | unsigned sg_tablesize; /* 0 or largest number of sg list entries */ | 340 | unsigned sg_tablesize; /* 0 or largest number of sg list entries */ |
| 335 | 341 | ||
| 336 | int devnum_next; /* Next open device number in | 342 | int devnum_next; /* Next open device number in |
| @@ -556,7 +562,6 @@ struct usb_device { | |||
| 556 | struct usb3_lpm_parameters u1_params; | 562 | struct usb3_lpm_parameters u1_params; |
| 557 | struct usb3_lpm_parameters u2_params; | 563 | struct usb3_lpm_parameters u2_params; |
| 558 | unsigned lpm_disable_count; | 564 | unsigned lpm_disable_count; |
| 559 | unsigned hub_initiated_lpm_disable_count; | ||
| 560 | }; | 565 | }; |
| 561 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 566 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
| 562 | 567 | ||
| @@ -629,6 +634,17 @@ extern void usb_enable_lpm(struct usb_device *udev); | |||
| 629 | extern int usb_unlocked_disable_lpm(struct usb_device *udev); | 634 | extern int usb_unlocked_disable_lpm(struct usb_device *udev); |
| 630 | extern void usb_unlocked_enable_lpm(struct usb_device *udev); | 635 | extern void usb_unlocked_enable_lpm(struct usb_device *udev); |
| 631 | 636 | ||
| 637 | extern int usb_disable_ltm(struct usb_device *udev); | ||
| 638 | extern void usb_enable_ltm(struct usb_device *udev); | ||
| 639 | |||
| 640 | static inline bool usb_device_supports_ltm(struct usb_device *udev) | ||
| 641 | { | ||
| 642 | if (udev->speed != USB_SPEED_SUPER || !udev->bos || !udev->bos->ss_cap) | ||
| 643 | return false; | ||
| 644 | return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT; | ||
| 645 | } | ||
| 646 | |||
| 647 | |||
| 632 | /*-------------------------------------------------------------------------*/ | 648 | /*-------------------------------------------------------------------------*/ |
| 633 | 649 | ||
| 634 | /* for drivers using iso endpoints */ | 650 | /* for drivers using iso endpoints */ |
| @@ -777,6 +793,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
| 777 | .bInterfaceProtocol = (pr) | 793 | .bInterfaceProtocol = (pr) |
| 778 | 794 | ||
| 779 | /** | 795 | /** |
| 796 | * USB_DEVICE_INTERFACE_NUMBER - describe a usb device with a specific interface number | ||
| 797 | * @vend: the 16 bit USB Vendor ID | ||
| 798 | * @prod: the 16 bit USB Product ID | ||
| 799 | * @num: bInterfaceNumber value | ||
| 800 | * | ||
| 801 | * This macro is used to create a struct usb_device_id that matches a | ||
| 802 | * specific interface number of devices. | ||
| 803 | */ | ||
| 804 | #define USB_DEVICE_INTERFACE_NUMBER(vend, prod, num) \ | ||
| 805 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ | ||
| 806 | USB_DEVICE_ID_MATCH_INT_NUMBER, \ | ||
| 807 | .idVendor = (vend), \ | ||
| 808 | .idProduct = (prod), \ | ||
| 809 | .bInterfaceNumber = (num) | ||
| 810 | |||
| 811 | /** | ||
| 780 | * USB_DEVICE_INFO - macro used to describe a class of usb devices | 812 | * USB_DEVICE_INFO - macro used to describe a class of usb devices |
| 781 | * @cl: bDeviceClass value | 813 | * @cl: bDeviceClass value |
| 782 | * @sc: bDeviceSubClass value | 814 | * @sc: bDeviceSubClass value |
| @@ -829,6 +861,27 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size) | |||
| 829 | .bInterfaceSubClass = (sc), \ | 861 | .bInterfaceSubClass = (sc), \ |
| 830 | .bInterfaceProtocol = (pr) | 862 | .bInterfaceProtocol = (pr) |
| 831 | 863 | ||
| 864 | /** | ||
| 865 | * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces | ||
| 866 | * @vend: the 16 bit USB Vendor ID | ||
| 867 | * @cl: bInterfaceClass value | ||
| 868 | * @sc: bInterfaceSubClass value | ||
| 869 | * @pr: bInterfaceProtocol value | ||
| 870 | * | ||
| 871 | * This macro is used to create a struct usb_device_id that matches a | ||
| 872 | * specific vendor with a specific class of interfaces. | ||
| 873 | * | ||
| 874 | * This is especially useful when explicitly matching devices that have | ||
| 875 | * vendor specific bDeviceClass values, but standards-compliant interfaces. | ||
| 876 | */ | ||
| 877 | #define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \ | ||
| 878 | .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | ||
| 879 | | USB_DEVICE_ID_MATCH_VENDOR, \ | ||
| 880 | .idVendor = (vend), \ | ||
| 881 | .bInterfaceClass = (cl), \ | ||
| 882 | .bInterfaceSubClass = (sc), \ | ||
| 883 | .bInterfaceProtocol = (pr) | ||
| 884 | |||
| 832 | /* ----------------------------------------------------------------------- */ | 885 | /* ----------------------------------------------------------------------- */ |
| 833 | 886 | ||
| 834 | /* Stuff for dynamic usb ids */ | 887 | /* Stuff for dynamic usb ids */ |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index edb90d6cfd12..544825dde823 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
| @@ -5,12 +5,15 @@ | |||
| 5 | #ifndef __LINUX_USB_CHIPIDEA_H | 5 | #ifndef __LINUX_USB_CHIPIDEA_H |
| 6 | #define __LINUX_USB_CHIPIDEA_H | 6 | #define __LINUX_USB_CHIPIDEA_H |
| 7 | 7 | ||
| 8 | #include <linux/usb/otg.h> | ||
| 9 | |||
| 8 | struct ci13xxx; | 10 | struct ci13xxx; |
| 9 | struct ci13xxx_udc_driver { | 11 | struct ci13xxx_platform_data { |
| 10 | const char *name; | 12 | const char *name; |
| 11 | /* offset of the capability registers */ | 13 | /* offset of the capability registers */ |
| 12 | uintptr_t capoffset; | 14 | uintptr_t capoffset; |
| 13 | unsigned power_budget; | 15 | unsigned power_budget; |
| 16 | struct usb_phy *phy; | ||
| 14 | unsigned long flags; | 17 | unsigned long flags; |
| 15 | #define CI13XXX_REGS_SHARED BIT(0) | 18 | #define CI13XXX_REGS_SHARED BIT(0) |
| 16 | #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) | 19 | #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) |
| @@ -19,10 +22,17 @@ struct ci13xxx_udc_driver { | |||
| 19 | 22 | ||
| 20 | #define CI13XXX_CONTROLLER_RESET_EVENT 0 | 23 | #define CI13XXX_CONTROLLER_RESET_EVENT 0 |
| 21 | #define CI13XXX_CONTROLLER_STOPPED_EVENT 1 | 24 | #define CI13XXX_CONTROLLER_STOPPED_EVENT 1 |
| 22 | void (*notify_event) (struct ci13xxx *udc, unsigned event); | 25 | void (*notify_event) (struct ci13xxx *ci, unsigned event); |
| 23 | }; | 26 | }; |
| 24 | 27 | ||
| 25 | /* Default offset of capability registers */ | 28 | /* Default offset of capability registers */ |
| 26 | #define DEF_CAPOFFSET 0x100 | 29 | #define DEF_CAPOFFSET 0x100 |
| 27 | 30 | ||
| 31 | /* Add ci13xxx device */ | ||
| 32 | struct platform_device *ci13xxx_add_device(struct device *dev, | ||
| 33 | struct resource *res, int nres, | ||
| 34 | struct ci13xxx_platform_data *platdata); | ||
| 35 | /* Remove ci13xxx device */ | ||
| 36 | void ci13xxx_remove_device(struct platform_device *pdev); | ||
| 37 | |||
| 28 | #endif | 38 | #endif |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 7cc95ee3606b..de4b9ed5d5dd 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
| @@ -111,7 +111,13 @@ struct ehci_regs { | |||
| 111 | /* ASYNCLISTADDR: offset 0x18 */ | 111 | /* ASYNCLISTADDR: offset 0x18 */ |
| 112 | u32 async_next; /* address of next async queue head */ | 112 | u32 async_next; /* address of next async queue head */ |
| 113 | 113 | ||
| 114 | u32 reserved[9]; | 114 | u32 reserved1[2]; |
| 115 | |||
| 116 | /* TXFILLTUNING: offset 0x24 */ | ||
| 117 | u32 txfill_tuning; /* TX FIFO Tuning register */ | ||
| 118 | #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */ | ||
| 119 | |||
| 120 | u32 reserved2[6]; | ||
| 115 | 121 | ||
| 116 | /* CONFIGFLAG: offset 0x40 */ | 122 | /* CONFIGFLAG: offset 0x40 */ |
| 117 | u32 configured_flag; | 123 | u32 configured_flag; |
| @@ -155,26 +161,34 @@ struct ehci_regs { | |||
| 155 | #define PORT_CSC (1<<1) /* connect status change */ | 161 | #define PORT_CSC (1<<1) /* connect status change */ |
| 156 | #define PORT_CONNECT (1<<0) /* device connected */ | 162 | #define PORT_CONNECT (1<<0) /* device connected */ |
| 157 | #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) | 163 | #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_OCC) |
| 158 | }; | ||
| 159 | 164 | ||
| 160 | #define USBMODE 0x68 /* USB Device mode */ | 165 | u32 reserved3[9]; |
| 166 | |||
| 167 | /* USBMODE: offset 0x68 */ | ||
| 168 | u32 usbmode; /* USB Device mode */ | ||
| 161 | #define USBMODE_SDIS (1<<3) /* Stream disable */ | 169 | #define USBMODE_SDIS (1<<3) /* Stream disable */ |
| 162 | #define USBMODE_BE (1<<2) /* BE/LE endianness select */ | 170 | #define USBMODE_BE (1<<2) /* BE/LE endianness select */ |
| 163 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ | 171 | #define USBMODE_CM_HC (3<<0) /* host controller mode */ |
| 164 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ | 172 | #define USBMODE_CM_IDLE (0<<0) /* idle state */ |
| 165 | 173 | ||
| 174 | u32 reserved4[7]; | ||
| 175 | |||
| 166 | /* Moorestown has some non-standard registers, partially due to the fact that | 176 | /* Moorestown has some non-standard registers, partially due to the fact that |
| 167 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to | 177 | * its EHCI controller has both TT and LPM support. HOSTPCx are extensions to |
| 168 | * PORTSCx | 178 | * PORTSCx |
| 169 | */ | 179 | */ |
| 170 | #define HOSTPC0 0x84 /* HOSTPC extension */ | 180 | /* HOSTPC: offset 0x84 */ |
| 181 | u32 hostpc[0]; /* HOSTPC extension */ | ||
| 171 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | 182 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ |
| 172 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | 183 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ |
| 173 | #define USBMODE_EX 0xc8 /* USB Device mode extension */ | 184 | |
| 185 | u32 reserved5[17]; | ||
| 186 | |||
| 187 | /* USBMODE_EX: offset 0xc8 */ | ||
| 188 | u32 usbmode_ex; /* USB Device mode extension */ | ||
| 174 | #define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ | 189 | #define USBMODE_EX_VBPS (1<<5) /* VBus Power Select On */ |
| 175 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ | 190 | #define USBMODE_EX_HC (3<<0) /* host controller mode */ |
| 176 | #define TXFILLTUNING 0x24 /* TX FIFO Tuning register */ | 191 | }; |
| 177 | #define TXFIFO_DEFAULT (8<<16) /* FIFO burst threshold 8 */ | ||
| 178 | 192 | ||
| 179 | /* Appendix C, Debug port ... intended for use with special "debug devices" | 193 | /* Appendix C, Debug port ... intended for use with special "debug devices" |
| 180 | * that can help if there's no serial console. (nonstandard enumeration.) | 194 | * that can help if there's no serial console. (nonstandard enumeration.) |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 49b3ac29726a..c5fdb148fc02 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -93,6 +93,12 @@ struct usb_hcd { | |||
| 93 | */ | 93 | */ |
| 94 | const struct hc_driver *driver; /* hw-specific hooks */ | 94 | const struct hc_driver *driver; /* hw-specific hooks */ |
| 95 | 95 | ||
| 96 | /* | ||
| 97 | * OTG and some Host controllers need software interaction with phys; | ||
| 98 | * other external phys should be software-transparent | ||
| 99 | */ | ||
| 100 | struct usb_phy *phy; | ||
| 101 | |||
| 96 | /* Flags that need to be manipulated atomically because they can | 102 | /* Flags that need to be manipulated atomically because they can |
| 97 | * change while the host controller is running. Always use | 103 | * change while the host controller is running. Always use |
| 98 | * set_bit() or clear_bit() to change their values. | 104 | * set_bit() or clear_bit() to change their values. |
diff --git a/include/linux/usb/musb-omap.h b/include/linux/usb/musb-omap.h new file mode 100644 index 000000000000..7774c5986f07 --- /dev/null +++ b/include/linux/usb/musb-omap.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2011-2012 by Texas Instruments | ||
| 3 | * | ||
| 4 | * The Inventra Controller Driver for Linux is free software; you | ||
| 5 | * can redistribute it and/or modify it under the terms of the GNU | ||
| 6 | * General Public License version 2 as published by the Free Software | ||
| 7 | * Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __MUSB_OMAP_H__ | ||
| 11 | #define __MUSB_OMAP_H__ | ||
| 12 | |||
| 13 | enum omap_musb_vbus_id_status { | ||
| 14 | OMAP_MUSB_UNKNOWN = 0, | ||
| 15 | OMAP_MUSB_ID_GROUND, | ||
| 16 | OMAP_MUSB_ID_FLOAT, | ||
| 17 | OMAP_MUSB_VBUS_VALID, | ||
| 18 | OMAP_MUSB_VBUS_OFF, | ||
| 19 | }; | ||
| 20 | |||
| 21 | #if (defined(CONFIG_USB_MUSB_OMAP2PLUS) || \ | ||
| 22 | defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE)) | ||
| 23 | void omap_musb_mailbox(enum omap_musb_vbus_id_status status); | ||
| 24 | #else | ||
| 25 | static inline void omap_musb_mailbox(enum omap_musb_vbus_id_status status) | ||
| 26 | { | ||
| 27 | } | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #endif /* __MUSB_OMAP_H__ */ | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 38ab3f46346f..45824be0a2f9 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -43,6 +43,13 @@ enum usb_phy_events { | |||
| 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | /* associate a type with PHY */ | ||
| 47 | enum usb_phy_type { | ||
| 48 | USB_PHY_TYPE_UNDEFINED, | ||
| 49 | USB_PHY_TYPE_USB2, | ||
| 50 | USB_PHY_TYPE_USB3, | ||
| 51 | }; | ||
| 52 | |||
| 46 | struct usb_phy; | 53 | struct usb_phy; |
| 47 | 54 | ||
| 48 | /* for transceivers connected thru an ULPI interface, the user must | 55 | /* for transceivers connected thru an ULPI interface, the user must |
| @@ -89,6 +96,7 @@ struct usb_phy { | |||
| 89 | const char *label; | 96 | const char *label; |
| 90 | unsigned int flags; | 97 | unsigned int flags; |
| 91 | 98 | ||
| 99 | enum usb_phy_type type; | ||
| 92 | enum usb_otg_state state; | 100 | enum usb_otg_state state; |
| 93 | enum usb_phy_events last_event; | 101 | enum usb_phy_events last_event; |
| 94 | 102 | ||
| @@ -105,6 +113,9 @@ struct usb_phy { | |||
| 105 | u16 port_status; | 113 | u16 port_status; |
| 106 | u16 port_change; | 114 | u16 port_change; |
| 107 | 115 | ||
| 116 | /* to support controllers that have multiple transceivers */ | ||
| 117 | struct list_head head; | ||
| 118 | |||
| 108 | /* initialize/shutdown the OTG controller */ | 119 | /* initialize/shutdown the OTG controller */ |
| 109 | int (*init)(struct usb_phy *x); | 120 | int (*init)(struct usb_phy *x); |
| 110 | void (*shutdown)(struct usb_phy *x); | 121 | void (*shutdown)(struct usb_phy *x); |
| @@ -117,11 +128,15 @@ struct usb_phy { | |||
| 117 | int (*set_suspend)(struct usb_phy *x, | 128 | int (*set_suspend)(struct usb_phy *x, |
| 118 | int suspend); | 129 | int suspend); |
| 119 | 130 | ||
| 131 | /* notify phy connect status change */ | ||
| 132 | int (*notify_connect)(struct usb_phy *x, int port); | ||
| 133 | int (*notify_disconnect)(struct usb_phy *x, int port); | ||
| 120 | }; | 134 | }; |
| 121 | 135 | ||
| 122 | 136 | ||
| 123 | /* for board-specific init logic */ | 137 | /* for board-specific init logic */ |
| 124 | extern int usb_set_transceiver(struct usb_phy *); | 138 | extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type); |
| 139 | extern void usb_remove_phy(struct usb_phy *); | ||
| 125 | 140 | ||
| 126 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | 141 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
| 127 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 142 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
| @@ -172,16 +187,29 @@ usb_phy_shutdown(struct usb_phy *x) | |||
| 172 | 187 | ||
| 173 | /* for usb host and peripheral controller drivers */ | 188 | /* for usb host and peripheral controller drivers */ |
| 174 | #ifdef CONFIG_USB_OTG_UTILS | 189 | #ifdef CONFIG_USB_OTG_UTILS |
| 175 | extern struct usb_phy *usb_get_transceiver(void); | 190 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
| 176 | extern void usb_put_transceiver(struct usb_phy *); | 191 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, |
| 192 | enum usb_phy_type type); | ||
| 193 | extern void usb_put_phy(struct usb_phy *); | ||
| 194 | extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); | ||
| 177 | extern const char *otg_state_string(enum usb_otg_state state); | 195 | extern const char *otg_state_string(enum usb_otg_state state); |
| 178 | #else | 196 | #else |
| 179 | static inline struct usb_phy *usb_get_transceiver(void) | 197 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
| 198 | { | ||
| 199 | return NULL; | ||
| 200 | } | ||
| 201 | |||
| 202 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | ||
| 203 | enum usb_phy_type type) | ||
| 180 | { | 204 | { |
| 181 | return NULL; | 205 | return NULL; |
| 182 | } | 206 | } |
| 183 | 207 | ||
| 184 | static inline void usb_put_transceiver(struct usb_phy *x) | 208 | static inline void usb_put_phy(struct usb_phy *x) |
| 209 | { | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline void devm_usb_put_phy(struct device *dev, struct usb_phy *x) | ||
| 185 | { | 213 | { |
| 186 | } | 214 | } |
| 187 | 215 | ||
| @@ -252,6 +280,24 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend) | |||
| 252 | } | 280 | } |
| 253 | 281 | ||
| 254 | static inline int | 282 | static inline int |
| 283 | usb_phy_notify_connect(struct usb_phy *x, int port) | ||
| 284 | { | ||
| 285 | if (x->notify_connect) | ||
| 286 | return x->notify_connect(x, port); | ||
| 287 | else | ||
| 288 | return 0; | ||
| 289 | } | ||
| 290 | |||
| 291 | static inline int | ||
| 292 | usb_phy_notify_disconnect(struct usb_phy *x, int port) | ||
| 293 | { | ||
| 294 | if (x->notify_disconnect) | ||
| 295 | return x->notify_disconnect(x, port); | ||
| 296 | else | ||
| 297 | return 0; | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline int | ||
| 255 | otg_start_srp(struct usb_otg *otg) | 301 | otg_start_srp(struct usb_otg *otg) |
| 256 | { | 302 | { |
| 257 | if (otg && otg->start_srp) | 303 | if (otg && otg->start_srp) |
| @@ -276,4 +322,15 @@ usb_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) | |||
| 276 | /* for OTG controller drivers (and maybe other stuff) */ | 322 | /* for OTG controller drivers (and maybe other stuff) */ |
| 277 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 323 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
| 278 | 324 | ||
| 325 | static inline const char *usb_phy_type_string(enum usb_phy_type type) | ||
| 326 | { | ||
| 327 | switch (type) { | ||
| 328 | case USB_PHY_TYPE_USB2: | ||
| 329 | return "USB2 PHY"; | ||
| 330 | case USB_PHY_TYPE_USB3: | ||
| 331 | return "USB3 PHY"; | ||
| 332 | default: | ||
| 333 | return "UNKNOWN PHY TYPE"; | ||
| 334 | } | ||
| 335 | } | ||
| 279 | #endif /* __LINUX_USB_OTG_H */ | 336 | #endif /* __LINUX_USB_OTG_H */ |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index 547e59cc00ea..c5d36c65c33b 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
| @@ -132,6 +132,14 @@ struct renesas_usbhs_driver_param { | |||
| 132 | * option: | 132 | * option: |
| 133 | * | 133 | * |
| 134 | * dma id for dmaengine | 134 | * dma id for dmaengine |
| 135 | * The data transfer direction on D0FIFO/D1FIFO should be | ||
| 136 | * fixed for keeping consistency. | ||
| 137 | * So, the platform id settings will be.. | ||
| 138 | * .d0_tx_id = xx_TX, | ||
| 139 | * .d1_rx_id = xx_RX, | ||
| 140 | * or | ||
| 141 | * .d1_tx_id = xx_TX, | ||
| 142 | * .d0_rx_id = xx_RX, | ||
| 135 | */ | 143 | */ |
| 136 | int d0_tx_id; | 144 | int d0_tx_id; |
| 137 | int d0_rx_id; | 145 | int d0_rx_id; |
diff --git a/include/linux/usb/uas.h b/include/linux/usb/uas.h index 9a988e413694..5499ab5c94bd 100644 --- a/include/linux/usb/uas.h +++ b/include/linux/usb/uas.h | |||
| @@ -20,6 +20,28 @@ enum { | |||
| 20 | IU_ID_WRITE_READY = 0x07, | 20 | IU_ID_WRITE_READY = 0x07, |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | enum { | ||
| 24 | TMF_ABORT_TASK = 0x01, | ||
| 25 | TMF_ABORT_TASK_SET = 0x02, | ||
| 26 | TMF_CLEAR_TASK_SET = 0x04, | ||
| 27 | TMF_LOGICAL_UNIT_RESET = 0x08, | ||
| 28 | TMF_I_T_NEXUS_RESET = 0x10, | ||
| 29 | TMF_CLEAR_ACA = 0x40, | ||
| 30 | TMF_QUERY_TASK = 0x80, | ||
| 31 | TMF_QUERY_TASK_SET = 0x81, | ||
| 32 | TMF_QUERY_ASYNC_EVENT = 0x82, | ||
| 33 | }; | ||
| 34 | |||
| 35 | enum { | ||
| 36 | RC_TMF_COMPLETE = 0x00, | ||
| 37 | RC_INVALID_INFO_UNIT = 0x02, | ||
| 38 | RC_TMF_NOT_SUPPORTED = 0x04, | ||
| 39 | RC_TMF_FAILED = 0x05, | ||
| 40 | RC_TMF_SUCCEEDED = 0x08, | ||
| 41 | RC_INCORRECT_LUN = 0x09, | ||
| 42 | RC_OVERLAPPED_TAG = 0x0a, | ||
| 43 | }; | ||
| 44 | |||
| 23 | struct command_iu { | 45 | struct command_iu { |
| 24 | __u8 iu_id; | 46 | __u8 iu_id; |
| 25 | __u8 rsvd1; | 47 | __u8 rsvd1; |
| @@ -32,6 +54,16 @@ struct command_iu { | |||
| 32 | __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ | 54 | __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */ |
| 33 | }; | 55 | }; |
| 34 | 56 | ||
| 57 | struct task_mgmt_iu { | ||
| 58 | __u8 iu_id; | ||
| 59 | __u8 rsvd1; | ||
| 60 | __be16 tag; | ||
| 61 | __u8 function; | ||
| 62 | __u8 rsvd2; | ||
| 63 | __be16 task_tag; | ||
| 64 | struct scsi_lun lun; | ||
| 65 | }; | ||
| 66 | |||
| 35 | /* | 67 | /* |
| 36 | * Also used for the Read Ready and Write Ready IUs since they have the | 68 | * Also used for the Read Ready and Write Ready IUs since they have the |
| 37 | * same first four bytes | 69 | * same first four bytes |
| @@ -47,6 +79,14 @@ struct sense_iu { | |||
| 47 | __u8 sense[SCSI_SENSE_BUFFERSIZE]; | 79 | __u8 sense[SCSI_SENSE_BUFFERSIZE]; |
| 48 | }; | 80 | }; |
| 49 | 81 | ||
| 82 | struct response_ui { | ||
| 83 | __u8 iu_id; | ||
| 84 | __u8 rsvd1; | ||
| 85 | __be16 tag; | ||
| 86 | __be16 add_response_info; | ||
| 87 | __u8 response_code; | ||
| 88 | }; | ||
| 89 | |||
| 50 | struct usb_pipe_usage_descriptor { | 90 | struct usb_pipe_usage_descriptor { |
| 51 | __u8 bLength; | 91 | __u8 bLength; |
| 52 | __u8 bDescriptorType; | 92 | __u8 bDescriptorType; |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 15591d2ea400..3b74666be027 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
| @@ -125,6 +125,12 @@ struct usbdevfs_hub_portinfo { | |||
| 125 | char port [127]; /* e.g. port 3 connects to device 27 */ | 125 | char port [127]; /* e.g. port 3 connects to device 27 */ |
| 126 | }; | 126 | }; |
| 127 | 127 | ||
| 128 | /* Device capability flags */ | ||
| 129 | #define USBDEVFS_CAP_ZERO_PACKET 0x01 | ||
| 130 | #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 | ||
| 131 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 | ||
| 132 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 | ||
| 133 | |||
| 128 | #ifdef __KERNEL__ | 134 | #ifdef __KERNEL__ |
| 129 | #ifdef CONFIG_COMPAT | 135 | #ifdef CONFIG_COMPAT |
| 130 | #include <linux/compat.h> | 136 | #include <linux/compat.h> |
| @@ -204,4 +210,6 @@ struct usbdevfs_ioctl32 { | |||
| 204 | #define USBDEVFS_CONNECT _IO('U', 23) | 210 | #define USBDEVFS_CONNECT _IO('U', 23) |
| 205 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) | 211 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) |
| 206 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) | 212 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) |
| 213 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) | ||
| 214 | |||
| 207 | #endif /* _LINUX_USBDEVICE_FS_H */ | 215 | #endif /* _LINUX_USBDEVICE_FS_H */ |
