aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/chipidea.h31
-rw-r--r--include/linux/usb/hcd.h1
-rw-r--r--include/linux/usb/of.h32
-rw-r--r--include/linux/usb/otg.h7
-rw-r--r--include/linux/usb/phy.h9
-rw-r--r--include/linux/usb/serial.h15
-rw-r--r--include/linux/usb/tegra_usb_phy.h9
-rw-r--r--include/linux/usb/wusb-wa.h17
8 files changed, 87 insertions, 34 deletions
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 544825dde823..25629948c842 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -7,32 +7,33 @@
7 7
8#include <linux/usb/otg.h> 8#include <linux/usb/otg.h>
9 9
10struct ci13xxx; 10struct ci_hdrc;
11struct ci13xxx_platform_data { 11struct ci_hdrc_platform_data {
12 const char *name; 12 const char *name;
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 usb_phy *phy;
17 enum usb_phy_interface phy_mode;
17 unsigned long flags; 18 unsigned long flags;
18#define CI13XXX_REGS_SHARED BIT(0) 19#define CI_HDRC_REGS_SHARED BIT(0)
19#define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) 20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
20#define CI13XXX_PULLUP_ON_VBUS BIT(2) 21#define CI_HDRC_PULLUP_ON_VBUS BIT(2)
21#define CI13XXX_DISABLE_STREAMING BIT(3) 22#define CI_HDRC_DISABLE_STREAMING BIT(3)
22 23 enum usb_dr_mode dr_mode;
23#define CI13XXX_CONTROLLER_RESET_EVENT 0 24#define CI_HDRC_CONTROLLER_RESET_EVENT 0
24#define CI13XXX_CONTROLLER_STOPPED_EVENT 1 25#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
25 void (*notify_event) (struct ci13xxx *ci, unsigned event); 26 void (*notify_event) (struct ci_hdrc *ci, unsigned event);
26}; 27};
27 28
28/* Default offset of capability registers */ 29/* Default offset of capability registers */
29#define DEF_CAPOFFSET 0x100 30#define DEF_CAPOFFSET 0x100
30 31
31/* Add ci13xxx device */ 32/* Add ci hdrc device */
32struct platform_device *ci13xxx_add_device(struct device *dev, 33struct platform_device *ci_hdrc_add_device(struct device *dev,
33 struct resource *res, int nres, 34 struct resource *res, int nres,
34 struct ci13xxx_platform_data *platdata); 35 struct ci_hdrc_platform_data *platdata);
35/* Remove ci13xxx device */ 36/* Remove ci hdrc device */
36void ci13xxx_remove_device(struct platform_device *pdev); 37void ci_hdrc_remove_device(struct platform_device *pdev);
37 38
38#endif 39#endif
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index f5f5c7dfda90..1e88377e22f4 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -218,6 +218,7 @@ struct hc_driver {
218#define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ 218#define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
219#define HCD_USB11 0x0010 /* USB 1.1 */ 219#define HCD_USB11 0x0010 /* USB 1.1 */
220#define HCD_USB2 0x0020 /* USB 2.0 */ 220#define HCD_USB2 0x0020 /* USB 2.0 */
221#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/
221#define HCD_USB3 0x0040 /* USB 3.0 */ 222#define HCD_USB3 0x0040 /* USB 3.0 */
222#define HCD_MASK 0x0070 223#define HCD_MASK 0x0070
223 224
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
new file mode 100644
index 000000000000..a0ef405368b8
--- /dev/null
+++ b/include/linux/usb/of.h
@@ -0,0 +1,32 @@
1/*
2 * OF helpers for usb devices.
3 *
4 * This file is released under the GPLv2
5 */
6
7#ifndef __LINUX_USB_OF_H
8#define __LINUX_USB_OF_H
9
10#include <linux/usb/otg.h>
11#include <linux/usb/phy.h>
12
13#if IS_ENABLED(CONFIG_OF)
14enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
15#else
16static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
17{
18 return USB_DR_MODE_UNKNOWN;
19}
20#endif
21
22#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_PHY)
23enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
24#else
25static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
26{
27 return USBPHY_INTERFACE_MODE_UNKNOWN;
28}
29
30#endif
31
32#endif /* __LINUX_USB_OF_H */
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 291e01ba32e5..154332b7c8c0 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -92,4 +92,11 @@ otg_start_srp(struct usb_otg *otg)
92/* for OTG controller drivers (and maybe other stuff) */ 92/* for OTG controller drivers (and maybe other stuff) */
93extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 93extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
94 94
95enum usb_dr_mode {
96 USB_DR_MODE_UNKNOWN,
97 USB_DR_MODE_HOST,
98 USB_DR_MODE_PERIPHERAL,
99 USB_DR_MODE_OTG,
100};
101
95#endif /* __LINUX_USB_OTG_H */ 102#endif /* __LINUX_USB_OTG_H */
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 6b5978f57633..44036808bf0f 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -12,6 +12,15 @@
12#include <linux/notifier.h> 12#include <linux/notifier.h>
13#include <linux/usb.h> 13#include <linux/usb.h>
14 14
15enum usb_phy_interface {
16 USBPHY_INTERFACE_MODE_UNKNOWN,
17 USBPHY_INTERFACE_MODE_UTMI,
18 USBPHY_INTERFACE_MODE_UTMIW,
19 USBPHY_INTERFACE_MODE_ULPI,
20 USBPHY_INTERFACE_MODE_SERIAL,
21 USBPHY_INTERFACE_MODE_HSIC,
22};
23
15enum usb_phy_events { 24enum usb_phy_events {
16 USB_EVENT_NONE, /* no events or cable disconnected */ 25 USB_EVENT_NONE, /* no events or cable disconnected */
17 USB_EVENT_VBUS, /* vbus valid event */ 26 USB_EVENT_VBUS, /* vbus valid event */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 302ddf55d2da..d528b8045150 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -19,10 +19,6 @@
19#include <linux/sysrq.h> 19#include <linux/sysrq.h>
20#include <linux/kfifo.h> 20#include <linux/kfifo.h>
21 21
22#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
23#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
24#define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */
25
26/* The maximum number of ports one device can grab at once */ 22/* The maximum number of ports one device can grab at once */
27#define MAX_NUM_PORTS 8 23#define MAX_NUM_PORTS 8
28 24
@@ -37,7 +33,8 @@
37 * @serial: pointer back to the struct usb_serial owner of this port. 33 * @serial: pointer back to the struct usb_serial owner of this port.
38 * @port: pointer to the corresponding tty_port for this port. 34 * @port: pointer to the corresponding tty_port for this port.
39 * @lock: spinlock to grab when updating portions of this structure. 35 * @lock: spinlock to grab when updating portions of this structure.
40 * @number: the number of the port (the minor number). 36 * @minor: the minor number of the port
37 * @port_number: the struct usb_serial port number of this port (starts at 0)
41 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. 38 * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
42 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. 39 * @interrupt_in_urb: pointer to the interrupt in struct urb for this port.
43 * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe 40 * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe
@@ -80,7 +77,8 @@ struct usb_serial_port {
80 struct usb_serial *serial; 77 struct usb_serial *serial;
81 struct tty_port port; 78 struct tty_port port;
82 spinlock_t lock; 79 spinlock_t lock;
83 unsigned char number; 80 u32 minor;
81 u8 port_number;
84 82
85 unsigned char *interrupt_in_buffer; 83 unsigned char *interrupt_in_buffer;
86 struct urb *interrupt_in_urb; 84 struct urb *interrupt_in_urb;
@@ -140,7 +138,6 @@ static inline void usb_set_serial_port_data(struct usb_serial_port *port,
140 * @dev: pointer to the struct usb_device for this device 138 * @dev: pointer to the struct usb_device for this device
141 * @type: pointer to the struct usb_serial_driver for this device 139 * @type: pointer to the struct usb_serial_driver for this device
142 * @interface: pointer to the struct usb_interface for this device 140 * @interface: pointer to the struct usb_interface for this device
143 * @minor: the starting minor number for this device
144 * @num_ports: the number of ports this device has 141 * @num_ports: the number of ports this device has
145 * @num_interrupt_in: number of interrupt in endpoints we have 142 * @num_interrupt_in: number of interrupt in endpoints we have
146 * @num_interrupt_out: number of interrupt out endpoints we have 143 * @num_interrupt_out: number of interrupt out endpoints we have
@@ -159,7 +156,7 @@ struct usb_serial {
159 unsigned char disconnected:1; 156 unsigned char disconnected:1;
160 unsigned char suspending:1; 157 unsigned char suspending:1;
161 unsigned char attached:1; 158 unsigned char attached:1;
162 unsigned char minor; 159 unsigned char minors_reserved:1;
163 unsigned char num_ports; 160 unsigned char num_ports;
164 unsigned char num_port_pointers; 161 unsigned char num_port_pointers;
165 char num_interrupt_in; 162 char num_interrupt_in;
@@ -319,7 +316,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
319#endif 316#endif
320 317
321/* Functions needed by other parts of the usbserial core */ 318/* Functions needed by other parts of the usbserial core */
322extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); 319extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor);
323extern void usb_serial_put(struct usb_serial *serial); 320extern void usb_serial_put(struct usb_serial *serial);
324extern int usb_serial_generic_open(struct tty_struct *tty, 321extern int usb_serial_generic_open(struct tty_struct *tty,
325 struct usb_serial_port *port); 322 struct usb_serial_port *port);
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
index 1b7519a8c0bf..d2ca919a5b73 100644
--- a/include/linux/usb/tegra_usb_phy.h
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -42,6 +42,7 @@ enum tegra_usb_phy_port_speed {
42enum tegra_usb_phy_mode { 42enum tegra_usb_phy_mode {
43 TEGRA_USB_PHY_MODE_DEVICE, 43 TEGRA_USB_PHY_MODE_DEVICE,
44 TEGRA_USB_PHY_MODE_HOST, 44 TEGRA_USB_PHY_MODE_HOST,
45 TEGRA_USB_PHY_MODE_OTG,
45}; 46};
46 47
47struct tegra_xtal_freq; 48struct tegra_xtal_freq;
@@ -61,14 +62,10 @@ struct tegra_usb_phy {
61 struct device *dev; 62 struct device *dev;
62 bool is_legacy_phy; 63 bool is_legacy_phy;
63 bool is_ulpi_phy; 64 bool is_ulpi_phy;
64 void (*set_pts)(struct usb_phy *x, u8 pts_val); 65 int reset_gpio;
65 void (*set_phcd)(struct usb_phy *x, bool enable);
66}; 66};
67 67
68struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, 68struct usb_phy *tegra_usb_get_phy(struct device_node *dn);
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));
72 69
73void tegra_usb_phy_preresume(struct usb_phy *phy); 70void tegra_usb_phy_preresume(struct usb_phy *phy);
74 71
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h
index f9dec37f617b..6be985b2a434 100644
--- a/include/linux/usb/wusb-wa.h
+++ b/include/linux/usb/wusb-wa.h
@@ -92,11 +92,20 @@ struct usb_rpipe_descriptor {
92 __le16 wRPipeIndex; 92 __le16 wRPipeIndex;
93 __le16 wRequests; 93 __le16 wRequests;
94 __le16 wBlocks; /* rw if 0 */ 94 __le16 wBlocks; /* rw if 0 */
95 __le16 wMaxPacketSize; /* rw? */ 95 __le16 wMaxPacketSize; /* rw */
96 u8 bHSHubAddress; /* reserved: 0 */ 96 union {
97 u8 bHSHubPort; /* ??? FIXME ??? */ 97 u8 dwa_bHSHubAddress; /* rw: DWA. */
98 u8 hwa_bMaxBurst; /* rw: HWA. */
99 };
100 union {
101 u8 dwa_bHSHubPort; /* rw: DWA. */
102 u8 hwa_bDeviceInfoIndex; /* rw: HWA. */
103 };
98 u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */ 104 u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */
99 u8 bDeviceAddress; /* rw: Target device address */ 105 union {
106 u8 dwa_bDeviceAddress; /* rw: DWA Target device address. */
107 u8 hwa_reserved; /* rw: HWA. */
108 };
100 u8 bEndpointAddress; /* rw: Target EP address */ 109 u8 bEndpointAddress; /* rw: Target EP address */
101 u8 bDataSequence; /* ro: Current Data sequence */ 110 u8 bDataSequence; /* ro: Current Data sequence */
102 __le32 dwCurrentWindow; /* ro */ 111 __le32 dwCurrentWindow; /* ro */