diff options
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/audio-v2.h | 2 | ||||
-rw-r--r-- | include/linux/usb/cdc-wdm.h | 2 | ||||
-rw-r--r-- | include/linux/usb/ch9.h | 9 | ||||
-rw-r--r-- | include/linux/usb/composite.h | 3 | ||||
-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 | 6 | ||||
-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 | 12 | ||||
-rw-r--r-- | include/linux/usb/tegra_usb_phy.h | 10 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 7 |
16 files changed, 230 insertions, 32 deletions
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h index ed13053153f4..c5f2158ab00e 100644 --- a/include/linux/usb/audio-v2.h +++ b/include/linux/usb/audio-v2.h | |||
@@ -170,6 +170,8 @@ struct uac2_as_header_descriptor { | |||
170 | __u8 iChannelNames; | 170 | __u8 iChannelNames; |
171 | } __attribute__((packed)); | 171 | } __attribute__((packed)); |
172 | 172 | ||
173 | #define UAC2_FORMAT_TYPE_I_RAW_DATA (1 << 31) | ||
174 | |||
173 | /* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */ | 175 | /* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */ |
174 | 176 | ||
175 | struct uac2_iso_endpoint_descriptor { | 177 | struct uac2_iso_endpoint_descriptor { |
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/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 8860594d6364..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 |
@@ -464,6 +465,8 @@ struct usb_function_driver { | |||
464 | }; | 465 | }; |
465 | 466 | ||
466 | struct usb_function_instance { | 467 | struct usb_function_instance { |
468 | struct config_group group; | ||
469 | struct list_head cfs_list; | ||
467 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
468 | void (*free_func_inst)(struct usb_function_instance *inst); | 471 | void (*free_func_inst)(struct usb_function_instance *inst); |
469 | }; | 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 59694b5e5e90..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 | ||
@@ -593,14 +593,14 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | |||
593 | 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); |
594 | #endif /* CONFIG_PM */ | 594 | #endif /* CONFIG_PM */ |
595 | 595 | ||
596 | #ifdef CONFIG_USB_SUSPEND | 596 | #ifdef CONFIG_PM_RUNTIME |
597 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | 597 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); |
598 | #else | 598 | #else |
599 | 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) |
600 | { | 600 | { |
601 | return; | 601 | return; |
602 | } | 602 | } |
603 | #endif /* CONFIG_USB_SUSPEND */ | 603 | #endif /* CONFIG_PM_RUNTIME */ |
604 | 604 | ||
605 | /*-------------------------------------------------------------------------*/ | 605 | /*-------------------------------------------------------------------------*/ |
606 | 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 1819b59aab2a..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,12 +62,12 @@ | |||
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. |
67 | * @flags: usb serial port flags | 69 | * @flags: usb serial port flags |
68 | * @write_wait: a wait_queue_head_t used by the port. | 70 | * @write_wait: a wait_queue_head_t used by the port. |
69 | * @delta_msr_wait: modem-status-change wait queue | ||
70 | * @work: work queue entry for the line discipline waking up. | 71 | * @work: work queue entry for the line discipline waking up. |
71 | * @throttled: nonzero if the read urb is inactive to throttle the device | 72 | * @throttled: nonzero if the read urb is inactive to throttle the device |
72 | * @throttle_req: nonzero if the tty wants to throttle us | 73 | * @throttle_req: nonzero if the tty wants to throttle us |
@@ -109,11 +110,11 @@ struct usb_serial_port { | |||
109 | unsigned long write_urbs_free; | 110 | unsigned long write_urbs_free; |
110 | __u8 bulk_out_endpointAddress; | 111 | __u8 bulk_out_endpointAddress; |
111 | 112 | ||
113 | struct async_icount icount; | ||
112 | int tx_bytes; | 114 | int tx_bytes; |
113 | 115 | ||
114 | unsigned long flags; | 116 | unsigned long flags; |
115 | wait_queue_head_t write_wait; | 117 | wait_queue_head_t write_wait; |
116 | wait_queue_head_t delta_msr_wait; | ||
117 | struct work_struct work; | 118 | struct work_struct work; |
118 | char throttled; | 119 | char throttled; |
119 | char throttle_req; | 120 | char throttle_req; |
@@ -272,6 +273,7 @@ struct usb_serial_driver { | |||
272 | int (*tiocmget)(struct tty_struct *tty); | 273 | int (*tiocmget)(struct tty_struct *tty); |
273 | int (*tiocmset)(struct tty_struct *tty, | 274 | int (*tiocmset)(struct tty_struct *tty, |
274 | unsigned int set, unsigned int clear); | 275 | unsigned int set, unsigned int clear); |
276 | int (*tiocmiwait)(struct tty_struct *tty, unsigned long arg); | ||
275 | int (*get_icount)(struct tty_struct *tty, | 277 | int (*get_icount)(struct tty_struct *tty, |
276 | struct serial_icounter_struct *icount); | 278 | struct serial_icounter_struct *icount); |
277 | /* 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 |
@@ -329,8 +331,10 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | |||
329 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 331 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
330 | extern void usb_serial_generic_throttle(struct tty_struct *tty); | 332 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
331 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 333 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
332 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); | 334 | extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty, |
333 | 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); | ||
334 | extern int usb_serial_generic_register(void); | 338 | extern int usb_serial_generic_register(void); |
335 | extern void usb_serial_generic_deregister(void); | 339 | extern void usb_serial_generic_deregister(void); |
336 | 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/usbnet.h b/include/linux/usb/usbnet.h index 0e5ac93bab10..f18d64129f99 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -56,6 +56,8 @@ struct usbnet { | |||
56 | struct sk_buff_head done; | 56 | struct sk_buff_head done; |
57 | struct sk_buff_head rxq_pause; | 57 | struct sk_buff_head rxq_pause; |
58 | struct urb *interrupt; | 58 | struct urb *interrupt; |
59 | unsigned interrupt_count; | ||
60 | struct mutex interrupt_mutex; | ||
59 | struct usb_anchor deferred; | 61 | struct usb_anchor deferred; |
60 | struct tasklet_struct bh; | 62 | struct tasklet_struct bh; |
61 | 63 | ||
@@ -72,6 +74,7 @@ struct usbnet { | |||
72 | # define EVENT_DEVICE_REPORT_IDLE 8 | 74 | # define EVENT_DEVICE_REPORT_IDLE 8 |
73 | # define EVENT_NO_RUNTIME_PM 9 | 75 | # define EVENT_NO_RUNTIME_PM 9 |
74 | # define EVENT_RX_KILL 10 | 76 | # define EVENT_RX_KILL 10 |
77 | # define EVENT_LINK_CHANGE 11 | ||
75 | }; | 78 | }; |
76 | 79 | ||
77 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 80 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
@@ -245,5 +248,9 @@ extern void usbnet_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); | |||
245 | extern int usbnet_nway_reset(struct net_device *net); | 248 | extern int usbnet_nway_reset(struct net_device *net); |
246 | 249 | ||
247 | extern int usbnet_manage_power(struct usbnet *, int); | 250 | extern int usbnet_manage_power(struct usbnet *, int); |
251 | extern void usbnet_link_change(struct usbnet *, bool, bool); | ||
252 | |||
253 | extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); | ||
254 | extern void usbnet_status_stop(struct usbnet *dev); | ||
248 | 255 | ||
249 | #endif /* __LINUX_USB_USBNET_H */ | 256 | #endif /* __LINUX_USB_USBNET_H */ |