aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 12:26:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-13 12:26:40 -0500
commit237f38c3b3ab08eadecc89b7c9647b1cdb996bbe (patch)
treeed3740f13723f9082715d656d2bd3d37967ca858 /include/linux
parent67990608c8b95d2b8ccc29932376ae73d5818727 (diff)
parent60d77b3d2229eaf29eddf0d7a7947c3c922b1a4d (diff)
Merge tag 'usb-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here is the big USB drivers update for 4.5-rc1. Lots of gadget driver updates and fixes, like usual, and a mix of other USB driver updates as well. Full details in the shortlog. All of these have been in linux-next for a while" * tag 'usb-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (191 commits) MAINTAINERS: change my email address USB: usbmon: remove assignment from IS_ERR argument USB: mxu11x0: drop redundant function name from error messages USB: mxu11x0: fix debug-message typos USB: mxu11x0: rename usb-serial driver USB: mxu11x0: fix modem-control handling on B0-transitions USB: mxu11x0: fix memory leak on firmware download USB: mxu11x0: fix memory leak in port-probe error path USB: serial: add Moxa UPORT 11x0 driver USB: cp210x: add ID for ELV Marble Sound Board 1 usb: chipidea: otg: use usb autosuspend to suspend bus for HNP usb: chipidea: host: set host to be null after hcd is freed usb: chipidea: removing of_find_property usb: chipidea: implement platform shutdown callback usb: chipidea: clean up CONFIG_USB_CHIPIDEA_DEBUG reference usb: chipidea: delete static debug support usb: chipidea: support debugfs without CONFIG_USB_CHIPIDEA_DEBUG usb: chipidea: udc: improve error handling on _hardware_enqueue usb: chipidea: udc: _ep_queue and _hw_queue cleanup usb: dwc3: of-simple: fix build warning on !PM ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy/omap_usb.h23
-rw-r--r--include/linux/platform_data/usb-rcar-phy.h28
-rw-r--r--include/linux/usb.h6
-rw-r--r--include/linux/usb/gadget.h11
-rw-r--r--include/linux/usb/hcd.h4
-rw-r--r--include/linux/usb/musb-omap.h30
-rw-r--r--include/linux/usb/musb.h15
-rw-r--r--include/linux/usb/of.h6
-rw-r--r--include/linux/usb/renesas_usbhs.h18
9 files changed, 75 insertions, 66 deletions
diff --git a/include/linux/phy/omap_usb.h b/include/linux/phy/omap_usb.h
index dc2c541a619b..2e5fb870efa9 100644
--- a/include/linux/phy/omap_usb.h
+++ b/include/linux/phy/omap_usb.h
@@ -30,6 +30,12 @@ struct usb_dpll_params {
30 u32 mf; 30 u32 mf;
31}; 31};
32 32
33enum omap_usb_phy_type {
34 TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */
35 TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */
36 TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */
37};
38
33struct omap_usb { 39struct omap_usb {
34 struct usb_phy phy; 40 struct usb_phy phy;
35 struct phy_companion *comparator; 41 struct phy_companion *comparator;
@@ -40,11 +46,20 @@ struct omap_usb {
40 struct clk *wkupclk; 46 struct clk *wkupclk;
41 struct clk *optclk; 47 struct clk *optclk;
42 u8 flags; 48 u8 flags;
49 enum omap_usb_phy_type type;
50 struct regmap *syscon_phy_power; /* ctrl. reg. acces */
51 unsigned int power_reg; /* power reg. index within syscon */
52 u32 mask;
53 u32 power_on;
54 u32 power_off;
43}; 55};
44 56
45struct usb_phy_data { 57struct usb_phy_data {
46 const char *label; 58 const char *label;
47 u8 flags; 59 u8 flags;
60 u32 mask;
61 u32 power_on;
62 u32 power_off;
48}; 63};
49 64
50/* Driver Flags */ 65/* Driver Flags */
@@ -52,6 +67,14 @@ struct usb_phy_data {
52#define OMAP_USB2_HAS_SET_VBUS (1 << 1) 67#define OMAP_USB2_HAS_SET_VBUS (1 << 1)
53#define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2) 68#define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT (1 << 2)
54 69
70#define OMAP_DEV_PHY_PD BIT(0)
71#define OMAP_USB2_PHY_PD BIT(28)
72
73#define AM437X_USB2_PHY_PD BIT(0)
74#define AM437X_USB2_OTG_PD BIT(1)
75#define AM437X_USB2_OTGVDET_EN BIT(19)
76#define AM437X_USB2_OTGSESSEND_EN BIT(20)
77
55#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy) 78#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
56 79
57#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE) 80#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE)
diff --git a/include/linux/platform_data/usb-rcar-phy.h b/include/linux/platform_data/usb-rcar-phy.h
deleted file mode 100644
index 8ec6964a32a5..000000000000
--- a/include/linux/platform_data/usb-rcar-phy.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (C) 2013 Renesas Solutions Corp.
3 * Copyright (C) 2013 Cogent Embedded, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef __USB_RCAR_PHY_H
11#define __USB_RCAR_PHY_H
12
13#include <linux/types.h>
14
15struct rcar_phy_platform_data {
16 bool ferrite_bead:1; /* (R8A7778 only) */
17
18 bool port1_func:1; /* true: port 1 used by function, false: host */
19 unsigned penc1:1; /* Output of the PENC1 pin in function mode */
20 struct { /* Overcurrent pin control for ports 0..2 */
21 bool select_3_3v:1; /* true: USB_OVCn pin, false: OVCn pin */
22 /* Set to false on port 1 in function mode */
23 bool active_high:1; /* true: active high, false: active low */
24 /* Set to true on port 1 in function mode */
25 } ovc_pin[3]; /* (R8A7778 only has 2 ports) */
26};
27
28#endif /* __USB_RCAR_PHY_H */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index b9a28074210f..89533ba38691 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -510,7 +510,8 @@ struct usb3_lpm_parameters {
510 * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM 510 * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM
511 * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled 511 * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled
512 * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled 512 * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled
513 * @usb3_lpm_enabled: USB3 hardware LPM enabled 513 * @usb3_lpm_u1_enabled: USB3 hardware U1 LPM enabled
514 * @usb3_lpm_u2_enabled: USB3 hardware U2 LPM enabled
514 * @string_langid: language ID for strings 515 * @string_langid: language ID for strings
515 * @product: iProduct string, if present (static) 516 * @product: iProduct string, if present (static)
516 * @manufacturer: iManufacturer string, if present (static) 517 * @manufacturer: iManufacturer string, if present (static)
@@ -583,7 +584,8 @@ struct usb_device {
583 unsigned usb2_hw_lpm_besl_capable:1; 584 unsigned usb2_hw_lpm_besl_capable:1;
584 unsigned usb2_hw_lpm_enabled:1; 585 unsigned usb2_hw_lpm_enabled:1;
585 unsigned usb2_hw_lpm_allowed:1; 586 unsigned usb2_hw_lpm_allowed:1;
586 unsigned usb3_lpm_enabled:1; 587 unsigned usb3_lpm_u1_enabled:1;
588 unsigned usb3_lpm_u2_enabled:1;
587 int string_langid; 589 int string_langid;
588 590
589 /* static strings from the device */ 591 /* static strings from the device */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 3d583a10b926..d82d0068872b 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -402,6 +402,9 @@ static inline void usb_ep_free_request(struct usb_ep *ep,
402static inline int usb_ep_queue(struct usb_ep *ep, 402static inline int usb_ep_queue(struct usb_ep *ep,
403 struct usb_request *req, gfp_t gfp_flags) 403 struct usb_request *req, gfp_t gfp_flags)
404{ 404{
405 if (WARN_ON_ONCE(!ep->enabled && ep->address))
406 return -ESHUTDOWN;
407
405 return ep->ops->queue(ep, req, gfp_flags); 408 return ep->ops->queue(ep, req, gfp_flags);
406} 409}
407 410
@@ -1012,6 +1015,9 @@ static inline int usb_gadget_activate(struct usb_gadget *gadget)
1012 * @reset: Invoked on USB bus reset. It is mandatory for all gadget drivers 1015 * @reset: Invoked on USB bus reset. It is mandatory for all gadget drivers
1013 * and should be called in_interrupt. 1016 * and should be called in_interrupt.
1014 * @driver: Driver model state for this driver. 1017 * @driver: Driver model state for this driver.
1018 * @udc_name: A name of UDC this driver should be bound to. If udc_name is NULL,
1019 * this driver will be bound to any available UDC.
1020 * @pending: UDC core private data used for deferred probe of this driver.
1015 * 1021 *
1016 * Devices are disabled till a gadget driver successfully bind()s, which 1022 * Devices are disabled till a gadget driver successfully bind()s, which
1017 * means the driver will handle setup() requests needed to enumerate (and 1023 * means the driver will handle setup() requests needed to enumerate (and
@@ -1072,6 +1078,9 @@ struct usb_gadget_driver {
1072 1078
1073 /* FIXME support safe rmmod */ 1079 /* FIXME support safe rmmod */
1074 struct device_driver driver; 1080 struct device_driver driver;
1081
1082 char *udc_name;
1083 struct list_head pending;
1075}; 1084};
1076 1085
1077 1086
@@ -1117,8 +1126,6 @@ extern int usb_add_gadget_udc_release(struct device *parent,
1117 struct usb_gadget *gadget, void (*release)(struct device *dev)); 1126 struct usb_gadget *gadget, void (*release)(struct device *dev));
1118extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); 1127extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
1119extern void usb_del_gadget_udc(struct usb_gadget *gadget); 1128extern void usb_del_gadget_udc(struct usb_gadget *gadget);
1120extern int usb_udc_attach_driver(const char *name,
1121 struct usb_gadget_driver *driver);
1122 1129
1123/*-------------------------------------------------------------------------*/ 1130/*-------------------------------------------------------------------------*/
1124 1131
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index f89c24bd53a4..4dcf8446dbcd 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -660,7 +660,7 @@ struct usb_mon_operations {
660 /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */ 660 /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */
661}; 661};
662 662
663extern struct usb_mon_operations *mon_ops; 663extern const struct usb_mon_operations *mon_ops;
664 664
665static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) 665static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
666{ 666{
@@ -682,7 +682,7 @@ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
682 (*mon_ops->urb_complete)(bus, urb, status); 682 (*mon_ops->urb_complete)(bus, urb, status);
683} 683}
684 684
685int usb_mon_register(struct usb_mon_operations *ops); 685int usb_mon_register(const struct usb_mon_operations *ops);
686void usb_mon_deregister(void); 686void usb_mon_deregister(void);
687 687
688#else 688#else
diff --git a/include/linux/usb/musb-omap.h b/include/linux/usb/musb-omap.h
deleted file mode 100644
index 7774c5986f07..000000000000
--- a/include/linux/usb/musb-omap.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2011-2012 by Texas Instruments
3 *
4 * The Inventra Controller Driver for Linux is free software; you
5 * can redistribute it and/or modify it under the terms of the GNU
6 * General Public License version 2 as published by the Free Software
7 * Foundation.
8 */
9
10#ifndef __MUSB_OMAP_H__
11#define __MUSB_OMAP_H__
12
13enum omap_musb_vbus_id_status {
14 OMAP_MUSB_UNKNOWN = 0,
15 OMAP_MUSB_ID_GROUND,
16 OMAP_MUSB_ID_FLOAT,
17 OMAP_MUSB_VBUS_VALID,
18 OMAP_MUSB_VBUS_OFF,
19};
20
21#if (defined(CONFIG_USB_MUSB_OMAP2PLUS) || \
22 defined(CONFIG_USB_MUSB_OMAP2PLUS_MODULE))
23void omap_musb_mailbox(enum omap_musb_vbus_id_status status);
24#else
25static inline void omap_musb_mailbox(enum omap_musb_vbus_id_status status)
26{
27}
28#endif
29
30#endif /* __MUSB_OMAP_H__ */
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index fa6dc132bd1b..96ddfb7ab018 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -133,6 +133,21 @@ struct musb_hdrc_platform_data {
133 const void *platform_ops; 133 const void *platform_ops;
134}; 134};
135 135
136enum musb_vbus_id_status {
137 MUSB_UNKNOWN = 0,
138 MUSB_ID_GROUND,
139 MUSB_ID_FLOAT,
140 MUSB_VBUS_VALID,
141 MUSB_VBUS_OFF,
142};
143
144#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
145void musb_mailbox(enum musb_vbus_id_status status);
146#else
147static inline void musb_mailbox(enum musb_vbus_id_status status)
148{
149}
150#endif
136 151
137/* TUSB 6010 support */ 152/* TUSB 6010 support */
138 153
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index c3fe9e48ce27..974bce93aa28 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -12,10 +12,16 @@
12#include <linux/usb/phy.h> 12#include <linux/usb/phy.h>
13 13
14#if IS_ENABLED(CONFIG_OF) 14#if IS_ENABLED(CONFIG_OF)
15enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np);
15bool of_usb_host_tpl_support(struct device_node *np); 16bool of_usb_host_tpl_support(struct device_node *np);
16int of_usb_update_otg_caps(struct device_node *np, 17int of_usb_update_otg_caps(struct device_node *np,
17 struct usb_otg_caps *otg_caps); 18 struct usb_otg_caps *otg_caps);
18#else 19#else
20static inline enum usb_dr_mode
21of_usb_get_dr_mode_by_phy(struct device_node *phy_np)
22{
23 return USB_DR_MODE_UNKNOWN;
24}
19static inline bool of_usb_host_tpl_support(struct device_node *np) 25static inline bool of_usb_host_tpl_support(struct device_node *np)
20{ 26{
21 return false; 27 return false;
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index bfb74723f151..4db191fe8c2c 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -105,12 +105,26 @@ struct renesas_usbhs_platform_callback {
105 * some register needs USB chip specific parameters. 105 * some register needs USB chip specific parameters.
106 * This struct show it to driver 106 * This struct show it to driver
107 */ 107 */
108
109struct renesas_usbhs_driver_pipe_config {
110 u8 type; /* USB_ENDPOINT_XFER_xxx */
111 u16 bufsize;
112 u8 bufnum;
113 bool double_buf;
114};
115#define RENESAS_USBHS_PIPE(_type, _size, _num, _double_buf) { \
116 .type = (_type), \
117 .bufsize = (_size), \
118 .bufnum = (_num), \
119 .double_buf = (_double_buf), \
120 }
121
108struct renesas_usbhs_driver_param { 122struct renesas_usbhs_driver_param {
109 /* 123 /*
110 * pipe settings 124 * pipe settings
111 */ 125 */
112 u32 *pipe_type; /* array of USB_ENDPOINT_XFER_xxx (from ep0) */ 126 struct renesas_usbhs_driver_pipe_config *pipe_configs;
113 int pipe_size; /* pipe_type array size */ 127 int pipe_size; /* pipe_configs array size */
114 128
115 /* 129 /*
116 * option: 130 * option: