diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 11:37:49 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-05-02 11:54:19 -0400 |
commit | c032862fba51a3ca504752d3a25186b324c5ce83 (patch) | |
tree | 955dc2ba4ab3df76ecc2bb780ee84aca04967e8d /include/linux/usb | |
parent | fda76e074c7737fc57855dd17c762e50ed526052 (diff) | |
parent | 8700c95adb033843fc163d112b9d21d4fda78018 (diff) |
Merge commit '8700c95adb03' into timers/nohz
The full dynticks tree needs the latest RCU and sched
upstream updates in order to fix some dependencies.
Merge a common upstream merge point that has these
updates.
Conflicts:
include/linux/perf_event.h
kernel/rcutree.h
kernel/rcutree_plugin.h
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/cdc-wdm.h | 2 | ||||
-rw-r--r-- | include/linux/usb/cdc_ncm.h | 1 | ||||
-rw-r--r-- | include/linux/usb/ch9.h | 9 | ||||
-rw-r--r-- | include/linux/usb/composite.h | 6 | ||||
-rw-r--r-- | include/linux/usb/dwc3-omap.h | 6 | ||||
-rw-r--r-- | include/linux/usb/gadget.h | 11 | ||||
-rw-r--r-- | include/linux/usb/gadget_configfs.h | 110 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 8 | ||||
-rw-r--r-- | include/linux/usb/musb-ux500.h | 31 | ||||
-rw-r--r-- | include/linux/usb/nop-usb-xceiv.h | 5 | ||||
-rw-r--r-- | include/linux/usb/otg.h | 9 | ||||
-rw-r--r-- | include/linux/usb/phy.h | 33 | ||||
-rw-r--r-- | include/linux/usb/renesas_usbhs.h | 6 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 10 | ||||
-rw-r--r-- | include/linux/usb/tegra_usb_phy.h | 10 | ||||
-rw-r--r-- | include/linux/usb/ulpi.h | 8 |
16 files changed, 234 insertions, 31 deletions
diff --git a/include/linux/usb/cdc-wdm.h b/include/linux/usb/cdc-wdm.h index 719c332620fa..0b3f4295c025 100644 --- a/include/linux/usb/cdc-wdm.h +++ b/include/linux/usb/cdc-wdm.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __LINUX_USB_CDC_WDM_H | 11 | #ifndef __LINUX_USB_CDC_WDM_H |
12 | #define __LINUX_USB_CDC_WDM_H | 12 | #define __LINUX_USB_CDC_WDM_H |
13 | 13 | ||
14 | #include <uapi/linux/usb/cdc-wdm.h> | ||
15 | |||
14 | extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf, | 16 | extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf, |
15 | struct usb_endpoint_descriptor *ep, | 17 | struct usb_endpoint_descriptor *ep, |
16 | int bufsize, | 18 | int bufsize, |
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 3b8f9d4fc3fe..cc25b70af33c 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -127,6 +127,7 @@ struct cdc_ncm_ctx { | |||
127 | u16 connected; | 127 | u16 connected; |
128 | }; | 128 | }; |
129 | 129 | ||
130 | extern u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); | ||
130 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | 131 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); |
131 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | 132 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); |
132 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); | 133 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 9c210f2283df..27603bcbb9b9 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -43,4 +43,13 @@ | |||
43 | */ | 43 | */ |
44 | extern const char *usb_speed_string(enum usb_device_speed speed); | 44 | extern const char *usb_speed_string(enum usb_device_speed speed); |
45 | 45 | ||
46 | |||
47 | /** | ||
48 | * usb_state_string - Returns human readable name for the state. | ||
49 | * @state: The state to return a human-readable name for. If it's not | ||
50 | * any of the states devices in usb_device_state_string enum, | ||
51 | * the string UNKNOWN will be returned. | ||
52 | */ | ||
53 | extern const char *usb_state_string(enum usb_device_state state); | ||
54 | |||
46 | #endif /* __LINUX_USB_CH9_H */ | 55 | #endif /* __LINUX_USB_CH9_H */ |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 3c671c1b37f6..5e61589fc166 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
40 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
41 | #include <linux/log2.h> | 41 | #include <linux/log2.h> |
42 | #include <linux/configfs.h> | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | 45 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they |
@@ -60,7 +61,7 @@ struct usb_configuration; | |||
60 | * @name: For diagnostics, identifies the function. | 61 | * @name: For diagnostics, identifies the function. |
61 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 62 | * @strings: tables of strings, keyed by identifiers assigned during bind() |
62 | * and by language IDs provided in control requests | 63 | * and by language IDs provided in control requests |
63 | * @descriptors: Table of full (or low) speed descriptors, using interface and | 64 | * @fs_descriptors: Table of full (or low) speed descriptors, using interface and |
64 | * string identifiers assigned during @bind(). If this pointer is null, | 65 | * string identifiers assigned during @bind(). If this pointer is null, |
65 | * the function will not be available at full speed (or at low speed). | 66 | * the function will not be available at full speed (or at low speed). |
66 | * @hs_descriptors: Table of high speed descriptors, using interface and | 67 | * @hs_descriptors: Table of high speed descriptors, using interface and |
@@ -290,6 +291,7 @@ enum { | |||
290 | * after function notifications | 291 | * after function notifications |
291 | * @resume: Notifies configuration when the host restarts USB traffic, | 292 | * @resume: Notifies configuration when the host restarts USB traffic, |
292 | * before function notifications | 293 | * before function notifications |
294 | * @gadget_driver: Gadget driver controlling this driver | ||
293 | * | 295 | * |
294 | * Devices default to reporting self powered operation. Devices which rely | 296 | * Devices default to reporting self powered operation. Devices which rely |
295 | * on bus powered operation should report this in their @bind method. | 297 | * on bus powered operation should report this in their @bind method. |
@@ -463,6 +465,8 @@ struct usb_function_driver { | |||
463 | }; | 465 | }; |
464 | 466 | ||
465 | struct usb_function_instance { | 467 | struct usb_function_instance { |
468 | struct config_group group; | ||
469 | struct list_head cfs_list; | ||
466 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
467 | void (*free_func_inst)(struct usb_function_instance *inst); | 471 | void (*free_func_inst)(struct usb_function_instance *inst); |
468 | }; | 472 | }; |
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h index 51eae14477f7..5615f4d82724 100644 --- a/include/linux/usb/dwc3-omap.h +++ b/include/linux/usb/dwc3-omap.h | |||
@@ -19,11 +19,11 @@ enum omap_dwc3_vbus_id_status { | |||
19 | }; | 19 | }; |
20 | 20 | ||
21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) | 21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) |
22 | extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); | 22 | extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); |
23 | #else | 23 | #else |
24 | static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) | 24 | static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) |
25 | { | 25 | { |
26 | return; | 26 | return -ENODEV; |
27 | } | 27 | } |
28 | #endif | 28 | #endif |
29 | 29 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 2e297e80d59a..c454a88abf2e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
@@ -482,6 +482,7 @@ struct usb_gadget_ops { | |||
482 | * @speed: Speed of current connection to USB host. | 482 | * @speed: Speed of current connection to USB host. |
483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
484 | * and all slower speeds. | 484 | * and all slower speeds. |
485 | * @state: the state we are now (attached, suspended, configured, etc) | ||
485 | * @sg_supported: true if we can handle scatter-gather | 486 | * @sg_supported: true if we can handle scatter-gather |
486 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 487 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
487 | * gadget driver must provide a USB OTG descriptor. | 488 | * gadget driver must provide a USB OTG descriptor. |
@@ -525,6 +526,7 @@ struct usb_gadget { | |||
525 | struct list_head ep_list; /* of usb_ep */ | 526 | struct list_head ep_list; /* of usb_ep */ |
526 | enum usb_device_speed speed; | 527 | enum usb_device_speed speed; |
527 | enum usb_device_speed max_speed; | 528 | enum usb_device_speed max_speed; |
529 | enum usb_device_state state; | ||
528 | unsigned sg_supported:1; | 530 | unsigned sg_supported:1; |
529 | unsigned is_otg:1; | 531 | unsigned is_otg:1; |
530 | unsigned is_a_peripheral:1; | 532 | unsigned is_a_peripheral:1; |
@@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver); | |||
872 | */ | 874 | */ |
873 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); | 875 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); |
874 | 876 | ||
877 | extern int usb_add_gadget_udc_release(struct device *parent, | ||
878 | struct usb_gadget *gadget, void (*release)(struct device *dev)); | ||
875 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | 879 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); |
876 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | 880 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); |
877 | extern int udc_attach_driver(const char *name, | 881 | extern int udc_attach_driver(const char *name, |
@@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget, | |||
959 | 963 | ||
960 | /*-------------------------------------------------------------------------*/ | 964 | /*-------------------------------------------------------------------------*/ |
961 | 965 | ||
966 | /* utility to set gadget state properly */ | ||
967 | |||
968 | extern void usb_gadget_set_state(struct usb_gadget *gadget, | ||
969 | enum usb_device_state state); | ||
970 | |||
971 | /*-------------------------------------------------------------------------*/ | ||
972 | |||
962 | /* utility wrapping a simple endpoint selection policy */ | 973 | /* utility wrapping a simple endpoint selection policy */ |
963 | 974 | ||
964 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 975 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
diff --git a/include/linux/usb/gadget_configfs.h b/include/linux/usb/gadget_configfs.h new file mode 100644 index 000000000000..d74c0ae989d5 --- /dev/null +++ b/include/linux/usb/gadget_configfs.h | |||
@@ -0,0 +1,110 @@ | |||
1 | #ifndef __GADGET_CONFIGFS__ | ||
2 | #define __GADGET_CONFIGFS__ | ||
3 | |||
4 | #include <linux/configfs.h> | ||
5 | |||
6 | int check_user_usb_string(const char *name, | ||
7 | struct usb_gadget_strings *stringtab_dev); | ||
8 | |||
9 | #define GS_STRINGS_W(__struct, __name) \ | ||
10 | static ssize_t __struct##_##__name##_store(struct __struct *gs, \ | ||
11 | const char *page, size_t len) \ | ||
12 | { \ | ||
13 | int ret; \ | ||
14 | \ | ||
15 | ret = usb_string_copy(page, &gs->__name); \ | ||
16 | if (ret) \ | ||
17 | return ret; \ | ||
18 | return len; \ | ||
19 | } | ||
20 | |||
21 | #define GS_STRINGS_R(__struct, __name) \ | ||
22 | static ssize_t __struct##_##__name##_show(struct __struct *gs, \ | ||
23 | char *page) \ | ||
24 | { \ | ||
25 | return sprintf(page, "%s\n", gs->__name ?: ""); \ | ||
26 | } | ||
27 | |||
28 | #define GS_STRING_ITEM_ATTR(struct_name, name) \ | ||
29 | static struct struct_name##_attribute struct_name##_##name = \ | ||
30 | __CONFIGFS_ATTR(name, S_IRUGO | S_IWUSR, \ | ||
31 | struct_name##_##name##_show, \ | ||
32 | struct_name##_##name##_store) | ||
33 | |||
34 | #define GS_STRINGS_RW(struct_name, _name) \ | ||
35 | GS_STRINGS_R(struct_name, _name) \ | ||
36 | GS_STRINGS_W(struct_name, _name) \ | ||
37 | GS_STRING_ITEM_ATTR(struct_name, _name) | ||
38 | |||
39 | #define USB_CONFIG_STRING_RW_OPS(struct_in) \ | ||
40 | CONFIGFS_ATTR_OPS(struct_in); \ | ||
41 | \ | ||
42 | static struct configfs_item_operations struct_in##_langid_item_ops = { \ | ||
43 | .release = struct_in##_attr_release, \ | ||
44 | .show_attribute = struct_in##_attr_show, \ | ||
45 | .store_attribute = struct_in##_attr_store, \ | ||
46 | }; \ | ||
47 | \ | ||
48 | static struct config_item_type struct_in##_langid_type = { \ | ||
49 | .ct_item_ops = &struct_in##_langid_item_ops, \ | ||
50 | .ct_attrs = struct_in##_langid_attrs, \ | ||
51 | .ct_owner = THIS_MODULE, \ | ||
52 | } | ||
53 | |||
54 | #define USB_CONFIG_STRINGS_LANG(struct_in, struct_member) \ | ||
55 | static struct config_group *struct_in##_strings_make( \ | ||
56 | struct config_group *group, \ | ||
57 | const char *name) \ | ||
58 | { \ | ||
59 | struct struct_member *gi; \ | ||
60 | struct struct_in *gs; \ | ||
61 | struct struct_in *new; \ | ||
62 | int langs = 0; \ | ||
63 | int ret; \ | ||
64 | \ | ||
65 | new = kzalloc(sizeof(*new), GFP_KERNEL); \ | ||
66 | if (!new) \ | ||
67 | return ERR_PTR(-ENOMEM); \ | ||
68 | \ | ||
69 | ret = check_user_usb_string(name, &new->stringtab_dev); \ | ||
70 | if (ret) \ | ||
71 | goto err; \ | ||
72 | config_group_init_type_name(&new->group, name, \ | ||
73 | &struct_in##_langid_type); \ | ||
74 | \ | ||
75 | gi = container_of(group, struct struct_member, strings_group); \ | ||
76 | ret = -EEXIST; \ | ||
77 | list_for_each_entry(gs, &gi->string_list, list) { \ | ||
78 | if (gs->stringtab_dev.language == new->stringtab_dev.language) \ | ||
79 | goto err; \ | ||
80 | langs++; \ | ||
81 | } \ | ||
82 | ret = -EOVERFLOW; \ | ||
83 | if (langs >= MAX_USB_STRING_LANGS) \ | ||
84 | goto err; \ | ||
85 | \ | ||
86 | list_add_tail(&new->list, &gi->string_list); \ | ||
87 | return &new->group; \ | ||
88 | err: \ | ||
89 | kfree(new); \ | ||
90 | return ERR_PTR(ret); \ | ||
91 | } \ | ||
92 | \ | ||
93 | static void struct_in##_strings_drop( \ | ||
94 | struct config_group *group, \ | ||
95 | struct config_item *item) \ | ||
96 | { \ | ||
97 | config_item_put(item); \ | ||
98 | } \ | ||
99 | \ | ||
100 | static struct configfs_group_operations struct_in##_strings_ops = { \ | ||
101 | .make_group = &struct_in##_strings_make, \ | ||
102 | .drop_item = &struct_in##_strings_drop, \ | ||
103 | }; \ | ||
104 | \ | ||
105 | static struct config_item_type struct_in##_strings_type = { \ | ||
106 | .ct_group_ops = &struct_in##_strings_ops, \ | ||
107 | .ct_owner = THIS_MODULE, \ | ||
108 | } | ||
109 | |||
110 | #endif | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 0a78df5f6cfd..f5f5c7dfda90 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -84,7 +84,7 @@ struct usb_hcd { | |||
84 | 84 | ||
85 | struct timer_list rh_timer; /* drives root-hub polling */ | 85 | struct timer_list rh_timer; /* drives root-hub polling */ |
86 | struct urb *status_urb; /* the current status urb */ | 86 | struct urb *status_urb; /* the current status urb */ |
87 | #ifdef CONFIG_USB_SUSPEND | 87 | #ifdef CONFIG_PM_RUNTIME |
88 | struct work_struct wakeup_work; /* for remote wakeup */ | 88 | struct work_struct wakeup_work; /* for remote wakeup */ |
89 | #endif | 89 | #endif |
90 | 90 | ||
@@ -357,6 +357,7 @@ struct hc_driver { | |||
357 | */ | 357 | */ |
358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, | 358 | int (*disable_usb3_lpm_timeout)(struct usb_hcd *, |
359 | struct usb_device *, enum usb3_link_state state); | 359 | struct usb_device *, enum usb3_link_state state); |
360 | int (*find_raw_port_number)(struct usb_hcd *, int); | ||
360 | }; | 361 | }; |
361 | 362 | ||
362 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 363 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
@@ -396,6 +397,7 @@ extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd); | |||
396 | extern int usb_add_hcd(struct usb_hcd *hcd, | 397 | extern int usb_add_hcd(struct usb_hcd *hcd, |
397 | unsigned int irqnum, unsigned long irqflags); | 398 | unsigned int irqnum, unsigned long irqflags); |
398 | extern void usb_remove_hcd(struct usb_hcd *hcd); | 399 | extern void usb_remove_hcd(struct usb_hcd *hcd); |
400 | extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1); | ||
399 | 401 | ||
400 | struct platform_device; | 402 | struct platform_device; |
401 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); | 403 | extern void usb_hcd_platform_shutdown(struct platform_device *dev); |
@@ -591,14 +593,14 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | |||
591 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); | 593 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); |
592 | #endif /* CONFIG_PM */ | 594 | #endif /* CONFIG_PM */ |
593 | 595 | ||
594 | #ifdef CONFIG_USB_SUSPEND | 596 | #ifdef CONFIG_PM_RUNTIME |
595 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | 597 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); |
596 | #else | 598 | #else |
597 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | 599 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) |
598 | { | 600 | { |
599 | return; | 601 | return; |
600 | } | 602 | } |
601 | #endif /* CONFIG_USB_SUSPEND */ | 603 | #endif /* CONFIG_PM_RUNTIME */ |
602 | 604 | ||
603 | /*-------------------------------------------------------------------------*/ | 605 | /*-------------------------------------------------------------------------*/ |
604 | 606 | ||
diff --git a/include/linux/usb/musb-ux500.h b/include/linux/usb/musb-ux500.h new file mode 100644 index 000000000000..1e2c7130f6e1 --- /dev/null +++ b/include/linux/usb/musb-ux500.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 ST-Ericsson AB | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __MUSB_UX500_H__ | ||
16 | #define __MUSB_UX500_H__ | ||
17 | |||
18 | enum ux500_musb_vbus_id_status { | ||
19 | UX500_MUSB_NONE = 0, | ||
20 | UX500_MUSB_VBUS, | ||
21 | UX500_MUSB_ID, | ||
22 | UX500_MUSB_CHARGER, | ||
23 | UX500_MUSB_ENUMERATED, | ||
24 | UX500_MUSB_RIDA, | ||
25 | UX500_MUSB_RIDB, | ||
26 | UX500_MUSB_RIDC, | ||
27 | UX500_MUSB_PREPARE, | ||
28 | UX500_MUSB_CLEAN, | ||
29 | }; | ||
30 | |||
31 | #endif /* __MUSB_UX500_H__ */ | ||
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 28884c717411..148d35171aac 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h | |||
@@ -5,6 +5,11 @@ | |||
5 | 5 | ||
6 | struct nop_usb_xceiv_platform_data { | 6 | struct nop_usb_xceiv_platform_data { |
7 | enum usb_phy_type type; | 7 | enum usb_phy_type type; |
8 | unsigned long clk_rate; | ||
9 | |||
10 | /* if set fails with -EPROBE_DEFER if can't get regulator */ | ||
11 | unsigned int needs_vcc:1; | ||
12 | unsigned int needs_reset:1; | ||
8 | }; | 13 | }; |
9 | 14 | ||
10 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | 15 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index e8a5fe87c6bd..291e01ba32e5 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -36,14 +36,7 @@ struct usb_otg { | |||
36 | 36 | ||
37 | }; | 37 | }; |
38 | 38 | ||
39 | #ifdef CONFIG_USB_OTG_UTILS | 39 | extern const char *usb_otg_state_string(enum usb_otg_state state); |
40 | extern const char *otg_state_string(enum usb_otg_state state); | ||
41 | #else | ||
42 | static inline const char *otg_state_string(enum usb_otg_state state) | ||
43 | { | ||
44 | return NULL; | ||
45 | } | ||
46 | #endif | ||
47 | 40 | ||
48 | /* Context: can sleep */ | 41 | /* Context: can sleep */ |
49 | static inline int | 42 | static inline int |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 15847cbdb512..6b5978f57633 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -91,6 +91,9 @@ struct usb_phy { | |||
91 | int (*init)(struct usb_phy *x); | 91 | int (*init)(struct usb_phy *x); |
92 | void (*shutdown)(struct usb_phy *x); | 92 | void (*shutdown)(struct usb_phy *x); |
93 | 93 | ||
94 | /* enable/disable VBUS */ | ||
95 | int (*set_vbus)(struct usb_phy *x, int on); | ||
96 | |||
94 | /* effective for B devices, ignored for A-peripheral */ | 97 | /* effective for B devices, ignored for A-peripheral */ |
95 | int (*set_power)(struct usb_phy *x, | 98 | int (*set_power)(struct usb_phy *x, |
96 | unsigned mA); | 99 | unsigned mA); |
@@ -160,8 +163,26 @@ usb_phy_shutdown(struct usb_phy *x) | |||
160 | x->shutdown(x); | 163 | x->shutdown(x); |
161 | } | 164 | } |
162 | 165 | ||
166 | static inline int | ||
167 | usb_phy_vbus_on(struct usb_phy *x) | ||
168 | { | ||
169 | if (!x->set_vbus) | ||
170 | return 0; | ||
171 | |||
172 | return x->set_vbus(x, true); | ||
173 | } | ||
174 | |||
175 | static inline int | ||
176 | usb_phy_vbus_off(struct usb_phy *x) | ||
177 | { | ||
178 | if (!x->set_vbus) | ||
179 | return 0; | ||
180 | |||
181 | return x->set_vbus(x, false); | ||
182 | } | ||
183 | |||
163 | /* for usb host and peripheral controller drivers */ | 184 | /* for usb host and peripheral controller drivers */ |
164 | #ifdef CONFIG_USB_OTG_UTILS | 185 | #if IS_ENABLED(CONFIG_USB_PHY) |
165 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | 186 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
166 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | 187 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, |
167 | enum usb_phy_type type); | 188 | enum usb_phy_type type); |
@@ -176,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index, | |||
176 | #else | 197 | #else |
177 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 198 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
178 | { | 199 | { |
179 | return NULL; | 200 | return ERR_PTR(-ENXIO); |
180 | } | 201 | } |
181 | 202 | ||
182 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | 203 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, |
183 | enum usb_phy_type type) | 204 | enum usb_phy_type type) |
184 | { | 205 | { |
185 | return NULL; | 206 | return ERR_PTR(-ENXIO); |
186 | } | 207 | } |
187 | 208 | ||
188 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) | 209 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) |
189 | { | 210 | { |
190 | return NULL; | 211 | return ERR_PTR(-ENXIO); |
191 | } | 212 | } |
192 | 213 | ||
193 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) | 214 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) |
194 | { | 215 | { |
195 | return NULL; | 216 | return ERR_PTR(-ENXIO); |
196 | } | 217 | } |
197 | 218 | ||
198 | static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | 219 | static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, |
199 | const char *phandle, u8 index) | 220 | const char *phandle, u8 index) |
200 | { | 221 | { |
201 | return NULL; | 222 | return ERR_PTR(-ENXIO); |
202 | } | 223 | } |
203 | 224 | ||
204 | static inline void usb_put_phy(struct usb_phy *x) | 225 | static inline void usb_put_phy(struct usb_phy *x) |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index c5d36c65c33b..e452ba6ec6bd 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
@@ -62,14 +62,14 @@ struct renesas_usbhs_platform_callback { | |||
62 | * Hardware exit function for platform. | 62 | * Hardware exit function for platform. |
63 | * it is called when driver was removed | 63 | * it is called when driver was removed |
64 | */ | 64 | */ |
65 | void (*hardware_exit)(struct platform_device *pdev); | 65 | int (*hardware_exit)(struct platform_device *pdev); |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * option: | 68 | * option: |
69 | * | 69 | * |
70 | * for board specific clock control | 70 | * for board specific clock control |
71 | */ | 71 | */ |
72 | void (*power_ctrl)(struct platform_device *pdev, | 72 | int (*power_ctrl)(struct platform_device *pdev, |
73 | void __iomem *base, int enable); | 73 | void __iomem *base, int enable); |
74 | 74 | ||
75 | /* | 75 | /* |
@@ -77,7 +77,7 @@ struct renesas_usbhs_platform_callback { | |||
77 | * | 77 | * |
78 | * Phy reset for platform | 78 | * Phy reset for platform |
79 | */ | 79 | */ |
80 | void (*phy_reset)(struct platform_device *pdev); | 80 | int (*phy_reset)(struct platform_device *pdev); |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * get USB ID function | 83 | * get USB ID function |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index ef9be7e1e190..b9b0f7b4e43b 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/serial.h> | ||
18 | #include <linux/sysrq.h> | 19 | #include <linux/sysrq.h> |
19 | #include <linux/kfifo.h> | 20 | #include <linux/kfifo.h> |
20 | 21 | ||
@@ -61,6 +62,7 @@ | |||
61 | * @bulk_out_buffers: pointers to the bulk out buffers for this port | 62 | * @bulk_out_buffers: pointers to the bulk out buffers for this port |
62 | * @write_urbs: pointers to the bulk out urbs for this port | 63 | * @write_urbs: pointers to the bulk out urbs for this port |
63 | * @write_urbs_free: status bitmap the for bulk out urbs | 64 | * @write_urbs_free: status bitmap the for bulk out urbs |
65 | * @icount: interrupt counters | ||
64 | * @tx_bytes: number of bytes currently in host stack queues | 66 | * @tx_bytes: number of bytes currently in host stack queues |
65 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 67 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
66 | * port. | 68 | * port. |
@@ -108,6 +110,7 @@ struct usb_serial_port { | |||
108 | unsigned long write_urbs_free; | 110 | unsigned long write_urbs_free; |
109 | __u8 bulk_out_endpointAddress; | 111 | __u8 bulk_out_endpointAddress; |
110 | 112 | ||
113 | struct async_icount icount; | ||
111 | int tx_bytes; | 114 | int tx_bytes; |
112 | 115 | ||
113 | unsigned long flags; | 116 | unsigned long flags; |
@@ -270,6 +273,7 @@ struct usb_serial_driver { | |||
270 | int (*tiocmget)(struct tty_struct *tty); | 273 | int (*tiocmget)(struct tty_struct *tty); |
271 | int (*tiocmset)(struct tty_struct *tty, | 274 | int (*tiocmset)(struct tty_struct *tty, |
272 | unsigned int set, unsigned int clear); | 275 | unsigned int set, unsigned int clear); |
276 | int (*tiocmiwait)(struct tty_struct *tty, unsigned long arg); | ||
273 | int (*get_icount)(struct tty_struct *tty, | 277 | int (*get_icount)(struct tty_struct *tty, |
274 | struct serial_icounter_struct *icount); | 278 | struct serial_icounter_struct *icount); |
275 | /* Called by the tty layer for port level work. There may or may not | 279 | /* Called by the tty layer for port level work. There may or may not |
@@ -327,8 +331,10 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | |||
327 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 331 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
328 | extern void usb_serial_generic_throttle(struct tty_struct *tty); | 332 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
329 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 333 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
330 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); | 334 | extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty, |
331 | extern void usb_serial_generic_release(struct usb_serial *serial); | 335 | unsigned long arg); |
336 | extern int usb_serial_generic_get_icount(struct tty_struct *tty, | ||
337 | struct serial_icounter_struct *icount); | ||
332 | extern int usb_serial_generic_register(void); | 338 | extern int usb_serial_generic_register(void); |
333 | extern void usb_serial_generic_deregister(void); | 339 | extern void usb_serial_generic_deregister(void); |
334 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, | 340 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 9ebebe906925..1b7519a8c0bf 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h | |||
@@ -61,10 +61,14 @@ struct tegra_usb_phy { | |||
61 | struct device *dev; | 61 | struct device *dev; |
62 | bool is_legacy_phy; | 62 | bool is_legacy_phy; |
63 | bool is_ulpi_phy; | 63 | bool is_ulpi_phy; |
64 | void (*set_pts)(struct usb_phy *x, u8 pts_val); | ||
65 | void (*set_phcd)(struct usb_phy *x, bool enable); | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | 68 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, |
67 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); | 69 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode, |
70 | void (*set_pts)(struct usb_phy *x, u8 pts_val), | ||
71 | void (*set_phcd)(struct usb_phy *x, bool enable)); | ||
68 | 72 | ||
69 | void tegra_usb_phy_preresume(struct usb_phy *phy); | 73 | void tegra_usb_phy_preresume(struct usb_phy *phy); |
70 | 74 | ||
@@ -75,8 +79,4 @@ void tegra_ehci_phy_restore_start(struct usb_phy *phy, | |||
75 | 79 | ||
76 | void tegra_ehci_phy_restore_end(struct usb_phy *phy); | 80 | void tegra_ehci_phy_restore_end(struct usb_phy *phy); |
77 | 81 | ||
78 | void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val); | ||
79 | |||
80 | void tegra_ehci_set_phcd(struct usb_phy *x, bool enable); | ||
81 | |||
82 | #endif /* __TEGRA_USB_PHY_H */ | 82 | #endif /* __TEGRA_USB_PHY_H */ |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 6f033a415ecb..5c295c26ad37 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h | |||
@@ -181,8 +181,16 @@ | |||
181 | 181 | ||
182 | /*-------------------------------------------------------------------------*/ | 182 | /*-------------------------------------------------------------------------*/ |
183 | 183 | ||
184 | #if IS_ENABLED(CONFIG_USB_ULPI) | ||
184 | struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, | 185 | struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, |
185 | unsigned int flags); | 186 | unsigned int flags); |
187 | #else | ||
188 | static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, | ||
189 | unsigned int flags) | ||
190 | { | ||
191 | return NULL; | ||
192 | } | ||
193 | #endif | ||
186 | 194 | ||
187 | #ifdef CONFIG_USB_ULPI_VIEWPORT | 195 | #ifdef CONFIG_USB_ULPI_VIEWPORT |
188 | /* access ops for controllers with a viewport register */ | 196 | /* access ops for controllers with a viewport register */ |