diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-03-22 12:05:48 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-03-22 12:05:48 -0400 |
commit | 2fb20b61550d3c5335e59819ed22734900d4d6e3 (patch) | |
tree | 5ac7690306a0230b51e79afe5cfd3e6575b98cb1 /include/linux/usb | |
parent | 23caaf19b11eda7054348452e1618d4512a86907 (diff) | |
parent | 6da7a2aa899f75116e1a62cef78c358ada9878b7 (diff) |
Merge branch 'topic/misc' into topic/usb
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/ch9.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 |
9 files changed, 61 insertions, 112 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/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/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) | ||