diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
commit | 7f5b09c15ab989ed5ce4adda0be42c1302df70b7 (patch) | |
tree | 9695b00983d1bd077ff91c463abcb136330cf344 /include | |
parent | 94468080220162f74dc6ce5c3e95e5fec8022902 (diff) | |
parent | cedf8a78421943441b9011ce7bcdab55f07d2ea6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (220 commits)
USB: backlight, appledisplay: fix incomplete registration failure handling
USB: pl2303: remove unnecessary reset of usb_device in urbs
USB: ftdi_sio: remove obsolete check in unthrottle
USB: ftdi_sio: remove unused tx_bytes counter
USB: qcaux: driver for auxiliary serial ports on Qualcomm devices
USB: pl2303: initial TIOCGSERIAL support
USB: option: add Longcheer/Longsung vendor ID
USB: fix I2C API usage in ohci-pnx4008.
USB: usbmon: mask seconds properly in text API
USB: sisusbvga: no unnecessary GFP_ATOMIC
USB: storage: onetouch: unnecessary GFP_ATOMIC
USB: serial: ftdi: add CONTEC vendor and product id
USB: remove references to port->port.count from the serial drivers
USB: tty: Prune uses of tty_request_room in the USB layer
USB: tty: Add a function to insert a string of characters with the same flag
USB: don't read past config->interface[] if usb_control_msg() fails in usb_reset_configuration()
USB: tty: kill request_room for USB ACM class
USB: tty: sort out the request_room handling for whiteheat
USB: storage: fix misplaced parenthesis
USB: vstusb.c: removal of driver for Vernier Software & Technology, Inc., devices and spectrometers
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tty_flip.h | 7 | ||||
-rw-r--r-- | include/linux/usb.h | 53 | ||||
-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 | 23 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 25 | ||||
-rw-r--r-- | include/linux/usb/quirks.h | 3 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 13 | ||||
-rw-r--r-- | include/linux/usb/vstusb.h | 71 |
10 files changed, 74 insertions, 125 deletions
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index eb677cf56106..9239d033a0a3 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
3 | 3 | ||
4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); | 4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); |
5 | extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size); | ||
6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); | 5 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); |
6 | extern int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, const unsigned char *chars, char flag, size_t size); | ||
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); |
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); |
9 | void tty_schedule_flip(struct tty_struct *tty); | 9 | void tty_schedule_flip(struct tty_struct *tty); |
@@ -20,4 +20,9 @@ static inline int tty_insert_flip_char(struct tty_struct *tty, | |||
20 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 20 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size) | ||
24 | { | ||
25 | return tty_insert_flip_string_fixed_flag(tty, chars, TTY_NORMAL, size); | ||
26 | } | ||
27 | |||
23 | #endif /* _LINUX_TTY_FLIP_H */ | 28 | #endif /* _LINUX_TTY_FLIP_H */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 332eaea61021..3492abf82e75 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -122,7 +122,6 @@ enum usb_interface_condition { | |||
122 | * number from the USB core by calling usb_register_dev(). | 122 | * number from the USB core by calling usb_register_dev(). |
123 | * @condition: binding state of the interface: not bound, binding | 123 | * @condition: binding state of the interface: not bound, binding |
124 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 124 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
125 | * @is_active: flag set when the interface is bound and not suspended. | ||
126 | * @sysfs_files_created: sysfs attributes exist | 125 | * @sysfs_files_created: sysfs attributes exist |
127 | * @ep_devs_created: endpoint child pseudo-devices exist | 126 | * @ep_devs_created: endpoint child pseudo-devices exist |
128 | * @unregistering: flag set when the interface is being unregistered | 127 | * @unregistering: flag set when the interface is being unregistered |
@@ -135,8 +134,7 @@ enum usb_interface_condition { | |||
135 | * @dev: driver model's view of this device | 134 | * @dev: driver model's view of this device |
136 | * @usb_dev: if an interface is bound to the USB major, this will point | 135 | * @usb_dev: if an interface is bound to the USB major, this will point |
137 | * to the sysfs representation for that device. | 136 | * to the sysfs representation for that device. |
138 | * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not | 137 | * @pm_usage_cnt: PM usage counter for this interface |
139 | * allowed unless the counter is 0. | ||
140 | * @reset_ws: Used for scheduling resets from atomic context. | 138 | * @reset_ws: Used for scheduling resets from atomic context. |
141 | * @reset_running: set to 1 if the interface is currently running a | 139 | * @reset_running: set to 1 if the interface is currently running a |
142 | * queued reset so that usb_cancel_queued_reset() doesn't try to | 140 | * queued reset so that usb_cancel_queued_reset() doesn't try to |
@@ -184,7 +182,6 @@ struct usb_interface { | |||
184 | int minor; /* minor number this interface is | 182 | int minor; /* minor number this interface is |
185 | * bound to */ | 183 | * bound to */ |
186 | enum usb_interface_condition condition; /* state of binding */ | 184 | enum usb_interface_condition condition; /* state of binding */ |
187 | unsigned is_active:1; /* the interface is not suspended */ | ||
188 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 185 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
189 | unsigned ep_devs_created:1; /* endpoint "devices" exist */ | 186 | unsigned ep_devs_created:1; /* endpoint "devices" exist */ |
190 | unsigned unregistering:1; /* unregistration is in progress */ | 187 | unsigned unregistering:1; /* unregistration is in progress */ |
@@ -401,7 +398,6 @@ struct usb_tt; | |||
401 | * @portnum: parent port number (origin 1) | 398 | * @portnum: parent port number (origin 1) |
402 | * @level: number of USB hub ancestors | 399 | * @level: number of USB hub ancestors |
403 | * @can_submit: URBs may be submitted | 400 | * @can_submit: URBs may be submitted |
404 | * @discon_suspended: disconnected while suspended | ||
405 | * @persist_enabled: USB_PERSIST enabled for this device | 401 | * @persist_enabled: USB_PERSIST enabled for this device |
406 | * @have_langid: whether string_langid is valid | 402 | * @have_langid: whether string_langid is valid |
407 | * @authorized: policy has said we can use it; | 403 | * @authorized: policy has said we can use it; |
@@ -421,20 +417,15 @@ struct usb_tt; | |||
421 | * @usbfs_dentry: usbfs dentry entry for the device | 417 | * @usbfs_dentry: usbfs dentry entry for the device |
422 | * @maxchild: number of ports if hub | 418 | * @maxchild: number of ports if hub |
423 | * @children: child devices - USB devices that are attached to this hub | 419 | * @children: child devices - USB devices that are attached to this hub |
424 | * @pm_usage_cnt: usage counter for autosuspend | ||
425 | * @quirks: quirks of the whole device | 420 | * @quirks: quirks of the whole device |
426 | * @urbnum: number of URBs submitted for the whole device | 421 | * @urbnum: number of URBs submitted for the whole device |
427 | * @active_duration: total time device is not suspended | 422 | * @active_duration: total time device is not suspended |
428 | * @autosuspend: for delayed autosuspends | ||
429 | * @autoresume: for autoresumes requested while in_interrupt | ||
430 | * @pm_mutex: protects PM operations | ||
431 | * @last_busy: time of last use | 423 | * @last_busy: time of last use |
432 | * @autosuspend_delay: in jiffies | 424 | * @autosuspend_delay: in jiffies |
433 | * @connect_time: time device was first connected | 425 | * @connect_time: time device was first connected |
434 | * @do_remote_wakeup: remote wakeup should be enabled | 426 | * @do_remote_wakeup: remote wakeup should be enabled |
435 | * @reset_resume: needs reset instead of resume | 427 | * @reset_resume: needs reset instead of resume |
436 | * @autosuspend_disabled: autosuspend disabled by the user | 428 | * @autosuspend_disabled: autosuspend disabled by the user |
437 | * @skip_sys_resume: skip the next system resume | ||
438 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 429 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
439 | * specific data for the device. | 430 | * specific data for the device. |
440 | * @slot_id: Slot ID assigned by xHCI | 431 | * @slot_id: Slot ID assigned by xHCI |
@@ -475,7 +466,6 @@ struct usb_device { | |||
475 | u8 level; | 466 | u8 level; |
476 | 467 | ||
477 | unsigned can_submit:1; | 468 | unsigned can_submit:1; |
478 | unsigned discon_suspended:1; | ||
479 | unsigned persist_enabled:1; | 469 | unsigned persist_enabled:1; |
480 | unsigned have_langid:1; | 470 | unsigned have_langid:1; |
481 | unsigned authorized:1; | 471 | unsigned authorized:1; |
@@ -499,17 +489,12 @@ struct usb_device { | |||
499 | int maxchild; | 489 | int maxchild; |
500 | struct usb_device *children[USB_MAXCHILDREN]; | 490 | struct usb_device *children[USB_MAXCHILDREN]; |
501 | 491 | ||
502 | int pm_usage_cnt; | ||
503 | u32 quirks; | 492 | u32 quirks; |
504 | atomic_t urbnum; | 493 | atomic_t urbnum; |
505 | 494 | ||
506 | unsigned long active_duration; | 495 | unsigned long active_duration; |
507 | 496 | ||
508 | #ifdef CONFIG_PM | 497 | #ifdef CONFIG_PM |
509 | struct delayed_work autosuspend; | ||
510 | struct work_struct autoresume; | ||
511 | struct mutex pm_mutex; | ||
512 | |||
513 | unsigned long last_busy; | 498 | unsigned long last_busy; |
514 | int autosuspend_delay; | 499 | int autosuspend_delay; |
515 | unsigned long connect_time; | 500 | unsigned long connect_time; |
@@ -517,7 +502,6 @@ struct usb_device { | |||
517 | unsigned do_remote_wakeup:1; | 502 | unsigned do_remote_wakeup:1; |
518 | unsigned reset_resume:1; | 503 | unsigned reset_resume:1; |
519 | unsigned autosuspend_disabled:1; | 504 | unsigned autosuspend_disabled:1; |
520 | unsigned skip_sys_resume:1; | ||
521 | #endif | 505 | #endif |
522 | struct wusb_dev *wusb_dev; | 506 | struct wusb_dev *wusb_dev; |
523 | int slot_id; | 507 | int slot_id; |
@@ -542,21 +526,15 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
542 | 526 | ||
543 | /* USB autosuspend and autoresume */ | 527 | /* USB autosuspend and autoresume */ |
544 | #ifdef CONFIG_USB_SUSPEND | 528 | #ifdef CONFIG_USB_SUSPEND |
529 | extern int usb_enable_autosuspend(struct usb_device *udev); | ||
530 | extern int usb_disable_autosuspend(struct usb_device *udev); | ||
531 | |||
545 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 532 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
546 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 533 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
547 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | 534 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); |
548 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | 535 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); |
549 | 536 | extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf); | |
550 | static inline void usb_autopm_get_interface_no_resume( | 537 | extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf); |
551 | struct usb_interface *intf) | ||
552 | { | ||
553 | atomic_inc(&intf->pm_usage_cnt); | ||
554 | } | ||
555 | static inline void usb_autopm_put_interface_no_suspend( | ||
556 | struct usb_interface *intf) | ||
557 | { | ||
558 | atomic_dec(&intf->pm_usage_cnt); | ||
559 | } | ||
560 | 538 | ||
561 | static inline void usb_mark_last_busy(struct usb_device *udev) | 539 | static inline void usb_mark_last_busy(struct usb_device *udev) |
562 | { | 540 | { |
@@ -565,6 +543,11 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
565 | 543 | ||
566 | #else | 544 | #else |
567 | 545 | ||
546 | static inline int usb_enable_autosuspend(struct usb_device *udev) | ||
547 | { return 0; } | ||
548 | static inline int usb_disable_autosuspend(struct usb_device *udev) | ||
549 | { return 0; } | ||
550 | |||
568 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 551 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
569 | { return 0; } | 552 | { return 0; } |
570 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | 553 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) |
@@ -1583,14 +1566,18 @@ extern void usb_register_notify(struct notifier_block *nb); | |||
1583 | extern void usb_unregister_notify(struct notifier_block *nb); | 1566 | extern void usb_unregister_notify(struct notifier_block *nb); |
1584 | 1567 | ||
1585 | #ifdef DEBUG | 1568 | #ifdef DEBUG |
1586 | #define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ | 1569 | #define dbg(format, arg...) \ |
1587 | __FILE__ , ## arg) | 1570 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg) |
1588 | #else | 1571 | #else |
1589 | #define dbg(format, arg...) do {} while (0) | 1572 | #define dbg(format, arg...) \ |
1573 | do { \ | ||
1574 | if (0) \ | ||
1575 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | ||
1576 | } while (0) | ||
1590 | #endif | 1577 | #endif |
1591 | 1578 | ||
1592 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ | 1579 | #define err(format, arg...) \ |
1593 | format "\n" , ## arg) | 1580 | printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg) |
1594 | 1581 | ||
1595 | /* debugfs stuff */ | 1582 | /* debugfs stuff */ |
1596 | extern struct dentry *usb_debug_root; | 1583 | extern struct dentry *usb_debug_root; |
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 5dc2f227a0f1..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 | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index fef0972c8146..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; |
@@ -213,6 +226,18 @@ otg_start_srp(struct otg_transceiver *otg) | |||
213 | return otg->start_srp(otg); | 226 | return otg->start_srp(otg); |
214 | } | 227 | } |
215 | 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 | } | ||
216 | 241 | ||
217 | /* for OTG controller drivers (and maybe other stuff) */ | 242 | /* for OTG controller drivers (and maybe other stuff) */ |
218 | 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/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) | ||