diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_bus.h | 36 | ||||
-rw-r--r-- | include/linux/bcma/bcma.h | 1 | ||||
-rw-r--r-- | include/linux/fsl_devices.h | 9 | ||||
-rw-r--r-- | include/linux/platform_data/ehci-sh.h | 28 | ||||
-rw-r--r-- | include/linux/platform_data/s3c-hsotg.h | 35 | ||||
-rw-r--r-- | include/linux/usb.h | 79 | ||||
-rw-r--r-- | include/linux/usb/ch11.h | 2 | ||||
-rw-r--r-- | include/linux/usb/ch9.h | 58 | ||||
-rw-r--r-- | include/linux/usb/chipidea.h | 28 | ||||
-rw-r--r-- | include/linux/usb/composite.h | 6 | ||||
-rw-r--r-- | include/linux/usb/functionfs.h | 4 | ||||
-rw-r--r-- | include/linux/usb/gpio_vbus.h | 2 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 32 | ||||
-rw-r--r-- | include/linux/usb/isp1301.h | 80 | ||||
-rw-r--r-- | include/linux/usb/langwell_udc.h | 310 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 34 |
16 files changed, 383 insertions, 361 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f1c8ca60e82..b0d62820ada 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -51,6 +51,37 @@ acpi_evaluate_reference(acpi_handle handle, | |||
51 | struct acpi_object_list *arguments, | 51 | struct acpi_object_list *arguments, |
52 | struct acpi_handle_list *list); | 52 | struct acpi_handle_list *list); |
53 | 53 | ||
54 | struct acpi_pld { | ||
55 | unsigned int revision:7; /* 0 */ | ||
56 | unsigned int ignore_colour:1; /* 7 */ | ||
57 | unsigned int colour:24; /* 8 */ | ||
58 | unsigned int width:16; /* 32 */ | ||
59 | unsigned int height:16; /* 48 */ | ||
60 | unsigned int user_visible:1; /* 64 */ | ||
61 | unsigned int dock:1; /* 65 */ | ||
62 | unsigned int lid:1; /* 66 */ | ||
63 | unsigned int panel:3; /* 67 */ | ||
64 | unsigned int vertical_pos:2; /* 70 */ | ||
65 | unsigned int horizontal_pos:2; /* 72 */ | ||
66 | unsigned int shape:4; /* 74 */ | ||
67 | unsigned int group_orientation:1; /* 78 */ | ||
68 | unsigned int group_token:8; /* 79 */ | ||
69 | unsigned int group_position:8; /* 87 */ | ||
70 | unsigned int bay:1; /* 95 */ | ||
71 | unsigned int ejectable:1; /* 96 */ | ||
72 | unsigned int ospm_eject_required:1; /* 97 */ | ||
73 | unsigned int cabinet_number:8; /* 98 */ | ||
74 | unsigned int card_cage_number:8; /* 106 */ | ||
75 | unsigned int reference:1; /* 114 */ | ||
76 | unsigned int rotation:4; /* 115 */ | ||
77 | unsigned int order:5; /* 119 */ | ||
78 | unsigned int reserved:4; /* 124 */ | ||
79 | unsigned int vertical_offset:16; /* 128 */ | ||
80 | unsigned int horizontal_offset:16; /* 144 */ | ||
81 | } __attribute__((__packed__)); | ||
82 | |||
83 | acpi_status | ||
84 | acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld); | ||
54 | #ifdef CONFIG_ACPI | 85 | #ifdef CONFIG_ACPI |
55 | 86 | ||
56 | #include <linux/proc_fs.h> | 87 | #include <linux/proc_fs.h> |
@@ -407,6 +438,11 @@ static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | |||
407 | } | 438 | } |
408 | #endif | 439 | #endif |
409 | 440 | ||
441 | #else /* CONFIG_ACPI */ | ||
442 | |||
443 | static int register_acpi_bus_type(struct acpi_bus_type *bus) { return 0; } | ||
444 | static int unregister_acpi_bus_type(struct acpi_bus_type *bus) { return 0; } | ||
445 | |||
410 | #endif /* CONFIG_ACPI */ | 446 | #endif /* CONFIG_ACPI */ |
411 | 447 | ||
412 | #endif /*__ACPI_BUS_H__*/ | 448 | #endif /*__ACPI_BUS_H__*/ |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 5af9a075498..98bb2901d7b 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -139,6 +139,7 @@ struct bcma_device { | |||
139 | u8 core_unit; | 139 | u8 core_unit; |
140 | 140 | ||
141 | u32 addr; | 141 | u32 addr; |
142 | u32 addr1; | ||
142 | u32 wrap; | 143 | u32 wrap; |
143 | 144 | ||
144 | void __iomem *io_addr; | 145 | void __iomem *io_addr; |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index fffdf00f87b..15be561e739 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> | 7 | * Maintainer: Kumar Gala <galak@kernel.crashing.org> |
8 | * | 8 | * |
9 | * Copyright 2004 Freescale Semiconductor, Inc | 9 | * Copyright 2004,2012 Freescale Semiconductor, Inc |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify it | 11 | * This program is free software; you can redistribute it and/or modify it |
12 | * under the terms of the GNU General Public License as published by the | 12 | * under the terms of the GNU General Public License as published by the |
@@ -17,6 +17,12 @@ | |||
17 | #ifndef _FSL_DEVICE_H_ | 17 | #ifndef _FSL_DEVICE_H_ |
18 | #define _FSL_DEVICE_H_ | 18 | #define _FSL_DEVICE_H_ |
19 | 19 | ||
20 | #define FSL_UTMI_PHY_DLY 10 /*As per P1010RM, delay for UTMI | ||
21 | PHY CLK to become stable - 10ms*/ | ||
22 | #define FSL_USB_VER_OLD 0 | ||
23 | #define FSL_USB_VER_1_6 1 | ||
24 | #define FSL_USB_VER_2_2 2 | ||
25 | |||
20 | #include <linux/types.h> | 26 | #include <linux/types.h> |
21 | 27 | ||
22 | /* | 28 | /* |
@@ -63,6 +69,7 @@ struct platform_device; | |||
63 | 69 | ||
64 | struct fsl_usb2_platform_data { | 70 | struct fsl_usb2_platform_data { |
65 | /* board specific information */ | 71 | /* board specific information */ |
72 | int controller_ver; | ||
66 | enum fsl_usb2_operating_modes operating_mode; | 73 | enum fsl_usb2_operating_modes operating_mode; |
67 | enum fsl_usb2_phy_modes phy_mode; | 74 | enum fsl_usb2_phy_modes phy_mode; |
68 | unsigned int port_enables; | 75 | unsigned int port_enables; |
diff --git a/include/linux/platform_data/ehci-sh.h b/include/linux/platform_data/ehci-sh.h new file mode 100644 index 00000000000..5c15a738e11 --- /dev/null +++ b/include/linux/platform_data/ehci-sh.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * EHCI SuperH driver platform data | ||
3 | * | ||
4 | * Copyright (C) 2012 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> | ||
5 | * Copyright (C) 2012 Renesas Solutions Corp. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __USB_EHCI_SH_H | ||
22 | #define __USB_EHCI_SH_H | ||
23 | |||
24 | struct ehci_sh_platdata { | ||
25 | void (*phy_init)(void); /* Phy init function */ | ||
26 | }; | ||
27 | |||
28 | #endif /* __USB_EHCI_SH_H */ | ||
diff --git a/include/linux/platform_data/s3c-hsotg.h b/include/linux/platform_data/s3c-hsotg.h new file mode 100644 index 00000000000..97ec12c2ded --- /dev/null +++ b/include/linux/platform_data/s3c-hsotg.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* include/linux/platform_data/s3c-hsotg.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * http://armlinux.simtec.co.uk/ | ||
7 | * | ||
8 | * S3C USB2.0 High-speed / OtG platform information | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | enum s3c_hsotg_dmamode { | ||
16 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ | ||
17 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ | ||
18 | S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */ | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * struct s3c_hsotg_plat - platform data for high-speed otg/udc | ||
23 | * @dma: Whether to use DMA or not. | ||
24 | * @is_osc: The clock source is an oscillator, not a crystal | ||
25 | */ | ||
26 | struct s3c_hsotg_plat { | ||
27 | enum s3c_hsotg_dmamode dma; | ||
28 | unsigned int is_osc:1; | ||
29 | int phy_type; | ||
30 | |||
31 | int (*phy_init)(struct platform_device *pdev, int type); | ||
32 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
33 | }; | ||
34 | |||
35 | extern void s3c_hsotg_set_platdata(struct s3c_hsotg_plat *pd); | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 73b68d1f2cb..dea39dc551d 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -351,10 +351,6 @@ struct usb_bus { | |||
351 | int bandwidth_int_reqs; /* number of Interrupt requests */ | 351 | int bandwidth_int_reqs; /* number of Interrupt requests */ |
352 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ | 352 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ |
353 | 353 | ||
354 | #ifdef CONFIG_USB_DEVICEFS | ||
355 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | ||
356 | #endif | ||
357 | |||
358 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 354 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
359 | struct mon_bus *mon_bus; /* non-null when associated */ | 355 | struct mon_bus *mon_bus; /* non-null when associated */ |
360 | int monitored; /* non-zero when monitored */ | 356 | int monitored; /* non-zero when monitored */ |
@@ -382,6 +378,45 @@ enum usb_device_removable { | |||
382 | USB_DEVICE_FIXED, | 378 | USB_DEVICE_FIXED, |
383 | }; | 379 | }; |
384 | 380 | ||
381 | /* | ||
382 | * USB 3.0 Link Power Management (LPM) parameters. | ||
383 | * | ||
384 | * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit. | ||
385 | * MEL is the USB 3.0 Link PM latency for host-initiated LPM exit. | ||
386 | * All three are stored in nanoseconds. | ||
387 | */ | ||
388 | struct usb3_lpm_parameters { | ||
389 | /* | ||
390 | * Maximum exit latency (MEL) for the host to send a packet to the | ||
391 | * device (either a Ping for isoc endpoints, or a data packet for | ||
392 | * interrupt endpoints), the hubs to decode the packet, and for all hubs | ||
393 | * in the path to transition the links to U0. | ||
394 | */ | ||
395 | unsigned int mel; | ||
396 | /* | ||
397 | * Maximum exit latency for a device-initiated LPM transition to bring | ||
398 | * all links into U0. Abbreviated as "PEL" in section 9.4.12 of the USB | ||
399 | * 3.0 spec, with no explanation of what "P" stands for. "Path"? | ||
400 | */ | ||
401 | unsigned int pel; | ||
402 | |||
403 | /* | ||
404 | * The System Exit Latency (SEL) includes PEL, and three other | ||
405 | * latencies. After a device initiates a U0 transition, it will take | ||
406 | * some time from when the device sends the ERDY to when it will finally | ||
407 | * receive the data packet. Basically, SEL should be the worse-case | ||
408 | * latency from when a device starts initiating a U0 transition to when | ||
409 | * it will get data. | ||
410 | */ | ||
411 | unsigned int sel; | ||
412 | /* | ||
413 | * The idle timeout value that is currently programmed into the parent | ||
414 | * hub for this device. When the timer counts to zero, the parent hub | ||
415 | * will initiate an LPM transition to either U1 or U2. | ||
416 | */ | ||
417 | int timeout; | ||
418 | }; | ||
419 | |||
385 | /** | 420 | /** |
386 | * struct usb_device - kernel's representation of a USB device | 421 | * struct usb_device - kernel's representation of a USB device |
387 | * @devnum: device number; address on a USB bus | 422 | * @devnum: device number; address on a USB bus |
@@ -439,6 +474,12 @@ enum usb_device_removable { | |||
439 | * specific data for the device. | 474 | * specific data for the device. |
440 | * @slot_id: Slot ID assigned by xHCI | 475 | * @slot_id: Slot ID assigned by xHCI |
441 | * @removable: Device can be physically removed from this port | 476 | * @removable: Device can be physically removed from this port |
477 | * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout. | ||
478 | * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout. | ||
479 | * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm() | ||
480 | * to keep track of the number of functions that require USB 3.0 Link Power | ||
481 | * Management to be disabled for this usb_device. This count should only | ||
482 | * be manipulated by those functions, with the bandwidth_mutex is held. | ||
442 | * | 483 | * |
443 | * Notes: | 484 | * Notes: |
444 | * Usbcore drivers should not set usbdev->state directly. Instead use | 485 | * Usbcore drivers should not set usbdev->state directly. Instead use |
@@ -485,6 +526,7 @@ struct usb_device { | |||
485 | unsigned lpm_capable:1; | 526 | unsigned lpm_capable:1; |
486 | unsigned usb2_hw_lpm_capable:1; | 527 | unsigned usb2_hw_lpm_capable:1; |
487 | unsigned usb2_hw_lpm_enabled:1; | 528 | unsigned usb2_hw_lpm_enabled:1; |
529 | unsigned usb3_lpm_enabled:1; | ||
488 | int string_langid; | 530 | int string_langid; |
489 | 531 | ||
490 | /* static strings from the device */ | 532 | /* static strings from the device */ |
@@ -493,12 +535,6 @@ struct usb_device { | |||
493 | char *serial; | 535 | char *serial; |
494 | 536 | ||
495 | struct list_head filelist; | 537 | struct list_head filelist; |
496 | #ifdef CONFIG_USB_DEVICE_CLASS | ||
497 | struct device *usb_classdev; | ||
498 | #endif | ||
499 | #ifdef CONFIG_USB_DEVICEFS | ||
500 | struct dentry *usbfs_dentry; | ||
501 | #endif | ||
502 | 538 | ||
503 | int maxchild; | 539 | int maxchild; |
504 | struct usb_device **children; | 540 | struct usb_device **children; |
@@ -517,6 +553,10 @@ struct usb_device { | |||
517 | struct wusb_dev *wusb_dev; | 553 | struct wusb_dev *wusb_dev; |
518 | int slot_id; | 554 | int slot_id; |
519 | enum usb_device_removable removable; | 555 | enum usb_device_removable removable; |
556 | struct usb3_lpm_parameters u1_params; | ||
557 | struct usb3_lpm_parameters u2_params; | ||
558 | unsigned lpm_disable_count; | ||
559 | unsigned hub_initiated_lpm_disable_count; | ||
520 | }; | 560 | }; |
521 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 561 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
522 | 562 | ||
@@ -583,6 +623,12 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
583 | { } | 623 | { } |
584 | #endif | 624 | #endif |
585 | 625 | ||
626 | extern int usb_disable_lpm(struct usb_device *udev); | ||
627 | extern void usb_enable_lpm(struct usb_device *udev); | ||
628 | /* Same as above, but these functions lock/unlock the bandwidth_mutex. */ | ||
629 | extern int usb_unlocked_disable_lpm(struct usb_device *udev); | ||
630 | extern void usb_unlocked_enable_lpm(struct usb_device *udev); | ||
631 | |||
586 | /*-------------------------------------------------------------------------*/ | 632 | /*-------------------------------------------------------------------------*/ |
587 | 633 | ||
588 | /* for drivers using iso endpoints */ | 634 | /* for drivers using iso endpoints */ |
@@ -800,6 +846,8 @@ extern ssize_t usb_store_new_id(struct usb_dynids *dynids, | |||
800 | struct device_driver *driver, | 846 | struct device_driver *driver, |
801 | const char *buf, size_t count); | 847 | const char *buf, size_t count); |
802 | 848 | ||
849 | extern ssize_t usb_show_dynids(struct usb_dynids *dynids, char *buf); | ||
850 | |||
803 | /** | 851 | /** |
804 | * struct usbdrv_wrap - wrapper for driver-model structure | 852 | * struct usbdrv_wrap - wrapper for driver-model structure |
805 | * @driver: The driver-model core driver structure. | 853 | * @driver: The driver-model core driver structure. |
@@ -850,6 +898,9 @@ struct usbdrv_wrap { | |||
850 | * for interfaces bound to this driver. | 898 | * for interfaces bound to this driver. |
851 | * @soft_unbind: if set to 1, the USB core will not kill URBs and disable | 899 | * @soft_unbind: if set to 1, the USB core will not kill URBs and disable |
852 | * endpoints before calling the driver's disconnect method. | 900 | * endpoints before calling the driver's disconnect method. |
901 | * @disable_hub_initiated_lpm: if set to 0, the USB core will not allow hubs | ||
902 | * to initiate lower power link state transitions when an idle timeout | ||
903 | * occurs. Device-initiated USB 3.0 link PM will still be allowed. | ||
853 | * | 904 | * |
854 | * USB interface drivers must provide a name, probe() and disconnect() | 905 | * USB interface drivers must provide a name, probe() and disconnect() |
855 | * methods, and an id_table. Other driver fields are optional. | 906 | * methods, and an id_table. Other driver fields are optional. |
@@ -890,6 +941,7 @@ struct usb_driver { | |||
890 | struct usbdrv_wrap drvwrap; | 941 | struct usbdrv_wrap drvwrap; |
891 | unsigned int no_dynamic_id:1; | 942 | unsigned int no_dynamic_id:1; |
892 | unsigned int supports_autosuspend:1; | 943 | unsigned int supports_autosuspend:1; |
944 | unsigned int disable_hub_initiated_lpm:1; | ||
893 | unsigned int soft_unbind:1; | 945 | unsigned int soft_unbind:1; |
894 | }; | 946 | }; |
895 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) | 947 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) |
@@ -1379,6 +1431,7 @@ extern int usb_unlink_urb(struct urb *urb); | |||
1379 | extern void usb_kill_urb(struct urb *urb); | 1431 | extern void usb_kill_urb(struct urb *urb); |
1380 | extern void usb_poison_urb(struct urb *urb); | 1432 | extern void usb_poison_urb(struct urb *urb); |
1381 | extern void usb_unpoison_urb(struct urb *urb); | 1433 | extern void usb_unpoison_urb(struct urb *urb); |
1434 | extern void usb_block_urb(struct urb *urb); | ||
1382 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); | 1435 | extern void usb_kill_anchored_urbs(struct usb_anchor *anchor); |
1383 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); | 1436 | extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); |
1384 | extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); | 1437 | extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); |
@@ -1391,6 +1444,8 @@ extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor); | |||
1391 | extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor); | 1444 | extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor); |
1392 | extern int usb_anchor_empty(struct usb_anchor *anchor); | 1445 | extern int usb_anchor_empty(struct usb_anchor *anchor); |
1393 | 1446 | ||
1447 | #define usb_unblock_urb usb_unpoison_urb | ||
1448 | |||
1394 | /** | 1449 | /** |
1395 | * usb_urb_dir_in - check if an URB describes an IN transfer | 1450 | * usb_urb_dir_in - check if an URB describes an IN transfer |
1396 | * @urb: URB to be checked | 1451 | * @urb: URB to be checked |
@@ -1627,6 +1682,7 @@ static inline int usb_translate_errors(int error_code) | |||
1627 | case 0: | 1682 | case 0: |
1628 | case -ENOMEM: | 1683 | case -ENOMEM: |
1629 | case -ENODEV: | 1684 | case -ENODEV: |
1685 | case -EOPNOTSUPP: | ||
1630 | return error_code; | 1686 | return error_code; |
1631 | default: | 1687 | default: |
1632 | return -EIO; | 1688 | return -EIO; |
@@ -1652,9 +1708,6 @@ do { \ | |||
1652 | } while (0) | 1708 | } while (0) |
1653 | #endif | 1709 | #endif |
1654 | 1710 | ||
1655 | #define err(format, arg...) \ | ||
1656 | printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg) | ||
1657 | |||
1658 | /* debugfs stuff */ | 1711 | /* debugfs stuff */ |
1659 | extern struct dentry *usb_debug_root; | 1712 | extern struct dentry *usb_debug_root; |
1660 | 1713 | ||
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index f1d26b6067f..b6c2863b2c9 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -76,6 +76,8 @@ | |||
76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 | 76 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 |
77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 | 77 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 |
78 | 78 | ||
79 | #define USB_PORT_LPM_TIMEOUT(p) (((p) & 0xff) << 8) | ||
80 | |||
79 | /* USB 3.0 hub remote wake mask bits, see table 10-14 */ | 81 | /* USB 3.0 hub remote wake mask bits, see table 10-14 */ |
80 | #define USB_PORT_FEAT_REMOTE_WAKE_CONNECT (1 << 8) | 82 | #define USB_PORT_FEAT_REMOTE_WAKE_CONNECT (1 << 8) |
81 | #define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT (1 << 9) | 83 | #define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT (1 << 9) |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index af21f311591..d1d732c2838 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -88,6 +88,8 @@ | |||
88 | #define USB_REQ_GET_INTERFACE 0x0A | 88 | #define USB_REQ_GET_INTERFACE 0x0A |
89 | #define USB_REQ_SET_INTERFACE 0x0B | 89 | #define USB_REQ_SET_INTERFACE 0x0B |
90 | #define USB_REQ_SYNCH_FRAME 0x0C | 90 | #define USB_REQ_SYNCH_FRAME 0x0C |
91 | #define USB_REQ_SET_SEL 0x30 | ||
92 | #define USB_REQ_SET_ISOCH_DELAY 0x31 | ||
91 | 93 | ||
92 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ | 94 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ |
93 | #define USB_REQ_GET_ENCRYPTION 0x0E | 95 | #define USB_REQ_GET_ENCRYPTION 0x0E |
@@ -390,6 +392,11 @@ struct usb_endpoint_descriptor { | |||
390 | #define USB_ENDPOINT_XFER_INT 3 | 392 | #define USB_ENDPOINT_XFER_INT 3 |
391 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 | 393 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 |
392 | 394 | ||
395 | /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */ | ||
396 | #define USB_ENDPOINT_INTRTYPE 0x30 | ||
397 | #define USB_ENDPOINT_INTR_PERIODIC (0 << 4) | ||
398 | #define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4) | ||
399 | |||
393 | #define USB_ENDPOINT_SYNCTYPE 0x0c | 400 | #define USB_ENDPOINT_SYNCTYPE 0x0c |
394 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | 401 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) |
395 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | 402 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) |
@@ -592,6 +599,12 @@ static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | |||
592 | return __le16_to_cpu(epd->wMaxPacketSize); | 599 | return __le16_to_cpu(epd->wMaxPacketSize); |
593 | } | 600 | } |
594 | 601 | ||
602 | static inline int usb_endpoint_interrupt_type( | ||
603 | const struct usb_endpoint_descriptor *epd) | ||
604 | { | ||
605 | return epd->bmAttributes & USB_ENDPOINT_INTRTYPE; | ||
606 | } | ||
607 | |||
595 | /*-------------------------------------------------------------------------*/ | 608 | /*-------------------------------------------------------------------------*/ |
596 | 609 | ||
597 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | 610 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ |
@@ -933,6 +946,51 @@ enum usb_device_state { | |||
933 | */ | 946 | */ |
934 | }; | 947 | }; |
935 | 948 | ||
949 | enum usb3_link_state { | ||
950 | USB3_LPM_U0 = 0, | ||
951 | USB3_LPM_U1, | ||
952 | USB3_LPM_U2, | ||
953 | USB3_LPM_U3 | ||
954 | }; | ||
955 | |||
956 | /* | ||
957 | * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1. | ||
958 | * 0xff means the parent hub will accept transitions to U1, but will not | ||
959 | * initiate a transition. | ||
960 | * | ||
961 | * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to | ||
962 | * U1 after that many microseconds. Timeouts of 0x80 to 0xFE are reserved | ||
963 | * values. | ||
964 | * | ||
965 | * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2. | ||
966 | * 0xff means the parent hub will accept transitions to U2, but will not | ||
967 | * initiate a transition. | ||
968 | * | ||
969 | * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to | ||
970 | * U2 after N*256 microseconds. Therefore a U2 timeout value of 0x1 means a U2 | ||
971 | * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means | ||
972 | * 65.024ms. | ||
973 | */ | ||
974 | #define USB3_LPM_DISABLED 0x0 | ||
975 | #define USB3_LPM_U1_MAX_TIMEOUT 0x7F | ||
976 | #define USB3_LPM_U2_MAX_TIMEOUT 0xFE | ||
977 | #define USB3_LPM_DEVICE_INITIATED 0xFF | ||
978 | |||
979 | struct usb_set_sel_req { | ||
980 | __u8 u1_sel; | ||
981 | __u8 u1_pel; | ||
982 | __le16 u2_sel; | ||
983 | __le16 u2_pel; | ||
984 | } __attribute__ ((packed)); | ||
985 | |||
986 | /* | ||
987 | * The Set System Exit Latency control transfer provides one byte each for | ||
988 | * U1 SEL and U1 PEL, so the max exit latency is 0xFF. U2 SEL and U2 PEL each | ||
989 | * are two bytes long. | ||
990 | */ | ||
991 | #define USB3_LPM_MAX_U1_SEL_PEL 0xFF | ||
992 | #define USB3_LPM_MAX_U2_SEL_PEL 0xFFFF | ||
993 | |||
936 | /*-------------------------------------------------------------------------*/ | 994 | /*-------------------------------------------------------------------------*/ |
937 | 995 | ||
938 | /* | 996 | /* |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h new file mode 100644 index 00000000000..edb90d6cfd1 --- /dev/null +++ b/include/linux/usb/chipidea.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Platform data for the chipidea USB dual role controller | ||
3 | */ | ||
4 | |||
5 | #ifndef __LINUX_USB_CHIPIDEA_H | ||
6 | #define __LINUX_USB_CHIPIDEA_H | ||
7 | |||
8 | struct ci13xxx; | ||
9 | struct ci13xxx_udc_driver { | ||
10 | const char *name; | ||
11 | /* offset of the capability registers */ | ||
12 | uintptr_t capoffset; | ||
13 | unsigned power_budget; | ||
14 | unsigned long flags; | ||
15 | #define CI13XXX_REGS_SHARED BIT(0) | ||
16 | #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) | ||
17 | #define CI13XXX_PULLUP_ON_VBUS BIT(2) | ||
18 | #define CI13XXX_DISABLE_STREAMING BIT(3) | ||
19 | |||
20 | #define CI13XXX_CONTROLLER_RESET_EVENT 0 | ||
21 | #define CI13XXX_CONTROLLER_STOPPED_EVENT 1 | ||
22 | void (*notify_event) (struct ci13xxx *udc, unsigned event); | ||
23 | }; | ||
24 | |||
25 | /* Default offset of capability registers */ | ||
26 | #define DEF_CAPOFFSET 0x100 | ||
27 | |||
28 | #endif | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index a316fba7351..9d8c3b63449 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -242,6 +242,9 @@ int usb_add_config(struct usb_composite_dev *, | |||
242 | struct usb_configuration *, | 242 | struct usb_configuration *, |
243 | int (*)(struct usb_configuration *)); | 243 | int (*)(struct usb_configuration *)); |
244 | 244 | ||
245 | void usb_remove_config(struct usb_composite_dev *, | ||
246 | struct usb_configuration *); | ||
247 | |||
245 | /** | 248 | /** |
246 | * struct usb_composite_driver - groups configurations into a gadget | 249 | * struct usb_composite_driver - groups configurations into a gadget |
247 | * @name: For diagnostics, identifies the driver. | 250 | * @name: For diagnostics, identifies the driver. |
@@ -250,6 +253,8 @@ int usb_add_config(struct usb_composite_dev *, | |||
250 | * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is | 253 | * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is |
251 | * not set. If NULL a default "<system> <release> with <udc>" value | 254 | * not set. If NULL a default "<system> <release> with <udc>" value |
252 | * will be used. | 255 | * will be used. |
256 | * @iSerialNumber: Used as iSerialNumber override if @dev->iSerialNumber is | ||
257 | * not set. | ||
253 | * @dev: Template descriptor for the device, including default device | 258 | * @dev: Template descriptor for the device, including default device |
254 | * identifiers. | 259 | * identifiers. |
255 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 260 | * @strings: tables of strings, keyed by identifiers assigned during bind() |
@@ -280,6 +285,7 @@ struct usb_composite_driver { | |||
280 | const char *name; | 285 | const char *name; |
281 | const char *iProduct; | 286 | const char *iProduct; |
282 | const char *iManufacturer; | 287 | const char *iManufacturer; |
288 | const char *iSerialNumber; | ||
283 | const struct usb_device_descriptor *dev; | 289 | const struct usb_device_descriptor *dev; |
284 | struct usb_gadget_strings **strings; | 290 | struct usb_gadget_strings **strings; |
285 | enum usb_device_speed max_speed; | 291 | enum usb_device_speed max_speed; |
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index 7587ef934ba..a843d085136 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
@@ -190,8 +190,10 @@ static int functionfs_ready_callback(struct ffs_data *ffs) | |||
190 | __attribute__((warn_unused_result, nonnull)); | 190 | __attribute__((warn_unused_result, nonnull)); |
191 | static void functionfs_closed_callback(struct ffs_data *ffs) | 191 | static void functionfs_closed_callback(struct ffs_data *ffs) |
192 | __attribute__((nonnull)); | 192 | __attribute__((nonnull)); |
193 | static int functionfs_check_dev_callback(const char *dev_name) | 193 | static void *functionfs_acquire_dev_callback(const char *dev_name) |
194 | __attribute__((warn_unused_result, nonnull)); | 194 | __attribute__((warn_unused_result, nonnull)); |
195 | static void functionfs_release_dev_callback(struct ffs_data *ffs_data) | ||
196 | __attribute__((nonnull)); | ||
195 | 197 | ||
196 | 198 | ||
197 | #endif | 199 | #endif |
diff --git a/include/linux/usb/gpio_vbus.h b/include/linux/usb/gpio_vbus.h index d9f03ccc2d6..837bba604a0 100644 --- a/include/linux/usb/gpio_vbus.h +++ b/include/linux/usb/gpio_vbus.h | |||
@@ -17,6 +17,7 @@ | |||
17 | * @gpio_pullup: optional D+ or D- pullup GPIO (else negative/invalid) | 17 | * @gpio_pullup: optional D+ or D- pullup GPIO (else negative/invalid) |
18 | * @gpio_vbus_inverted: true if gpio_vbus is active low | 18 | * @gpio_vbus_inverted: true if gpio_vbus is active low |
19 | * @gpio_pullup_inverted: true if gpio_pullup is active low | 19 | * @gpio_pullup_inverted: true if gpio_pullup is active low |
20 | * @wakeup: configure gpio_vbus as a wake-up source | ||
20 | * | 21 | * |
21 | * The VBUS sensing GPIO should have a pulldown, which will normally be | 22 | * The VBUS sensing GPIO should have a pulldown, which will normally be |
22 | * part of a resistor ladder turning a 4.0V-5.25V level on VBUS into a | 23 | * part of a resistor ladder turning a 4.0V-5.25V level on VBUS into a |
@@ -27,4 +28,5 @@ struct gpio_vbus_mach_info { | |||
27 | int gpio_pullup; | 28 | int gpio_pullup; |
28 | bool gpio_vbus_inverted; | 29 | bool gpio_vbus_inverted; |
29 | bool gpio_pullup_inverted; | 30 | bool gpio_pullup_inverted; |
31 | bool wakeup; | ||
30 | }; | 32 | }; |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index d28cc78a38e..7f855d50cdf 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -344,6 +344,15 @@ struct hc_driver { | |||
344 | */ | 344 | */ |
345 | int (*update_device)(struct usb_hcd *, struct usb_device *); | 345 | int (*update_device)(struct usb_hcd *, struct usb_device *); |
346 | int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int); | 346 | int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int); |
347 | /* USB 3.0 Link Power Management */ | ||
348 | /* Returns the USB3 hub-encoded value for the U1/U2 timeout. */ | ||
349 | int (*enable_usb3_lpm_timeout)(struct usb_hcd *, | ||
350 | struct usb_device *, enum usb3_link_state state); | ||
351 | /* The xHCI host controller can still fail the command to | ||
352 | * disable the LPM timeouts, so this can return an error code. | ||
353 | */ | ||
354 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, | ||
355 | struct usb_device *, enum usb3_link_state state); | ||
347 | }; | 356 | }; |
348 | 357 | ||
349 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 358 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
@@ -584,29 +593,6 @@ static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | |||
584 | } | 593 | } |
585 | #endif /* CONFIG_USB_SUSPEND */ | 594 | #endif /* CONFIG_USB_SUSPEND */ |
586 | 595 | ||
587 | |||
588 | /* | ||
589 | * USB device fs stuff | ||
590 | */ | ||
591 | |||
592 | #ifdef CONFIG_USB_DEVICEFS | ||
593 | |||
594 | /* | ||
595 | * these are expected to be called from the USB core/hub thread | ||
596 | * with the kernel lock held | ||
597 | */ | ||
598 | extern void usbfs_update_special(void); | ||
599 | extern int usbfs_init(void); | ||
600 | extern void usbfs_cleanup(void); | ||
601 | |||
602 | #else /* CONFIG_USB_DEVICEFS */ | ||
603 | |||
604 | static inline void usbfs_update_special(void) {} | ||
605 | static inline int usbfs_init(void) { return 0; } | ||
606 | static inline void usbfs_cleanup(void) { } | ||
607 | |||
608 | #endif /* CONFIG_USB_DEVICEFS */ | ||
609 | |||
610 | /*-------------------------------------------------------------------------*/ | 596 | /*-------------------------------------------------------------------------*/ |
611 | 597 | ||
612 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 598 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
diff --git a/include/linux/usb/isp1301.h b/include/linux/usb/isp1301.h new file mode 100644 index 00000000000..d3a851c28b6 --- /dev/null +++ b/include/linux/usb/isp1301.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * NXP ISP1301 USB transceiver driver | ||
3 | * | ||
4 | * Copyright (C) 2012 Roland Stigge <stigge@antcom.de> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | #ifndef __LINUX_USB_ISP1301_H | ||
18 | #define __LINUX_USB_ISP1301_H | ||
19 | |||
20 | #include <linux/of.h> | ||
21 | |||
22 | /* I2C Register definitions: */ | ||
23 | |||
24 | #define ISP1301_I2C_MODE_CONTROL_1 0x04 /* u8 read, set, +1 clear */ | ||
25 | |||
26 | #define MC1_SPEED_REG (1 << 0) | ||
27 | #define MC1_SUSPEND_REG (1 << 1) | ||
28 | #define MC1_DAT_SE0 (1 << 2) | ||
29 | #define MC1_TRANSPARENT (1 << 3) | ||
30 | #define MC1_BDIS_ACON_EN (1 << 4) | ||
31 | #define MC1_OE_INT_EN (1 << 5) | ||
32 | #define MC1_UART_EN (1 << 6) | ||
33 | #define MC1_MASK 0x7f | ||
34 | |||
35 | #define ISP1301_I2C_MODE_CONTROL_2 0x12 /* u8 read, set, +1 clear */ | ||
36 | |||
37 | #define MC2_GLOBAL_PWR_DN (1 << 0) | ||
38 | #define MC2_SPD_SUSP_CTRL (1 << 1) | ||
39 | #define MC2_BI_DI (1 << 2) | ||
40 | #define MC2_TRANSP_BDIR0 (1 << 3) | ||
41 | #define MC2_TRANSP_BDIR1 (1 << 4) | ||
42 | #define MC2_AUDIO_EN (1 << 5) | ||
43 | #define MC2_PSW_EN (1 << 6) | ||
44 | #define MC2_EN2V7 (1 << 7) | ||
45 | |||
46 | #define ISP1301_I2C_OTG_CONTROL_1 0x06 /* u8 read, set, +1 clear */ | ||
47 | |||
48 | #define OTG1_DP_PULLUP (1 << 0) | ||
49 | #define OTG1_DM_PULLUP (1 << 1) | ||
50 | #define OTG1_DP_PULLDOWN (1 << 2) | ||
51 | #define OTG1_DM_PULLDOWN (1 << 3) | ||
52 | #define OTG1_ID_PULLDOWN (1 << 4) | ||
53 | #define OTG1_VBUS_DRV (1 << 5) | ||
54 | #define OTG1_VBUS_DISCHRG (1 << 6) | ||
55 | #define OTG1_VBUS_CHRG (1 << 7) | ||
56 | |||
57 | #define ISP1301_I2C_OTG_CONTROL_2 0x10 /* u8 readonly */ | ||
58 | |||
59 | #define OTG_B_SESS_END (1 << 6) | ||
60 | #define OTG_B_SESS_VLD (1 << 7) | ||
61 | |||
62 | #define ISP1301_I2C_INTERRUPT_SOURCE 0x8 | ||
63 | #define ISP1301_I2C_INTERRUPT_LATCH 0xA | ||
64 | #define ISP1301_I2C_INTERRUPT_FALLING 0xC | ||
65 | #define ISP1301_I2C_INTERRUPT_RISING 0xE | ||
66 | |||
67 | #define INT_VBUS_VLD (1 << 0) | ||
68 | #define INT_SESS_VLD (1 << 1) | ||
69 | #define INT_DP_HI (1 << 2) | ||
70 | #define INT_ID_GND (1 << 3) | ||
71 | #define INT_DM_HI (1 << 4) | ||
72 | #define INT_ID_FLOAT (1 << 5) | ||
73 | #define INT_BDIS_ACON (1 << 6) | ||
74 | #define INT_CR_INT (1 << 7) | ||
75 | |||
76 | #define ISP1301_I2C_REG_CLEAR_ADDR 1 /* Register Address Modifier */ | ||
77 | |||
78 | struct i2c_client *isp1301_get_client(struct device_node *node); | ||
79 | |||
80 | #endif /* __LINUX_USB_ISP1301_H */ | ||
diff --git a/include/linux/usb/langwell_udc.h b/include/linux/usb/langwell_udc.h deleted file mode 100644 index 2d2d1bbad9d..00000000000 --- a/include/linux/usb/langwell_udc.h +++ /dev/null | |||
@@ -1,310 +0,0 @@ | |||
1 | /* | ||
2 | * Intel Langwell USB Device Controller driver | ||
3 | * Copyright (C) 2008-2009, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LANGWELL_UDC_H | ||
21 | #define __LANGWELL_UDC_H | ||
22 | |||
23 | |||
24 | /* MACRO defines */ | ||
25 | #define CAP_REG_OFFSET 0x0 | ||
26 | #define OP_REG_OFFSET 0x28 | ||
27 | |||
28 | #define DMA_ADDR_INVALID (~(dma_addr_t)0) | ||
29 | |||
30 | #define DQH_ALIGNMENT 2048 | ||
31 | #define DTD_ALIGNMENT 64 | ||
32 | #define DMA_BOUNDARY 4096 | ||
33 | |||
34 | #define EP0_MAX_PKT_SIZE 64 | ||
35 | #define EP_DIR_IN 1 | ||
36 | #define EP_DIR_OUT 0 | ||
37 | |||
38 | #define FLUSH_TIMEOUT 1000 | ||
39 | #define RESET_TIMEOUT 1000 | ||
40 | #define SETUPSTAT_TIMEOUT 100 | ||
41 | #define PRIME_TIMEOUT 100 | ||
42 | |||
43 | |||
44 | /* device memory space registers */ | ||
45 | |||
46 | /* Capability Registers, BAR0 + CAP_REG_OFFSET */ | ||
47 | struct langwell_cap_regs { | ||
48 | /* offset: 0x0 */ | ||
49 | u8 caplength; /* offset of Operational Register */ | ||
50 | u8 _reserved3; | ||
51 | u16 hciversion; /* H: BCD encoding of host version */ | ||
52 | u32 hcsparams; /* H: host port steering logic capability */ | ||
53 | u32 hccparams; /* H: host multiple mode control capability */ | ||
54 | #define HCC_LEN BIT(17) /* Link power management (LPM) capability */ | ||
55 | u8 _reserved4[0x20-0xc]; | ||
56 | /* offset: 0x20 */ | ||
57 | u16 dciversion; /* BCD encoding of device version */ | ||
58 | u8 _reserved5[0x24-0x22]; | ||
59 | u32 dccparams; /* overall device controller capability */ | ||
60 | #define HOSTCAP BIT(8) /* host capable */ | ||
61 | #define DEVCAP BIT(7) /* device capable */ | ||
62 | #define DEN(d) \ | ||
63 | (((d)>>0)&0x1f) /* bits 4:0, device endpoint number */ | ||
64 | } __attribute__ ((packed)); | ||
65 | |||
66 | |||
67 | /* Operational Registers, BAR0 + OP_REG_OFFSET */ | ||
68 | struct langwell_op_regs { | ||
69 | /* offset: 0x28 */ | ||
70 | u32 extsts; | ||
71 | #define EXTS_TI1 BIT(4) /* general purpose timer interrupt 1 */ | ||
72 | #define EXTS_TI1TI0 BIT(3) /* general purpose timer interrupt 0 */ | ||
73 | #define EXTS_TI1UPI BIT(2) /* USB host periodic interrupt */ | ||
74 | #define EXTS_TI1UAI BIT(1) /* USB host asynchronous interrupt */ | ||
75 | #define EXTS_TI1NAKI BIT(0) /* NAK interrupt */ | ||
76 | u32 extintr; | ||
77 | #define EXTI_TIE1 BIT(4) /* general purpose timer interrupt enable 1 */ | ||
78 | #define EXTI_TIE0 BIT(3) /* general purpose timer interrupt enable 0 */ | ||
79 | #define EXTI_UPIE BIT(2) /* USB host periodic interrupt enable */ | ||
80 | #define EXTI_UAIE BIT(1) /* USB host asynchronous interrupt enable */ | ||
81 | #define EXTI_NAKE BIT(0) /* NAK interrupt enable */ | ||
82 | /* offset: 0x30 */ | ||
83 | u32 usbcmd; | ||
84 | #define CMD_HIRD(u) \ | ||
85 | (((u)>>24)&0xf) /* bits 27:24, host init resume duration */ | ||
86 | #define CMD_ITC(u) \ | ||
87 | (((u)>>16)&0xff) /* bits 23:16, interrupt threshold control */ | ||
88 | #define CMD_PPE BIT(15) /* per-port change events enable */ | ||
89 | #define CMD_ATDTW BIT(14) /* add dTD tripwire */ | ||
90 | #define CMD_SUTW BIT(13) /* setup tripwire */ | ||
91 | #define CMD_ASPE BIT(11) /* asynchronous schedule park mode enable */ | ||
92 | #define CMD_FS2 BIT(10) /* frame list size */ | ||
93 | #define CMD_ASP1 BIT(9) /* asynchronous schedule park mode count */ | ||
94 | #define CMD_ASP0 BIT(8) | ||
95 | #define CMD_LR BIT(7) /* light host/device controller reset */ | ||
96 | #define CMD_IAA BIT(6) /* interrupt on async advance doorbell */ | ||
97 | #define CMD_ASE BIT(5) /* asynchronous schedule enable */ | ||
98 | #define CMD_PSE BIT(4) /* periodic schedule enable */ | ||
99 | #define CMD_FS1 BIT(3) | ||
100 | #define CMD_FS0 BIT(2) | ||
101 | #define CMD_RST BIT(1) /* controller reset */ | ||
102 | #define CMD_RUNSTOP BIT(0) /* run/stop */ | ||
103 | u32 usbsts; | ||
104 | #define STS_PPCI(u) \ | ||
105 | (((u)>>16)&0xffff) /* bits 31:16, port-n change detect */ | ||
106 | #define STS_AS BIT(15) /* asynchronous schedule status */ | ||
107 | #define STS_PS BIT(14) /* periodic schedule status */ | ||
108 | #define STS_RCL BIT(13) /* reclamation */ | ||
109 | #define STS_HCH BIT(12) /* HC halted */ | ||
110 | #define STS_ULPII BIT(10) /* ULPI interrupt */ | ||
111 | #define STS_SLI BIT(8) /* DC suspend */ | ||
112 | #define STS_SRI BIT(7) /* SOF received */ | ||
113 | #define STS_URI BIT(6) /* USB reset received */ | ||
114 | #define STS_AAI BIT(5) /* interrupt on async advance */ | ||
115 | #define STS_SEI BIT(4) /* system error */ | ||
116 | #define STS_FRI BIT(3) /* frame list rollover */ | ||
117 | #define STS_PCI BIT(2) /* port change detect */ | ||
118 | #define STS_UEI BIT(1) /* USB error interrupt */ | ||
119 | #define STS_UI BIT(0) /* USB interrupt */ | ||
120 | u32 usbintr; | ||
121 | /* bits 31:16, per-port interrupt enable */ | ||
122 | #define INTR_PPCE(u) (((u)>>16)&0xffff) | ||
123 | #define INTR_ULPIE BIT(10) /* ULPI enable */ | ||
124 | #define INTR_SLE BIT(8) /* DC sleep/suspend enable */ | ||
125 | #define INTR_SRE BIT(7) /* SOF received enable */ | ||
126 | #define INTR_URE BIT(6) /* USB reset enable */ | ||
127 | #define INTR_AAE BIT(5) /* interrupt on async advance enable */ | ||
128 | #define INTR_SEE BIT(4) /* system error enable */ | ||
129 | #define INTR_FRE BIT(3) /* frame list rollover enable */ | ||
130 | #define INTR_PCE BIT(2) /* port change detect enable */ | ||
131 | #define INTR_UEE BIT(1) /* USB error interrupt enable */ | ||
132 | #define INTR_UE BIT(0) /* USB interrupt enable */ | ||
133 | u32 frindex; /* frame index */ | ||
134 | #define FRINDEX_MASK (0x3fff << 0) | ||
135 | u32 ctrldssegment; /* not used */ | ||
136 | u32 deviceaddr; | ||
137 | #define USBADR_SHIFT 25 | ||
138 | #define USBADR(d) \ | ||
139 | (((d)>>25)&0x7f) /* bits 31:25, device address */ | ||
140 | #define USBADR_MASK (0x7f << 25) | ||
141 | #define USBADRA BIT(24) /* device address advance */ | ||
142 | u32 endpointlistaddr;/* endpoint list top memory address */ | ||
143 | /* bits 31:11, endpoint list pointer */ | ||
144 | #define EPBASE(d) (((d)>>11)&0x1fffff) | ||
145 | #define ENDPOINTLISTADDR_MASK (0x1fffff << 11) | ||
146 | u32 ttctrl; /* H: TT operatin, not used */ | ||
147 | /* offset: 0x50 */ | ||
148 | u32 burstsize; /* burst size of data movement */ | ||
149 | #define TXPBURST(b) \ | ||
150 | (((b)>>8)&0xff) /* bits 15:8, TX burst length */ | ||
151 | #define RXPBURST(b) \ | ||
152 | (((b)>>0)&0xff) /* bits 7:0, RX burst length */ | ||
153 | u32 txfilltuning; /* TX tuning */ | ||
154 | u32 txttfilltuning; /* H: TX TT tuning */ | ||
155 | u32 ic_usb; /* control the IC_USB FS/LS transceiver */ | ||
156 | /* offset: 0x60 */ | ||
157 | u32 ulpi_viewport; /* indirect access to ULPI PHY */ | ||
158 | #define ULPIWU BIT(31) /* ULPI wakeup */ | ||
159 | #define ULPIRUN BIT(30) /* ULPI read/write run */ | ||
160 | #define ULPIRW BIT(29) /* ULPI read/write control */ | ||
161 | #define ULPISS BIT(27) /* ULPI sync state */ | ||
162 | #define ULPIPORT(u) \ | ||
163 | (((u)>>24)&7) /* bits 26:24, ULPI port number */ | ||
164 | #define ULPIADDR(u) \ | ||
165 | (((u)>>16)&0xff) /* bits 23:16, ULPI data address */ | ||
166 | #define ULPIDATRD(u) \ | ||
167 | (((u)>>8)&0xff) /* bits 15:8, ULPI data read */ | ||
168 | #define ULPIDATWR(u) \ | ||
169 | (((u)>>0)&0xff) /* bits 7:0, ULPI date write */ | ||
170 | u8 _reserved6[0x70-0x64]; | ||
171 | /* offset: 0x70 */ | ||
172 | u32 configflag; /* H: not used */ | ||
173 | u32 portsc1; /* port status */ | ||
174 | #define DA(p) \ | ||
175 | (((p)>>25)&0x7f) /* bits 31:25, device address */ | ||
176 | #define PORTS_SSTS (BIT(24) | BIT(23)) /* suspend status */ | ||
177 | #define PORTS_WKOC BIT(22) /* wake on over-current enable */ | ||
178 | #define PORTS_WKDS BIT(21) /* wake on disconnect enable */ | ||
179 | #define PORTS_WKCN BIT(20) /* wake on connect enable */ | ||
180 | #define PORTS_PTC(p) (((p)>>16)&0xf) /* bits 19:16, port test control */ | ||
181 | #define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ | ||
182 | #define PORTS_PO BIT(13) /* port owner */ | ||
183 | #define PORTS_PP BIT(12) /* port power */ | ||
184 | #define PORTS_LS (BIT(11) | BIT(10)) /* line status */ | ||
185 | #define PORTS_SLP BIT(9) /* suspend using L1 */ | ||
186 | #define PORTS_PR BIT(8) /* port reset */ | ||
187 | #define PORTS_SUSP BIT(7) /* suspend */ | ||
188 | #define PORTS_FPR BIT(6) /* force port resume */ | ||
189 | #define PORTS_OCC BIT(5) /* over-current change */ | ||
190 | #define PORTS_OCA BIT(4) /* over-current active */ | ||
191 | #define PORTS_PEC BIT(3) /* port enable/disable change */ | ||
192 | #define PORTS_PE BIT(2) /* port enable/disable */ | ||
193 | #define PORTS_CSC BIT(1) /* connect status change */ | ||
194 | #define PORTS_CCS BIT(0) /* current connect status */ | ||
195 | u8 _reserved7[0xb4-0x78]; | ||
196 | /* offset: 0xb4 */ | ||
197 | u32 devlc; /* control LPM and each USB port behavior */ | ||
198 | /* bits 31:29, parallel transceiver select */ | ||
199 | #define LPM_PTS(d) (((d)>>29)&7) | ||
200 | #define LPM_STS BIT(28) /* serial transceiver select */ | ||
201 | #define LPM_PTW BIT(27) /* parallel transceiver width */ | ||
202 | #define LPM_PSPD(d) (((d)>>25)&3) /* bits 26:25, port speed */ | ||
203 | #define LPM_PSPD_MASK (BIT(26) | BIT(25)) | ||
204 | #define LPM_SPEED_FULL 0 | ||
205 | #define LPM_SPEED_LOW 1 | ||
206 | #define LPM_SPEED_HIGH 2 | ||
207 | #define LPM_SRT BIT(24) /* shorten reset time */ | ||
208 | #define LPM_PFSC BIT(23) /* port force full speed connect */ | ||
209 | #define LPM_PHCD BIT(22) /* PHY low power suspend clock disable */ | ||
210 | #define LPM_STL BIT(16) /* STALL reply to LPM token */ | ||
211 | #define LPM_BA(d) \ | ||
212 | (((d)>>1)&0x7ff) /* bits 11:1, BmAttributes */ | ||
213 | #define LPM_NYT_ACK BIT(0) /* NYET/ACK reply to LPM token */ | ||
214 | u8 _reserved8[0xf4-0xb8]; | ||
215 | /* offset: 0xf4 */ | ||
216 | u32 otgsc; /* On-The-Go status and control */ | ||
217 | #define OTGSC_DPIE BIT(30) /* data pulse interrupt enable */ | ||
218 | #define OTGSC_MSE BIT(29) /* 1 ms timer interrupt enable */ | ||
219 | #define OTGSC_BSEIE BIT(28) /* B session end interrupt enable */ | ||
220 | #define OTGSC_BSVIE BIT(27) /* B session valid interrupt enable */ | ||
221 | #define OTGSC_ASVIE BIT(26) /* A session valid interrupt enable */ | ||
222 | #define OTGSC_AVVIE BIT(25) /* A VBUS valid interrupt enable */ | ||
223 | #define OTGSC_IDIE BIT(24) /* USB ID interrupt enable */ | ||
224 | #define OTGSC_DPIS BIT(22) /* data pulse interrupt status */ | ||
225 | #define OTGSC_MSS BIT(21) /* 1 ms timer interrupt status */ | ||
226 | #define OTGSC_BSEIS BIT(20) /* B session end interrupt status */ | ||
227 | #define OTGSC_BSVIS BIT(19) /* B session valid interrupt status */ | ||
228 | #define OTGSC_ASVIS BIT(18) /* A session valid interrupt status */ | ||
229 | #define OTGSC_AVVIS BIT(17) /* A VBUS valid interrupt status */ | ||
230 | #define OTGSC_IDIS BIT(16) /* USB ID interrupt status */ | ||
231 | #define OTGSC_DPS BIT(14) /* data bus pulsing status */ | ||
232 | #define OTGSC_MST BIT(13) /* 1 ms timer toggle */ | ||
233 | #define OTGSC_BSE BIT(12) /* B session end */ | ||
234 | #define OTGSC_BSV BIT(11) /* B session valid */ | ||
235 | #define OTGSC_ASV BIT(10) /* A session valid */ | ||
236 | #define OTGSC_AVV BIT(9) /* A VBUS valid */ | ||
237 | #define OTGSC_USBID BIT(8) /* USB ID */ | ||
238 | #define OTGSC_HABA BIT(7) /* hw assist B-disconnect to A-connect */ | ||
239 | #define OTGSC_HADP BIT(6) /* hw assist data pulse */ | ||
240 | #define OTGSC_IDPU BIT(5) /* ID pullup */ | ||
241 | #define OTGSC_DP BIT(4) /* data pulsing */ | ||
242 | #define OTGSC_OT BIT(3) /* OTG termination */ | ||
243 | #define OTGSC_HAAR BIT(2) /* hw assist auto reset */ | ||
244 | #define OTGSC_VC BIT(1) /* VBUS charge */ | ||
245 | #define OTGSC_VD BIT(0) /* VBUS discharge */ | ||
246 | u32 usbmode; | ||
247 | #define MODE_VBPS BIT(5) /* R/W VBUS power select */ | ||
248 | #define MODE_SDIS BIT(4) /* R/W stream disable mode */ | ||
249 | #define MODE_SLOM BIT(3) /* R/W setup lockout mode */ | ||
250 | #define MODE_ENSE BIT(2) /* endian select */ | ||
251 | #define MODE_CM(u) (((u)>>0)&3) /* bits 1:0, controller mode */ | ||
252 | #define MODE_IDLE 0 | ||
253 | #define MODE_DEVICE 2 | ||
254 | #define MODE_HOST 3 | ||
255 | u8 _reserved9[0x100-0xfc]; | ||
256 | /* offset: 0x100 */ | ||
257 | u32 endptnak; | ||
258 | #define EPTN(e) \ | ||
259 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK */ | ||
260 | #define EPRN(e) \ | ||
261 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK */ | ||
262 | u32 endptnaken; | ||
263 | #define EPTNE(e) \ | ||
264 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK enable */ | ||
265 | #define EPRNE(e) \ | ||
266 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK enable */ | ||
267 | u32 endptsetupstat; | ||
268 | #define SETUPSTAT_MASK (0xffff << 0) /* bits 15:0 */ | ||
269 | #define EP0SETUPSTAT_MASK 1 | ||
270 | u32 endptprime; | ||
271 | /* bits 31:16, prime endpoint transmit buffer */ | ||
272 | #define PETB(e) (((e)>>16)&0xffff) | ||
273 | /* bits 15:0, prime endpoint receive buffer */ | ||
274 | #define PERB(e) (((e)>>0)&0xffff) | ||
275 | /* offset: 0x110 */ | ||
276 | u32 endptflush; | ||
277 | /* bits 31:16, flush endpoint transmit buffer */ | ||
278 | #define FETB(e) (((e)>>16)&0xffff) | ||
279 | /* bits 15:0, flush endpoint receive buffer */ | ||
280 | #define FERB(e) (((e)>>0)&0xffff) | ||
281 | u32 endptstat; | ||
282 | /* bits 31:16, endpoint transmit buffer ready */ | ||
283 | #define ETBR(e) (((e)>>16)&0xffff) | ||
284 | /* bits 15:0, endpoint receive buffer ready */ | ||
285 | #define ERBR(e) (((e)>>0)&0xffff) | ||
286 | u32 endptcomplete; | ||
287 | /* bits 31:16, endpoint transmit complete event */ | ||
288 | #define ETCE(e) (((e)>>16)&0xffff) | ||
289 | /* bits 15:0, endpoint receive complete event */ | ||
290 | #define ERCE(e) (((e)>>0)&0xffff) | ||
291 | /* offset: 0x11c */ | ||
292 | u32 endptctrl[16]; | ||
293 | #define EPCTRL_TXE BIT(23) /* TX endpoint enable */ | ||
294 | #define EPCTRL_TXR BIT(22) /* TX data toggle reset */ | ||
295 | #define EPCTRL_TXI BIT(21) /* TX data toggle inhibit */ | ||
296 | #define EPCTRL_TXT(e) (((e)>>18)&3) /* bits 19:18, TX endpoint type */ | ||
297 | #define EPCTRL_TXT_SHIFT 18 | ||
298 | #define EPCTRL_TXD BIT(17) /* TX endpoint data source */ | ||
299 | #define EPCTRL_TXS BIT(16) /* TX endpoint STALL */ | ||
300 | #define EPCTRL_RXE BIT(7) /* RX endpoint enable */ | ||
301 | #define EPCTRL_RXR BIT(6) /* RX data toggle reset */ | ||
302 | #define EPCTRL_RXI BIT(5) /* RX data toggle inhibit */ | ||
303 | #define EPCTRL_RXT(e) (((e)>>2)&3) /* bits 3:2, RX endpoint type */ | ||
304 | #define EPCTRL_RXT_SHIFT 2 /* bits 19:18, TX endpoint type */ | ||
305 | #define EPCTRL_RXD BIT(1) /* RX endpoint data sink */ | ||
306 | #define EPCTRL_RXS BIT(0) /* RX endpoint STALL */ | ||
307 | } __attribute__ ((packed)); | ||
308 | |||
309 | #endif /* __LANGWELL_UDC_H */ | ||
310 | |||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 47428388823..86c0b451745 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * USB Serial Converter stuff | 2 | * USB Serial Converter stuff |
3 | * | 3 | * |
4 | * Copyright (C) 1999 - 2005 | 4 | * Copyright (C) 1999 - 2012 |
5 | * Greg Kroah-Hartman (greg@kroah.com) | 5 | * Greg Kroah-Hartman (greg@kroah.com) |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -249,6 +249,7 @@ struct usb_serial_driver { | |||
249 | 249 | ||
250 | int (*suspend)(struct usb_serial *serial, pm_message_t message); | 250 | int (*suspend)(struct usb_serial *serial, pm_message_t message); |
251 | int (*resume)(struct usb_serial *serial); | 251 | int (*resume)(struct usb_serial *serial); |
252 | int (*reset_resume)(struct usb_serial *serial); | ||
252 | 253 | ||
253 | /* serial function calls */ | 254 | /* serial function calls */ |
254 | /* Called by console and by the tty layer */ | 255 | /* Called by console and by the tty layer */ |
@@ -292,16 +293,11 @@ struct usb_serial_driver { | |||
292 | #define to_usb_serial_driver(d) \ | 293 | #define to_usb_serial_driver(d) \ |
293 | container_of(d, struct usb_serial_driver, driver) | 294 | container_of(d, struct usb_serial_driver, driver) |
294 | 295 | ||
295 | extern int usb_serial_register_drivers(struct usb_driver *udriver, | 296 | extern int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[], |
296 | struct usb_serial_driver * const serial_drivers[]); | 297 | const char *name, const struct usb_device_id *id_table); |
297 | extern void usb_serial_deregister_drivers(struct usb_driver *udriver, | 298 | extern void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_drivers[]); |
298 | struct usb_serial_driver * const serial_drivers[]); | ||
299 | extern void usb_serial_port_softint(struct usb_serial_port *port); | 299 | extern void usb_serial_port_softint(struct usb_serial_port *port); |
300 | 300 | ||
301 | extern int usb_serial_probe(struct usb_interface *iface, | ||
302 | const struct usb_device_id *id); | ||
303 | extern void usb_serial_disconnect(struct usb_interface *iface); | ||
304 | |||
305 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); | 301 | extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); |
306 | extern int usb_serial_resume(struct usb_interface *intf); | 302 | extern int usb_serial_resume(struct usb_interface *intf); |
307 | 303 | ||
@@ -400,8 +396,8 @@ do { \ | |||
400 | 396 | ||
401 | /* | 397 | /* |
402 | * module_usb_serial_driver() - Helper macro for registering a USB Serial driver | 398 | * module_usb_serial_driver() - Helper macro for registering a USB Serial driver |
403 | * @__usb_driver: usb_driver struct to register | ||
404 | * @__serial_drivers: list of usb_serial drivers to register | 399 | * @__serial_drivers: list of usb_serial drivers to register |
400 | * @__ids: all device ids that @__serial_drivers bind to | ||
405 | * | 401 | * |
406 | * Helper macro for USB serial drivers which do not do anything special | 402 | * Helper macro for USB serial drivers which do not do anything special |
407 | * in module init/exit. This eliminates a lot of boilerplate. Each | 403 | * in module init/exit. This eliminates a lot of boilerplate. Each |
@@ -409,9 +405,21 @@ do { \ | |||
409 | * module_init() and module_exit() | 405 | * module_init() and module_exit() |
410 | * | 406 | * |
411 | */ | 407 | */ |
412 | #define module_usb_serial_driver(__usb_driver, __serial_drivers) \ | 408 | #define usb_serial_module_driver(__name, __serial_drivers, __ids) \ |
413 | module_driver(__usb_driver, usb_serial_register_drivers, \ | 409 | static int __init usb_serial_module_init(void) \ |
414 | usb_serial_deregister_drivers, __serial_drivers) | 410 | { \ |
411 | return usb_serial_register_drivers(__serial_drivers, \ | ||
412 | __name, __ids); \ | ||
413 | } \ | ||
414 | module_init(usb_serial_module_init); \ | ||
415 | static void __exit usb_serial_module_exit(void) \ | ||
416 | { \ | ||
417 | usb_serial_deregister_drivers(__serial_drivers); \ | ||
418 | } \ | ||
419 | module_exit(usb_serial_module_exit); | ||
420 | |||
421 | #define module_usb_serial_driver(__serial_drivers, __ids) \ | ||
422 | usb_serial_module_driver(KBUILD_MODNAME, __serial_drivers, __ids) | ||
415 | 423 | ||
416 | #endif /* __LINUX_USB_SERIAL_H */ | 424 | #endif /* __LINUX_USB_SERIAL_H */ |
417 | 425 | ||