aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 17:57:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-14 17:57:16 -0500
commite7cf773d431a63a2417902696fcc9e0ebdc83bbe (patch)
tree86dbdceb7d91226507a3af0d57e03b0ca664b22e /include/linux/usb
parent7a02d089695a1217992434f03a78aa32bad85b5c (diff)
parent81e1dadfb5b2d47aa513ad60b1c9cf0ea17b6514 (diff)
Merge tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big set of USB and PHY patches for 3.19-rc1. The normal churn in the USB gadget area is in here, as well as xhci and other individual USB driver updates. The PHY tree is also in here, as there were dependancies on the USB tree. All of these have been in linux-next" * tag 'usb-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (351 commits) arm: omap3: twl: remove usb phy init data usbip: fix error handling in stub_probe() usb: gadget: udc: missing curly braces USB: mos7720: delete some unneeded code wusb: replace memset by memzero_explicit usbip: remove unneeded structure usb: xhci: fix comment for PORT_DEV_REMOVE xhci: don't use the same variable for stopped and halted rings current TD xhci: clear extra bits from slot context when setting max exit latency xhci: cleanup finish_td function USB: adutux: NULL dereferences on disconnect usb: chipidea: fix platform_no_drv_owner.cocci warnings usb: chipidea: Fixed a few typos in comments Documentation: bindings: add doc for the USB2 ChipIdea USB driver usb: chipidea: add a usb2 driver for ci13xxx usb: chipidea: fix phy handling usb: chipidea: remove duplicate dev_set_drvdata for host_start usb: chipidea: parameter 'mode' isn't needed for hw_device_reset usb: chipidea: add controller reset API usb: chipidea: remove flag CI_HDRC_REQUIRE_TRANSCEIVER ...
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/chipidea.h5
-rw-r--r--include/linux/usb/composite.h7
-rw-r--r--include/linux/usb/ehci-dbgp.h83
-rw-r--r--include/linux/usb/ehci_def.h65
-rw-r--r--include/linux/usb/gadget.h5
-rw-r--r--include/linux/usb/hcd.h3
-rw-r--r--include/linux/usb/otg.h7
-rw-r--r--include/linux/usb/phy.h6
-rw-r--r--include/linux/usb/renesas_usbhs.h4
9 files changed, 115 insertions, 70 deletions
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index e14c09a45c5a..535997a6681b 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -13,11 +13,12 @@ struct ci_hdrc_platform_data {
13 /* offset of the capability registers */ 13 /* offset of the capability registers */
14 uintptr_t capoffset; 14 uintptr_t capoffset;
15 unsigned power_budget; 15 unsigned power_budget;
16 struct usb_phy *phy; 16 struct phy *phy;
17 /* old usb_phy interface */
18 struct usb_phy *usb_phy;
17 enum usb_phy_interface phy_mode; 19 enum usb_phy_interface phy_mode;
18 unsigned long flags; 20 unsigned long flags;
19#define CI_HDRC_REGS_SHARED BIT(0) 21#define CI_HDRC_REGS_SHARED BIT(0)
20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
21#define CI_HDRC_DISABLE_STREAMING BIT(3) 22#define CI_HDRC_DISABLE_STREAMING BIT(3)
22 /* 23 /*
23 * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1, 24 * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index c330f5ef42cf..3d87defcc527 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -427,6 +427,8 @@ static inline struct usb_composite_driver *to_cdriver(
427 * @b_vendor_code: bMS_VendorCode part of the OS string 427 * @b_vendor_code: bMS_VendorCode part of the OS string
428 * @use_os_string: false by default, interested gadgets set it 428 * @use_os_string: false by default, interested gadgets set it
429 * @os_desc_config: the configuration to be used with OS descriptors 429 * @os_desc_config: the configuration to be used with OS descriptors
430 * @setup_pending: true when setup request is queued but not completed
431 * @os_desc_pending: true when os_desc request is queued but not completed
430 * 432 *
431 * One of these devices is allocated and initialized before the 433 * One of these devices is allocated and initialized before the
432 * associated device driver's bind() is called. 434 * associated device driver's bind() is called.
@@ -488,6 +490,9 @@ struct usb_composite_dev {
488 490
489 /* protects deactivations and delayed_status counts*/ 491 /* protects deactivations and delayed_status counts*/
490 spinlock_t lock; 492 spinlock_t lock;
493
494 unsigned setup_pending:1;
495 unsigned os_desc_pending:1;
491}; 496};
492 497
493extern int usb_string_id(struct usb_composite_dev *c); 498extern int usb_string_id(struct usb_composite_dev *c);
@@ -501,6 +506,8 @@ extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n);
501extern void composite_disconnect(struct usb_gadget *gadget); 506extern void composite_disconnect(struct usb_gadget *gadget);
502extern int composite_setup(struct usb_gadget *gadget, 507extern int composite_setup(struct usb_gadget *gadget,
503 const struct usb_ctrlrequest *ctrl); 508 const struct usb_ctrlrequest *ctrl);
509extern void composite_suspend(struct usb_gadget *gadget);
510extern void composite_resume(struct usb_gadget *gadget);
504 511
505/* 512/*
506 * Some systems will need runtime overrides for the product identifiers 513 * Some systems will need runtime overrides for the product identifiers
diff --git a/include/linux/usb/ehci-dbgp.h b/include/linux/usb/ehci-dbgp.h
new file mode 100644
index 000000000000..7344d9e591cc
--- /dev/null
+++ b/include/linux/usb/ehci-dbgp.h
@@ -0,0 +1,83 @@
1/*
2 * Standalone EHCI usb debug driver
3 *
4 * Originally written by:
5 * Eric W. Biederman" <ebiederm@xmission.com> and
6 * Yinghai Lu <yhlu.kernel@gmail.com>
7 *
8 * Changes for early/late printk and HW errata:
9 * Jason Wessel <jason.wessel@windriver.com>
10 * Copyright (C) 2009 Wind River Systems, Inc.
11 *
12 */
13
14#ifndef __LINUX_USB_EHCI_DBGP_H
15#define __LINUX_USB_EHCI_DBGP_H
16
17#include <linux/console.h>
18#include <linux/types.h>
19
20/* Appendix C, Debug port ... intended for use with special "debug devices"
21 * that can help if there's no serial console. (nonstandard enumeration.)
22 */
23struct ehci_dbg_port {
24 u32 control;
25#define DBGP_OWNER (1<<30)
26#define DBGP_ENABLED (1<<28)
27#define DBGP_DONE (1<<16)
28#define DBGP_INUSE (1<<10)
29#define DBGP_ERRCODE(x) (((x)>>7)&0x07)
30# define DBGP_ERR_BAD 1
31# define DBGP_ERR_SIGNAL 2
32#define DBGP_ERROR (1<<6)
33#define DBGP_GO (1<<5)
34#define DBGP_OUT (1<<4)
35#define DBGP_LEN(x) (((x)>>0)&0x0f)
36 u32 pids;
37#define DBGP_PID_GET(x) (((x)>>16)&0xff)
38#define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
39 u32 data03;
40 u32 data47;
41 u32 address;
42#define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep))
43};
44
45#ifdef CONFIG_EARLY_PRINTK_DBGP
46extern int early_dbgp_init(char *s);
47extern struct console early_dbgp_console;
48#endif /* CONFIG_EARLY_PRINTK_DBGP */
49
50struct usb_hcd;
51
52#ifdef CONFIG_XEN_DOM0
53extern int xen_dbgp_reset_prep(struct usb_hcd *);
54extern int xen_dbgp_external_startup(struct usb_hcd *);
55#else
56static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd)
57{
58 return 1; /* Shouldn't this be 0? */
59}
60
61static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
62{
63 return -1;
64}
65#endif
66
67#ifdef CONFIG_EARLY_PRINTK_DBGP
68/* Call backs from ehci host driver to ehci debug driver */
69extern int dbgp_external_startup(struct usb_hcd *);
70extern int dbgp_reset_prep(struct usb_hcd *);
71#else
72static inline int dbgp_reset_prep(struct usb_hcd *hcd)
73{
74 return xen_dbgp_reset_prep(hcd);
75}
76
77static inline int dbgp_external_startup(struct usb_hcd *hcd)
78{
79 return xen_dbgp_external_startup(hcd);
80}
81#endif
82
83#endif /* __LINUX_USB_EHCI_DBGP_H */
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index daec99af5d54..966889a20ea3 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -19,6 +19,8 @@
19#ifndef __LINUX_USB_EHCI_DEF_H 19#ifndef __LINUX_USB_EHCI_DEF_H
20#define __LINUX_USB_EHCI_DEF_H 20#define __LINUX_USB_EHCI_DEF_H
21 21
22#include <linux/usb/ehci-dbgp.h>
23
22/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */ 24/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
23 25
24/* Section 2.2 Host Controller Capability Registers */ 26/* Section 2.2 Host Controller Capability Registers */
@@ -190,67 +192,4 @@ struct ehci_regs {
190#define USBMODE_EX_HC (3<<0) /* host controller mode */ 192#define USBMODE_EX_HC (3<<0) /* host controller mode */
191}; 193};
192 194
193/* Appendix C, Debug port ... intended for use with special "debug devices"
194 * that can help if there's no serial console. (nonstandard enumeration.)
195 */
196struct ehci_dbg_port {
197 u32 control;
198#define DBGP_OWNER (1<<30)
199#define DBGP_ENABLED (1<<28)
200#define DBGP_DONE (1<<16)
201#define DBGP_INUSE (1<<10)
202#define DBGP_ERRCODE(x) (((x)>>7)&0x07)
203# define DBGP_ERR_BAD 1
204# define DBGP_ERR_SIGNAL 2
205#define DBGP_ERROR (1<<6)
206#define DBGP_GO (1<<5)
207#define DBGP_OUT (1<<4)
208#define DBGP_LEN(x) (((x)>>0)&0x0f)
209 u32 pids;
210#define DBGP_PID_GET(x) (((x)>>16)&0xff)
211#define DBGP_PID_SET(data, tok) (((data)<<8)|(tok))
212 u32 data03;
213 u32 data47;
214 u32 address;
215#define DBGP_EPADDR(dev, ep) (((dev)<<8)|(ep))
216};
217
218#ifdef CONFIG_EARLY_PRINTK_DBGP
219#include <linux/init.h>
220extern int __init early_dbgp_init(char *s);
221extern struct console early_dbgp_console;
222#endif /* CONFIG_EARLY_PRINTK_DBGP */
223
224struct usb_hcd;
225
226#ifdef CONFIG_XEN_DOM0
227extern int xen_dbgp_reset_prep(struct usb_hcd *);
228extern int xen_dbgp_external_startup(struct usb_hcd *);
229#else
230static inline int xen_dbgp_reset_prep(struct usb_hcd *hcd)
231{
232 return 1; /* Shouldn't this be 0? */
233}
234
235static inline int xen_dbgp_external_startup(struct usb_hcd *hcd)
236{
237 return -1;
238}
239#endif
240
241#ifdef CONFIG_EARLY_PRINTK_DBGP
242/* Call backs from ehci host driver to ehci debug driver */
243extern int dbgp_external_startup(struct usb_hcd *);
244extern int dbgp_reset_prep(struct usb_hcd *hcd);
245#else
246static inline int dbgp_reset_prep(struct usb_hcd *hcd)
247{
248 return xen_dbgp_reset_prep(hcd);
249}
250static inline int dbgp_external_startup(struct usb_hcd *hcd)
251{
252 return xen_dbgp_external_startup(hcd);
253}
254#endif
255
256#endif /* __LINUX_USB_EHCI_DEF_H */ 195#endif /* __LINUX_USB_EHCI_DEF_H */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 522cafe26790..70ddb3943b62 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -490,8 +490,7 @@ struct usb_gadget_ops {
490 void (*get_config_params)(struct usb_dcd_config_params *); 490 void (*get_config_params)(struct usb_dcd_config_params *);
491 int (*udc_start)(struct usb_gadget *, 491 int (*udc_start)(struct usb_gadget *,
492 struct usb_gadget_driver *); 492 struct usb_gadget_driver *);
493 int (*udc_stop)(struct usb_gadget *, 493 int (*udc_stop)(struct usb_gadget *);
494 struct usb_gadget_driver *);
495}; 494};
496 495
497/** 496/**
@@ -925,7 +924,7 @@ extern int usb_add_gadget_udc_release(struct device *parent,
925 struct usb_gadget *gadget, void (*release)(struct device *dev)); 924 struct usb_gadget *gadget, void (*release)(struct device *dev));
926extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); 925extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
927extern void usb_del_gadget_udc(struct usb_gadget *gadget); 926extern void usb_del_gadget_udc(struct usb_gadget *gadget);
928extern int udc_attach_driver(const char *name, 927extern int usb_udc_attach_driver(const char *name,
929 struct usb_gadget_driver *driver); 928 struct usb_gadget_driver *driver);
930 929
931/*-------------------------------------------------------------------------*/ 930/*-------------------------------------------------------------------------*/
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 668898e29d0e..086bf13307e6 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -379,6 +379,9 @@ struct hc_driver {
379 int (*disable_usb3_lpm_timeout)(struct usb_hcd *, 379 int (*disable_usb3_lpm_timeout)(struct usb_hcd *,
380 struct usb_device *, enum usb3_link_state state); 380 struct usb_device *, enum usb3_link_state state);
381 int (*find_raw_port_number)(struct usb_hcd *, int); 381 int (*find_raw_port_number)(struct usb_hcd *, int);
382 /* Call for power on/off the port if necessary */
383 int (*port_power)(struct usb_hcd *hcd, int portnum, bool enable);
384
382}; 385};
383 386
384static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd) 387static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 154332b7c8c0..52661c5da690 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,15 +9,20 @@
9#ifndef __LINUX_USB_OTG_H 9#ifndef __LINUX_USB_OTG_H
10#define __LINUX_USB_OTG_H 10#define __LINUX_USB_OTG_H
11 11
12#include <linux/phy/phy.h>
12#include <linux/usb/phy.h> 13#include <linux/usb/phy.h>
13 14
14struct usb_otg { 15struct usb_otg {
15 u8 default_a; 16 u8 default_a;
16 17
17 struct usb_phy *phy; 18 struct phy *phy;
19 /* old usb_phy interface */
20 struct usb_phy *usb_phy;
18 struct usb_bus *host; 21 struct usb_bus *host;
19 struct usb_gadget *gadget; 22 struct usb_gadget *gadget;
20 23
24 enum usb_otg_state state;
25
21 /* bind/unbind the host controller */ 26 /* bind/unbind the host controller */
22 int (*set_host)(struct usb_otg *otg, struct usb_bus *host); 27 int (*set_host)(struct usb_otg *otg, struct usb_bus *host);
23 28
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 353053a33f21..f499c23e6342 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -77,7 +77,6 @@ struct usb_phy {
77 unsigned int flags; 77 unsigned int flags;
78 78
79 enum usb_phy_type type; 79 enum usb_phy_type type;
80 enum usb_otg_state state;
81 enum usb_phy_events last_event; 80 enum usb_phy_events last_event;
82 81
83 struct usb_otg *otg; 82 struct usb_otg *otg;
@@ -210,6 +209,7 @@ extern void usb_put_phy(struct usb_phy *);
210extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); 209extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
211extern int usb_bind_phy(const char *dev_name, u8 index, 210extern int usb_bind_phy(const char *dev_name, u8 index,
212 const char *phy_dev_name); 211 const char *phy_dev_name);
212extern void usb_phy_set_event(struct usb_phy *x, unsigned long event);
213#else 213#else
214static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) 214static inline struct usb_phy *usb_get_phy(enum usb_phy_type type)
215{ 215{
@@ -251,6 +251,10 @@ static inline int usb_bind_phy(const char *dev_name, u8 index,
251{ 251{
252 return -EOPNOTSUPP; 252 return -EOPNOTSUPP;
253} 253}
254
255static inline void usb_phy_set_event(struct usb_phy *x, unsigned long event)
256{
257}
254#endif 258#endif
255 259
256static inline int 260static inline int
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index d5952bb66752..9fd9e481ea98 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -145,6 +145,10 @@ struct renesas_usbhs_driver_param {
145 int d0_rx_id; 145 int d0_rx_id;
146 int d1_tx_id; 146 int d1_tx_id;
147 int d1_rx_id; 147 int d1_rx_id;
148 int d2_tx_id;
149 int d2_rx_id;
150 int d3_tx_id;
151 int d3_rx_id;
148 152
149 /* 153 /*
150 * option: 154 * option: