aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 13:23:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 13:23:47 -0400
commit9fc377799bc9bfd8d5cb35d0d1ea2e2458cbdbb3 (patch)
treefe93603b4e33dd50ff5f95ff769a0748b230cdf9 /include/linux/usb
parent5e23ae49960d05f578a73ecd19749c45af682c2b (diff)
parente387ef5c47ddeaeaa3cbdc54424cdb7a28dae2c0 (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/usb')
-rw-r--r--include/linux/usb/chipidea.h14
-rw-r--r--include/linux/usb/ehci_def.h28
-rw-r--r--include/linux/usb/hcd.h6
-rw-r--r--include/linux/usb/musb-omap.h30
-rw-r--r--include/linux/usb/otg.h67
-rw-r--r--include/linux/usb/renesas_usbhs.h8
-rw-r--r--include/linux/usb/uas.h40
7 files changed, 179 insertions, 14 deletions
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index edb90d6cfd1..544825dde82 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
8struct ci13xxx; 10struct ci13xxx;
9struct ci13xxx_udc_driver { 11struct 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 */
32struct platform_device *ci13xxx_add_device(struct device *dev,
33 struct resource *res, int nres,
34 struct ci13xxx_platform_data *platdata);
35/* Remove ci13xxx device */
36void 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 7cc95ee3606..de4b9ed5d5d 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 49b3ac29726..c5fdb148fc0 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 00000000000..7774c5986f0
--- /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
13enum 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))
23void omap_musb_mailbox(enum omap_musb_vbus_id_status status);
24#else
25static 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 38ab3f46346..45824be0a2f 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 */
47enum usb_phy_type {
48 USB_PHY_TYPE_UNDEFINED,
49 USB_PHY_TYPE_USB2,
50 USB_PHY_TYPE_USB3,
51};
52
46struct usb_phy; 53struct 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 */
124extern int usb_set_transceiver(struct usb_phy *); 138extern int usb_add_phy(struct usb_phy *, enum usb_phy_type type);
139extern 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
175extern struct usb_phy *usb_get_transceiver(void); 190extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
176extern void usb_put_transceiver(struct usb_phy *); 191extern struct usb_phy *devm_usb_get_phy(struct device *dev,
192 enum usb_phy_type type);
193extern void usb_put_phy(struct usb_phy *);
194extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
177extern const char *otg_state_string(enum usb_otg_state state); 195extern const char *otg_state_string(enum usb_otg_state state);
178#else 196#else
179static inline struct usb_phy *usb_get_transceiver(void) 197static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
198{
199 return NULL;
200}
201
202static 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
184static inline void usb_put_transceiver(struct usb_phy *x) 208static inline void usb_put_phy(struct usb_phy *x)
209{
210}
211
212static 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
254static inline int 282static inline int
283usb_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
291static inline int
292usb_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
300static inline int
255otg_start_srp(struct usb_otg *otg) 301otg_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) */
277extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 323extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
278 324
325static 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 547e59cc00e..c5d36c65c33 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 9a988e41369..5499ab5c94b 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
23enum {
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
35enum {
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
23struct command_iu { 45struct 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
57struct 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
82struct response_ui {
83 __u8 iu_id;
84 __u8 rsvd1;
85 __be16 tag;
86 __be16 add_response_info;
87 __u8 response_code;
88};
89
50struct usb_pipe_usage_descriptor { 90struct usb_pipe_usage_descriptor {
51 __u8 bLength; 91 __u8 bLength;
52 __u8 bDescriptorType; 92 __u8 bDescriptorType;