diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/platform_data/samsung-usbphy.h | 27 | ||||
-rw-r--r-- | include/linux/usb.h | 12 | ||||
-rw-r--r-- | include/linux/usb/chipidea.h | 1 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 26 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 4 | ||||
-rw-r--r-- | include/linux/usb/of.h | 5 | ||||
-rw-r--r-- | include/linux/usb/quirks.h | 22 | ||||
-rw-r--r-- | include/linux/usb_usual.h | 4 | ||||
-rw-r--r-- | include/uapi/linux/usb/functionfs.h | 19 |
9 files changed, 79 insertions, 41 deletions
diff --git a/include/linux/platform_data/samsung-usbphy.h b/include/linux/platform_data/samsung-usbphy.h deleted file mode 100644 index 1bd24cba982b..000000000000 --- a/include/linux/platform_data/samsung-usbphy.h +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Samsung Electronics Co.Ltd | ||
3 | * http://www.samsung.com/ | ||
4 | * Author: Praveen Paneri <p.paneri@samsung.com> | ||
5 | * | ||
6 | * Defines platform data for samsung usb phy driver. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __SAMSUNG_USBPHY_PLATFORM_H | ||
15 | #define __SAMSUNG_USBPHY_PLATFORM_H | ||
16 | |||
17 | /** | ||
18 | * samsung_usbphy_data - Platform data for USB PHY driver. | ||
19 | * @pmu_isolation: Function to control usb phy isolation in PMU. | ||
20 | */ | ||
21 | struct samsung_usbphy_data { | ||
22 | void (*pmu_isolation)(int on); | ||
23 | }; | ||
24 | |||
25 | extern void samsung_usbphy_set_pdata(struct samsung_usbphy_data *pd); | ||
26 | |||
27 | #endif /* __SAMSUNG_USBPHY_PLATFORM_H */ | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index d2465bc0e73c..447a7e2fc19b 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1862,6 +1862,18 @@ extern void usb_unregister_notify(struct notifier_block *nb); | |||
1862 | /* debugfs stuff */ | 1862 | /* debugfs stuff */ |
1863 | extern struct dentry *usb_debug_root; | 1863 | extern struct dentry *usb_debug_root; |
1864 | 1864 | ||
1865 | /* LED triggers */ | ||
1866 | enum usb_led_event { | ||
1867 | USB_LED_EVENT_HOST = 0, | ||
1868 | USB_LED_EVENT_GADGET = 1, | ||
1869 | }; | ||
1870 | |||
1871 | #ifdef CONFIG_USB_LED_TRIG | ||
1872 | extern void usb_led_activity(enum usb_led_event ev); | ||
1873 | #else | ||
1874 | static inline void usb_led_activity(enum usb_led_event ev) {} | ||
1875 | #endif | ||
1876 | |||
1865 | #endif /* __KERNEL__ */ | 1877 | #endif /* __KERNEL__ */ |
1866 | 1878 | ||
1867 | #endif | 1879 | #endif |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index bbe779f640be..e14c09a45c5a 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -31,6 +31,7 @@ struct ci_hdrc_platform_data { | |||
31 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 | 31 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
32 | void (*notify_event) (struct ci_hdrc *ci, unsigned event); | 32 | void (*notify_event) (struct ci_hdrc *ci, unsigned event); |
33 | struct regulator *reg_vbus; | 33 | struct regulator *reg_vbus; |
34 | bool tpl_support; | ||
34 | }; | 35 | }; |
35 | 36 | ||
36 | /* Default offset of capability registers */ | 37 | /* Default offset of capability registers */ |
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index c3a61853cd13..522cafe26790 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -345,12 +345,13 @@ static inline int usb_ep_queue(struct usb_ep *ep, | |||
345 | * @ep:the endpoint associated with the request | 345 | * @ep:the endpoint associated with the request |
346 | * @req:the request being canceled | 346 | * @req:the request being canceled |
347 | * | 347 | * |
348 | * if the request is still active on the endpoint, it is dequeued and its | 348 | * If the request is still active on the endpoint, it is dequeued and its |
349 | * completion routine is called (with status -ECONNRESET); else a negative | 349 | * completion routine is called (with status -ECONNRESET); else a negative |
350 | * error code is returned. | 350 | * error code is returned. This is guaranteed to happen before the call to |
351 | * usb_ep_dequeue() returns. | ||
351 | * | 352 | * |
352 | * note that some hardware can't clear out write fifos (to unlink the request | 353 | * Note that some hardware can't clear out write fifos (to unlink the request |
353 | * at the head of the queue) except as part of disconnecting from usb. such | 354 | * at the head of the queue) except as part of disconnecting from usb. Such |
354 | * restrictions prevent drivers from supporting configuration changes, | 355 | * restrictions prevent drivers from supporting configuration changes, |
355 | * even to configuration zero (a "chapter 9" requirement). | 356 | * even to configuration zero (a "chapter 9" requirement). |
356 | */ | 357 | */ |
@@ -816,6 +817,8 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
816 | * Called in a context that permits sleeping. | 817 | * Called in a context that permits sleeping. |
817 | * @suspend: Invoked on USB suspend. May be called in_interrupt. | 818 | * @suspend: Invoked on USB suspend. May be called in_interrupt. |
818 | * @resume: Invoked on USB resume. May be called in_interrupt. | 819 | * @resume: Invoked on USB resume. May be called in_interrupt. |
820 | * @reset: Invoked on USB bus reset. It is mandatory for all gadget drivers | ||
821 | * and should be called in_interrupt. | ||
819 | * @driver: Driver model state for this driver. | 822 | * @driver: Driver model state for this driver. |
820 | * | 823 | * |
821 | * Devices are disabled till a gadget driver successfully bind()s, which | 824 | * Devices are disabled till a gadget driver successfully bind()s, which |
@@ -873,6 +876,7 @@ struct usb_gadget_driver { | |||
873 | void (*disconnect)(struct usb_gadget *); | 876 | void (*disconnect)(struct usb_gadget *); |
874 | void (*suspend)(struct usb_gadget *); | 877 | void (*suspend)(struct usb_gadget *); |
875 | void (*resume)(struct usb_gadget *); | 878 | void (*resume)(struct usb_gadget *); |
879 | void (*reset)(struct usb_gadget *); | ||
876 | 880 | ||
877 | /* FIXME support safe rmmod */ | 881 | /* FIXME support safe rmmod */ |
878 | struct device_driver driver; | 882 | struct device_driver driver; |
@@ -1013,6 +1017,20 @@ extern void usb_gadget_set_state(struct usb_gadget *gadget, | |||
1013 | 1017 | ||
1014 | /*-------------------------------------------------------------------------*/ | 1018 | /*-------------------------------------------------------------------------*/ |
1015 | 1019 | ||
1020 | /* utility to tell udc core that the bus reset occurs */ | ||
1021 | extern void usb_gadget_udc_reset(struct usb_gadget *gadget, | ||
1022 | struct usb_gadget_driver *driver); | ||
1023 | |||
1024 | /*-------------------------------------------------------------------------*/ | ||
1025 | |||
1026 | /* utility to give requests back to the gadget layer */ | ||
1027 | |||
1028 | extern void usb_gadget_giveback_request(struct usb_ep *ep, | ||
1029 | struct usb_request *req); | ||
1030 | |||
1031 | |||
1032 | /*-------------------------------------------------------------------------*/ | ||
1033 | |||
1016 | /* utility wrapping a simple endpoint selection policy */ | 1034 | /* utility wrapping a simple endpoint selection policy */ |
1017 | 1035 | ||
1018 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 1036 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 485cd5e2100c..cd96a2bc3388 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -106,7 +106,8 @@ struct usb_hcd { | |||
106 | * OTG and some Host controllers need software interaction with phys; | 106 | * OTG and some Host controllers need software interaction with phys; |
107 | * other external phys should be software-transparent | 107 | * other external phys should be software-transparent |
108 | */ | 108 | */ |
109 | struct usb_phy *phy; | 109 | struct usb_phy *usb_phy; |
110 | struct phy *phy; | ||
110 | 111 | ||
111 | /* Flags that need to be manipulated atomically because they can | 112 | /* Flags that need to be manipulated atomically because they can |
112 | * change while the host controller is running. Always use | 113 | * change while the host controller is running. Always use |
@@ -144,6 +145,7 @@ struct usb_hcd { | |||
144 | unsigned has_tt:1; /* Integrated TT in root hub */ | 145 | unsigned has_tt:1; /* Integrated TT in root hub */ |
145 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ | 146 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ |
146 | unsigned can_do_streams:1; /* HC supports streams */ | 147 | unsigned can_do_streams:1; /* HC supports streams */ |
148 | unsigned tpl_support:1; /* OTG & EH TPL support */ | ||
147 | 149 | ||
148 | unsigned int irq; /* irq allocated */ | 150 | unsigned int irq; /* irq allocated */ |
149 | void __iomem *regs; /* device memory/io */ | 151 | void __iomem *regs; /* device memory/io */ |
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h index 8c38aa26b3bb..cfe0528cdbb1 100644 --- a/include/linux/usb/of.h +++ b/include/linux/usb/of.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #if IS_ENABLED(CONFIG_OF) | 14 | #if IS_ENABLED(CONFIG_OF) |
15 | enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); | 15 | enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); |
16 | enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np); | 16 | enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np); |
17 | bool of_usb_host_tpl_support(struct device_node *np); | ||
17 | #else | 18 | #else |
18 | static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) | 19 | static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) |
19 | { | 20 | { |
@@ -25,6 +26,10 @@ of_usb_get_maximum_speed(struct device_node *np) | |||
25 | { | 26 | { |
26 | return USB_SPEED_UNKNOWN; | 27 | return USB_SPEED_UNKNOWN; |
27 | } | 28 | } |
29 | static inline bool of_usb_host_tpl_support(struct device_node *np) | ||
30 | { | ||
31 | return false; | ||
32 | } | ||
28 | #endif | 33 | #endif |
29 | 34 | ||
30 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT) | 35 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT) |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 55a17b188daa..9948c874e3f1 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -8,27 +8,27 @@ | |||
8 | #define __LINUX_USB_QUIRKS_H | 8 | #define __LINUX_USB_QUIRKS_H |
9 | 9 | ||
10 | /* string descriptors must not be fetched using a 255-byte read */ | 10 | /* string descriptors must not be fetched using a 255-byte read */ |
11 | #define USB_QUIRK_STRING_FETCH_255 0x00000001 | 11 | #define USB_QUIRK_STRING_FETCH_255 BIT(0) |
12 | 12 | ||
13 | /* device can't resume correctly so reset it instead */ | 13 | /* device can't resume correctly so reset it instead */ |
14 | #define USB_QUIRK_RESET_RESUME 0x00000002 | 14 | #define USB_QUIRK_RESET_RESUME BIT(1) |
15 | 15 | ||
16 | /* device can't handle Set-Interface requests */ | 16 | /* device can't handle Set-Interface requests */ |
17 | #define USB_QUIRK_NO_SET_INTF 0x00000004 | 17 | #define USB_QUIRK_NO_SET_INTF BIT(2) |
18 | 18 | ||
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 BIT(3) |
21 | 21 | ||
22 | /* device can't be reset(e.g morph devices), don't use reset */ | 22 | /* device can't be reset(e.g morph devices), don't use reset */ |
23 | #define USB_QUIRK_RESET 0x00000010 | 23 | #define USB_QUIRK_RESET BIT(4) |
24 | 24 | ||
25 | /* device has more interface descriptions than the bNumInterfaces count, | 25 | /* device has more interface descriptions than the bNumInterfaces count, |
26 | and can't handle talking to these interfaces */ | 26 | and can't handle talking to these interfaces */ |
27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 | 27 | #define USB_QUIRK_HONOR_BNUMINTERFACES BIT(5) |
28 | 28 | ||
29 | /* device needs a pause during initialization, after we read the device | 29 | /* device needs a pause during initialization, after we read the device |
30 | descriptor */ | 30 | descriptor */ |
31 | #define USB_QUIRK_DELAY_INIT 0x00000040 | 31 | #define USB_QUIRK_DELAY_INIT BIT(6) |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * For high speed and super speed interupt endpoints, the USB 2.0 and | 34 | * For high speed and super speed interupt endpoints, the USB 2.0 and |
@@ -39,6 +39,12 @@ | |||
39 | * Devices with this quirk report their bInterval as the result of this | 39 | * Devices with this quirk report their bInterval as the result of this |
40 | * calculation instead of the exponent variable used in the calculation. | 40 | * calculation instead of the exponent variable used in the calculation. |
41 | */ | 41 | */ |
42 | #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL 0x00000080 | 42 | #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL BIT(7) |
43 | |||
44 | /* device can't handle device_qualifier descriptor requests */ | ||
45 | #define USB_QUIRK_DEVICE_QUALIFIER BIT(8) | ||
46 | |||
47 | /* device generates spurious wakeup, ignore remote wakeup capability */ | ||
48 | #define USB_QUIRK_IGNORE_REMOTE_WAKEUP BIT(9) | ||
43 | 49 | ||
44 | #endif /* __LINUX_USB_QUIRKS_H */ | 50 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 9b7de1b46437..a7f2604c5f25 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -73,6 +73,10 @@ | |||
73 | /* Device advertises UAS but it is broken */ \ | 73 | /* Device advertises UAS but it is broken */ \ |
74 | US_FLAG(BROKEN_FUA, 0x01000000) \ | 74 | US_FLAG(BROKEN_FUA, 0x01000000) \ |
75 | /* Cannot handle FUA in WRITE or READ CDBs */ \ | 75 | /* Cannot handle FUA in WRITE or READ CDBs */ \ |
76 | US_FLAG(NO_ATA_1X, 0x02000000) \ | ||
77 | /* Cannot handle ATA_12 or ATA_16 CDBs */ \ | ||
78 | US_FLAG(NO_REPORT_OPCODES, 0x04000000) \ | ||
79 | /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \ | ||
76 | 80 | ||
77 | #define US_FLAG(name, value) US_FL_##name = value , | 81 | #define US_FLAG(name, value) US_FL_##name = value , |
78 | enum { US_DO_ALL_FLAGS }; | 82 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index 0154b2859fd7..295ba299e7bd 100644 --- a/include/uapi/linux/usb/functionfs.h +++ b/include/uapi/linux/usb/functionfs.h | |||
@@ -19,6 +19,7 @@ enum functionfs_flags { | |||
19 | FUNCTIONFS_HAS_HS_DESC = 2, | 19 | FUNCTIONFS_HAS_HS_DESC = 2, |
20 | FUNCTIONFS_HAS_SS_DESC = 4, | 20 | FUNCTIONFS_HAS_SS_DESC = 4, |
21 | FUNCTIONFS_HAS_MS_OS_DESC = 8, | 21 | FUNCTIONFS_HAS_MS_OS_DESC = 8, |
22 | FUNCTIONFS_VIRTUAL_ADDR = 16, | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | /* Descriptor of an non-audio endpoint */ | 25 | /* Descriptor of an non-audio endpoint */ |
@@ -32,6 +33,16 @@ struct usb_endpoint_descriptor_no_audio { | |||
32 | __u8 bInterval; | 33 | __u8 bInterval; |
33 | } __attribute__((packed)); | 34 | } __attribute__((packed)); |
34 | 35 | ||
36 | struct usb_functionfs_descs_head_v2 { | ||
37 | __le32 magic; | ||
38 | __le32 length; | ||
39 | __le32 flags; | ||
40 | /* | ||
41 | * __le32 fs_count, hs_count, fs_count; must be included manually in | ||
42 | * the structure taking flags into consideration. | ||
43 | */ | ||
44 | } __attribute__((packed)); | ||
45 | |||
35 | /* Legacy format, deprecated as of 3.14. */ | 46 | /* Legacy format, deprecated as of 3.14. */ |
36 | struct usb_functionfs_descs_head { | 47 | struct usb_functionfs_descs_head { |
37 | __le32 magic; | 48 | __le32 magic; |
@@ -92,7 +103,7 @@ struct usb_ext_prop_desc { | |||
92 | * structure. Any flags that are not recognised cause the whole block to be | 103 | * structure. Any flags that are not recognised cause the whole block to be |
93 | * rejected with -ENOSYS. | 104 | * rejected with -ENOSYS. |
94 | * | 105 | * |
95 | * Legacy descriptors format: | 106 | * Legacy descriptors format (deprecated as of 3.14): |
96 | * | 107 | * |
97 | * | off | name | type | description | | 108 | * | off | name | type | description | |
98 | * |-----+-----------+--------------+--------------------------------------| | 109 | * |-----+-----------+--------------+--------------------------------------| |
@@ -265,6 +276,12 @@ struct usb_functionfs_event { | |||
265 | */ | 276 | */ |
266 | #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129) | 277 | #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129) |
267 | 278 | ||
279 | /* | ||
280 | * Returns endpoint descriptor. If function is not active returns -ENODEV. | ||
281 | */ | ||
282 | #define FUNCTIONFS_ENDPOINT_DESC _IOR('g', 130, \ | ||
283 | struct usb_endpoint_descriptor) | ||
284 | |||
268 | 285 | ||
269 | 286 | ||
270 | #endif /* _UAPI__LINUX_FUNCTIONFS_H__ */ | 287 | #endif /* _UAPI__LINUX_FUNCTIONFS_H__ */ |