aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fsl_devices.h1
-rw-r--r--include/linux/mod_devicetable.h6
-rw-r--r--include/linux/phy/phy-sun4i-usb.h26
-rw-r--r--include/linux/phy/phy.h9
-rw-r--r--include/linux/platform_data/usb-rcar-gen2-phy.h22
-rw-r--r--include/linux/ulpi/driver.h60
-rw-r--r--include/linux/ulpi/interface.h23
-rw-r--r--include/linux/ulpi/regs.h130
-rw-r--r--include/linux/usb/hcd.h2
-rw-r--r--include/linux/usb/msm_hsusb.h22
-rw-r--r--include/linux/usb/msm_hsusb_hw.h9
-rw-r--r--include/linux/usb/net2280.h3
-rw-r--r--include/linux/usb/phy.h8
-rw-r--r--include/linux/usb/renesas_usbhs.h3
-rw-r--r--include/linux/usb/ulpi.h134
-rw-r--r--include/linux/usb/usb338x.h4
16 files changed, 304 insertions, 158 deletions
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index a82296af413f..2a2f56b292c1 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -24,6 +24,7 @@
24#define FSL_USB_VER_1_6 1 24#define FSL_USB_VER_1_6 1
25#define FSL_USB_VER_2_2 2 25#define FSL_USB_VER_2_2 2
26#define FSL_USB_VER_2_4 3 26#define FSL_USB_VER_2_4 3
27#define FSL_USB_VER_2_5 4
27 28
28#include <linux/types.h> 29#include <linux/types.h>
29 30
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 048c270822f9..8183d6640ca7 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -642,4 +642,10 @@ struct mcb_device_id {
642 kernel_ulong_t driver_data; 642 kernel_ulong_t driver_data;
643}; 643};
644 644
645struct ulpi_device_id {
646 __u16 vendor;
647 __u16 product;
648 kernel_ulong_t driver_data;
649};
650
645#endif /* LINUX_MOD_DEVICETABLE_H */ 651#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/phy/phy-sun4i-usb.h b/include/linux/phy/phy-sun4i-usb.h
new file mode 100644
index 000000000000..50aed92ea89c
--- /dev/null
+++ b/include/linux/phy/phy-sun4i-usb.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2015 Hans de Goede <hdegoede@redhat.com>
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 version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef PHY_SUN4I_USB_H_
15#define PHY_SUN4I_USB_H_
16
17#include "phy.h"
18
19/**
20 * sun4i_usb_phy_set_squelch_detect() - Enable/disable squelch detect
21 * @phy: reference to a sun4i usb phy
22 * @enabled: wether to enable or disable squelch detect
23 */
24void sun4i_usb_phy_set_squelch_detect(struct phy *phy, bool enabled);
25
26#endif
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index a0197fa1b116..8cf05e341cff 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -133,6 +133,8 @@ struct phy *devm_phy_get(struct device *dev, const char *string);
133struct phy *devm_phy_optional_get(struct device *dev, const char *string); 133struct phy *devm_phy_optional_get(struct device *dev, const char *string);
134struct phy *devm_of_phy_get(struct device *dev, struct device_node *np, 134struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
135 const char *con_id); 135 const char *con_id);
136struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
137 int index);
136void phy_put(struct phy *phy); 138void phy_put(struct phy *phy);
137void devm_phy_put(struct device *dev, struct phy *phy); 139void devm_phy_put(struct device *dev, struct phy *phy);
138struct phy *of_phy_get(struct device_node *np, const char *con_id); 140struct phy *of_phy_get(struct device_node *np, const char *con_id);
@@ -261,6 +263,13 @@ static inline struct phy *devm_of_phy_get(struct device *dev,
261 return ERR_PTR(-ENOSYS); 263 return ERR_PTR(-ENOSYS);
262} 264}
263 265
266static inline struct phy *devm_of_phy_get_by_index(struct device *dev,
267 struct device_node *np,
268 int index)
269{
270 return ERR_PTR(-ENOSYS);
271}
272
264static inline void phy_put(struct phy *phy) 273static inline void phy_put(struct phy *phy)
265{ 274{
266} 275}
diff --git a/include/linux/platform_data/usb-rcar-gen2-phy.h b/include/linux/platform_data/usb-rcar-gen2-phy.h
deleted file mode 100644
index dd3ba46c0d90..000000000000
--- a/include/linux/platform_data/usb-rcar-gen2-phy.h
+++ /dev/null
@@ -1,22 +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_GEN2_PHY_H
11#define __USB_RCAR_GEN2_PHY_H
12
13#include <linux/types.h>
14
15struct rcar_gen2_phy_platform_data {
16 /* USB channel 0 configuration */
17 bool chan0_pci:1; /* true: PCI USB host 0, false: USBHS */
18 /* USB channel 2 configuration */
19 bool chan2_pci:1; /* true: PCI USB host 2, false: USBSS */
20};
21
22#endif
diff --git a/include/linux/ulpi/driver.h b/include/linux/ulpi/driver.h
new file mode 100644
index 000000000000..388f6e08b9d4
--- /dev/null
+++ b/include/linux/ulpi/driver.h
@@ -0,0 +1,60 @@
1#ifndef __LINUX_ULPI_DRIVER_H
2#define __LINUX_ULPI_DRIVER_H
3
4#include <linux/mod_devicetable.h>
5
6#include <linux/device.h>
7
8struct ulpi_ops;
9
10/**
11 * struct ulpi - describes ULPI PHY device
12 * @id: vendor and product ids for ULPI device
13 * @ops: I/O access
14 * @dev: device interface
15 */
16struct ulpi {
17 struct ulpi_device_id id;
18 struct ulpi_ops *ops;
19 struct device dev;
20};
21
22#define to_ulpi_dev(d) container_of(d, struct ulpi, dev)
23
24static inline void ulpi_set_drvdata(struct ulpi *ulpi, void *data)
25{
26 dev_set_drvdata(&ulpi->dev, data);
27}
28
29static inline void *ulpi_get_drvdata(struct ulpi *ulpi)
30{
31 return dev_get_drvdata(&ulpi->dev);
32}
33
34/**
35 * struct ulpi_driver - describes a ULPI PHY driver
36 * @id_table: array of device identifiers supported by this driver
37 * @probe: binds this driver to ULPI device
38 * @remove: unbinds this driver from ULPI device
39 * @driver: the name and owner members must be initialized by the drivers
40 */
41struct ulpi_driver {
42 const struct ulpi_device_id *id_table;
43 int (*probe)(struct ulpi *ulpi);
44 void (*remove)(struct ulpi *ulpi);
45 struct device_driver driver;
46};
47
48#define to_ulpi_driver(d) container_of(d, struct ulpi_driver, driver)
49
50int ulpi_register_driver(struct ulpi_driver *drv);
51void ulpi_unregister_driver(struct ulpi_driver *drv);
52
53#define module_ulpi_driver(__ulpi_driver) \
54 module_driver(__ulpi_driver, ulpi_register_driver, \
55 ulpi_unregister_driver)
56
57int ulpi_read(struct ulpi *ulpi, u8 addr);
58int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val);
59
60#endif /* __LINUX_ULPI_DRIVER_H */
diff --git a/include/linux/ulpi/interface.h b/include/linux/ulpi/interface.h
new file mode 100644
index 000000000000..4de8ab491038
--- /dev/null
+++ b/include/linux/ulpi/interface.h
@@ -0,0 +1,23 @@
1#ifndef __LINUX_ULPI_INTERFACE_H
2#define __LINUX_ULPI_INTERFACE_H
3
4#include <linux/types.h>
5
6struct ulpi;
7
8/**
9 * struct ulpi_ops - ULPI register access
10 * @dev: the interface provider
11 * @read: read operation for ULPI register access
12 * @write: write operation for ULPI register access
13 */
14struct ulpi_ops {
15 struct device *dev;
16 int (*read)(struct ulpi_ops *ops, u8 addr);
17 int (*write)(struct ulpi_ops *ops, u8 addr, u8 val);
18};
19
20struct ulpi *ulpi_register_interface(struct device *, struct ulpi_ops *);
21void ulpi_unregister_interface(struct ulpi *);
22
23#endif /* __LINUX_ULPI_INTERFACE_H */
diff --git a/include/linux/ulpi/regs.h b/include/linux/ulpi/regs.h
new file mode 100644
index 000000000000..b5b8b8804560
--- /dev/null
+++ b/include/linux/ulpi/regs.h
@@ -0,0 +1,130 @@
1#ifndef __LINUX_ULPI_REGS_H
2#define __LINUX_ULPI_REGS_H
3
4/*
5 * Macros for Set and Clear
6 * See ULPI 1.1 specification to find the registers with Set and Clear offsets
7 */
8#define ULPI_SET(a) (a + 1)
9#define ULPI_CLR(a) (a + 2)
10
11/*
12 * Register Map
13 */
14#define ULPI_VENDOR_ID_LOW 0x00
15#define ULPI_VENDOR_ID_HIGH 0x01
16#define ULPI_PRODUCT_ID_LOW 0x02
17#define ULPI_PRODUCT_ID_HIGH 0x03
18#define ULPI_FUNC_CTRL 0x04
19#define ULPI_IFC_CTRL 0x07
20#define ULPI_OTG_CTRL 0x0a
21#define ULPI_USB_INT_EN_RISE 0x0d
22#define ULPI_USB_INT_EN_FALL 0x10
23#define ULPI_USB_INT_STS 0x13
24#define ULPI_USB_INT_LATCH 0x14
25#define ULPI_DEBUG 0x15
26#define ULPI_SCRATCH 0x16
27/* Optional Carkit Registers */
28#define ULPI_CARKIT_CTRL 0x19
29#define ULPI_CARKIT_INT_DELAY 0x1c
30#define ULPI_CARKIT_INT_EN 0x1d
31#define ULPI_CARKIT_INT_STS 0x20
32#define ULPI_CARKIT_INT_LATCH 0x21
33#define ULPI_CARKIT_PLS_CTRL 0x22
34/* Other Optional Registers */
35#define ULPI_TX_POS_WIDTH 0x25
36#define ULPI_TX_NEG_WIDTH 0x26
37#define ULPI_POLARITY_RECOVERY 0x27
38/* Access Extended Register Set */
39#define ULPI_ACCESS_EXTENDED 0x2f
40/* Vendor Specific */
41#define ULPI_VENDOR_SPECIFIC 0x30
42/* Extended Registers */
43#define ULPI_EXT_VENDOR_SPECIFIC 0x80
44
45/*
46 * Register Bits
47 */
48
49/* Function Control */
50#define ULPI_FUNC_CTRL_XCVRSEL BIT(0)
51#define ULPI_FUNC_CTRL_XCVRSEL_MASK 0x3
52#define ULPI_FUNC_CTRL_HIGH_SPEED 0x0
53#define ULPI_FUNC_CTRL_FULL_SPEED 0x1
54#define ULPI_FUNC_CTRL_LOW_SPEED 0x2
55#define ULPI_FUNC_CTRL_FS4LS 0x3
56#define ULPI_FUNC_CTRL_TERMSELECT BIT(2)
57#define ULPI_FUNC_CTRL_OPMODE BIT(3)
58#define ULPI_FUNC_CTRL_OPMODE_MASK (0x3 << 3)
59#define ULPI_FUNC_CTRL_OPMODE_NORMAL (0x0 << 3)
60#define ULPI_FUNC_CTRL_OPMODE_NONDRIVING (0x1 << 3)
61#define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI (0x2 << 3)
62#define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP (0x3 << 3)
63#define ULPI_FUNC_CTRL_RESET BIT(5)
64#define ULPI_FUNC_CTRL_SUSPENDM BIT(6)
65
66/* Interface Control */
67#define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE BIT(0)
68#define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE BIT(1)
69#define ULPI_IFC_CTRL_CARKITMODE BIT(2)
70#define ULPI_IFC_CTRL_CLOCKSUSPENDM BIT(3)
71#define ULPI_IFC_CTRL_AUTORESUME BIT(4)
72#define ULPI_IFC_CTRL_EXTERNAL_VBUS BIT(5)
73#define ULPI_IFC_CTRL_PASSTHRU BIT(6)
74#define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE BIT(7)
75
76/* OTG Control */
77#define ULPI_OTG_CTRL_ID_PULLUP BIT(0)
78#define ULPI_OTG_CTRL_DP_PULLDOWN BIT(1)
79#define ULPI_OTG_CTRL_DM_PULLDOWN BIT(2)
80#define ULPI_OTG_CTRL_DISCHRGVBUS BIT(3)
81#define ULPI_OTG_CTRL_CHRGVBUS BIT(4)
82#define ULPI_OTG_CTRL_DRVVBUS BIT(5)
83#define ULPI_OTG_CTRL_DRVVBUS_EXT BIT(6)
84#define ULPI_OTG_CTRL_EXTVBUSIND BIT(7)
85
86/* USB Interrupt Enable Rising,
87 * USB Interrupt Enable Falling,
88 * USB Interrupt Status and
89 * USB Interrupt Latch
90 */
91#define ULPI_INT_HOST_DISCONNECT BIT(0)
92#define ULPI_INT_VBUS_VALID BIT(1)
93#define ULPI_INT_SESS_VALID BIT(2)
94#define ULPI_INT_SESS_END BIT(3)
95#define ULPI_INT_IDGRD BIT(4)
96
97/* Debug */
98#define ULPI_DEBUG_LINESTATE0 BIT(0)
99#define ULPI_DEBUG_LINESTATE1 BIT(1)
100
101/* Carkit Control */
102#define ULPI_CARKIT_CTRL_CARKITPWR BIT(0)
103#define ULPI_CARKIT_CTRL_IDGNDDRV BIT(1)
104#define ULPI_CARKIT_CTRL_TXDEN BIT(2)
105#define ULPI_CARKIT_CTRL_RXDEN BIT(3)
106#define ULPI_CARKIT_CTRL_SPKLEFTEN BIT(4)
107#define ULPI_CARKIT_CTRL_SPKRIGHTEN BIT(5)
108#define ULPI_CARKIT_CTRL_MICEN BIT(6)
109
110/* Carkit Interrupt Enable */
111#define ULPI_CARKIT_INT_EN_IDFLOAT_RISE BIT(0)
112#define ULPI_CARKIT_INT_EN_IDFLOAT_FALL BIT(1)
113#define ULPI_CARKIT_INT_EN_CARINTDET BIT(2)
114#define ULPI_CARKIT_INT_EN_DP_RISE BIT(3)
115#define ULPI_CARKIT_INT_EN_DP_FALL BIT(4)
116
117/* Carkit Interrupt Status and
118 * Carkit Interrupt Latch
119 */
120#define ULPI_CARKIT_INT_IDFLOAT BIT(0)
121#define ULPI_CARKIT_INT_CARINTDET BIT(1)
122#define ULPI_CARKIT_INT_DP BIT(2)
123
124/* Carkit Pulse Control*/
125#define ULPI_CARKIT_PLS_CTRL_TXPLSEN BIT(0)
126#define ULPI_CARKIT_PLS_CTRL_RXPLSEN BIT(1)
127#define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN BIT(2)
128#define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN BIT(3)
129
130#endif /* __LINUX_ULPI_REGS_H */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 68b1e836dff1..c9aa7792de10 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -622,8 +622,6 @@ extern struct list_head usb_bus_list;
622extern struct mutex usb_bus_list_lock; 622extern struct mutex usb_bus_list_lock;
623extern wait_queue_head_t usb_kill_urb_queue; 623extern wait_queue_head_t usb_kill_urb_queue;
624 624
625extern int usb_find_interface_driver(struct usb_device *dev,
626 struct usb_interface *interface);
627 625
628#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN)) 626#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
629 627
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 7dbecf9a4656..e55a1504266e 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -18,6 +18,7 @@
18#ifndef __ASM_ARCH_MSM_HSUSB_H 18#ifndef __ASM_ARCH_MSM_HSUSB_H
19#define __ASM_ARCH_MSM_HSUSB_H 19#define __ASM_ARCH_MSM_HSUSB_H
20 20
21#include <linux/extcon.h>
21#include <linux/types.h> 22#include <linux/types.h>
22#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
23#include <linux/clk.h> 24#include <linux/clk.h>
@@ -120,6 +121,17 @@ struct msm_otg_platform_data {
120}; 121};
121 122
122/** 123/**
124 * struct msm_usb_cable - structure for exteternal connector cable
125 * state tracking
126 * @nb: hold event notification callback
127 * @conn: used for notification registration
128 */
129struct msm_usb_cable {
130 struct notifier_block nb;
131 struct extcon_specific_cable_nb conn;
132};
133
134/**
123 * struct msm_otg: OTG driver data. Shared by HCD and DCD. 135 * struct msm_otg: OTG driver data. Shared by HCD and DCD.
124 * @otg: USB OTG Transceiver structure. 136 * @otg: USB OTG Transceiver structure.
125 * @pdata: otg device platform data. 137 * @pdata: otg device platform data.
@@ -138,6 +150,11 @@ struct msm_otg_platform_data {
138 * @chg_type: The type of charger attached. 150 * @chg_type: The type of charger attached.
139 * @dcd_retires: The retry count used to track Data contact 151 * @dcd_retires: The retry count used to track Data contact
140 * detection process. 152 * detection process.
153 * @manual_pullup: true if VBUS is not routed to USB controller/phy
154 * and controller driver therefore enables pull-up explicitly before
155 * starting controller using usbcmd run/stop bit.
156 * @vbus: VBUS signal state trakining, using extcon framework
157 * @id: ID signal state trakining, using extcon framework
141 */ 158 */
142struct msm_otg { 159struct msm_otg {
143 struct usb_phy phy; 160 struct usb_phy phy;
@@ -166,6 +183,11 @@ struct msm_otg {
166 struct reset_control *phy_rst; 183 struct reset_control *phy_rst;
167 struct reset_control *link_rst; 184 struct reset_control *link_rst;
168 int vdd_levels[3]; 185 int vdd_levels[3];
186
187 bool manual_pullup;
188
189 struct msm_usb_cable vbus;
190 struct msm_usb_cable id;
169}; 191};
170 192
171#endif 193#endif
diff --git a/include/linux/usb/msm_hsusb_hw.h b/include/linux/usb/msm_hsusb_hw.h
index a29f6030afb1..e159b39f67a2 100644
--- a/include/linux/usb/msm_hsusb_hw.h
+++ b/include/linux/usb/msm_hsusb_hw.h
@@ -21,6 +21,8 @@
21 21
22#define USB_AHBBURST (MSM_USB_BASE + 0x0090) 22#define USB_AHBBURST (MSM_USB_BASE + 0x0090)
23#define USB_AHBMODE (MSM_USB_BASE + 0x0098) 23#define USB_AHBMODE (MSM_USB_BASE + 0x0098)
24#define USB_GENCONFIG_2 (MSM_USB_BASE + 0x00a0)
25
24#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */ 26#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
25 27
26#define USB_USBCMD (MSM_USB_BASE + 0x0140) 28#define USB_USBCMD (MSM_USB_BASE + 0x0140)
@@ -30,6 +32,9 @@
30#define USB_PHY_CTRL (MSM_USB_BASE + 0x0240) 32#define USB_PHY_CTRL (MSM_USB_BASE + 0x0240)
31#define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278) 33#define USB_PHY_CTRL2 (MSM_USB_BASE + 0x0278)
32 34
35#define GENCONFIG_2_SESS_VLD_CTRL_EN BIT(7)
36#define USBCMD_SESS_VLD_CTRL BIT(25)
37
33#define USBCMD_RESET 2 38#define USBCMD_RESET 2
34#define USB_USBINTR (MSM_USB_BASE + 0x0148) 39#define USB_USBINTR (MSM_USB_BASE + 0x0148)
35 40
@@ -50,6 +55,10 @@
50#define ULPI_PWR_CLK_MNG_REG 0x88 55#define ULPI_PWR_CLK_MNG_REG 0x88
51#define OTG_COMP_DISABLE BIT(0) 56#define OTG_COMP_DISABLE BIT(0)
52 57
58#define ULPI_MISC_A 0x96
59#define ULPI_MISC_A_VBUSVLDEXTSEL BIT(1)
60#define ULPI_MISC_A_VBUSVLDEXT BIT(0)
61
53#define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */ 62#define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
54#define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */ 63#define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
55#define PHY_RETEN (1 << 1) /* PHY retention enable/disable */ 64#define PHY_RETEN (1 << 1) /* PHY retention enable/disable */
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h
index 148b8fa5b1a2..725120224472 100644
--- a/include/linux/usb/net2280.h
+++ b/include/linux/usb/net2280.h
@@ -168,6 +168,9 @@ struct net2280_regs {
168#define ENDPOINT_B_INTERRUPT 2 168#define ENDPOINT_B_INTERRUPT 2
169#define ENDPOINT_A_INTERRUPT 1 169#define ENDPOINT_A_INTERRUPT 1
170#define ENDPOINT_0_INTERRUPT 0 170#define ENDPOINT_0_INTERRUPT 0
171#define USB3380_IRQSTAT0_EP_INTR_MASK_IN (0xF << 17)
172#define USB3380_IRQSTAT0_EP_INTR_MASK_OUT (0xF << 1)
173
171 u32 irqstat1; 174 u32 irqstat1;
172#define POWER_STATE_CHANGE_INTERRUPT 27 175#define POWER_STATE_CHANGE_INTERRUPT 27
173#define PCI_ARBITER_TIMEOUT_INTERRUPT 26 176#define PCI_ARBITER_TIMEOUT_INTERRUPT 26
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index bc91b5d380fd..e39f251cf861 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -205,6 +205,8 @@ extern struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index);
205extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index); 205extern struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index);
206extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, 206extern struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
207 const char *phandle, u8 index); 207 const char *phandle, u8 index);
208extern struct usb_phy *devm_usb_get_phy_by_node(struct device *dev,
209 struct device_node *node, struct notifier_block *nb);
208extern void usb_put_phy(struct usb_phy *); 210extern void usb_put_phy(struct usb_phy *);
209extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x); 211extern void devm_usb_put_phy(struct device *dev, struct usb_phy *x);
210extern int usb_bind_phy(const char *dev_name, u8 index, 212extern int usb_bind_phy(const char *dev_name, u8 index,
@@ -238,6 +240,12 @@ static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev,
238 return ERR_PTR(-ENXIO); 240 return ERR_PTR(-ENXIO);
239} 241}
240 242
243static inline struct usb_phy *devm_usb_get_phy_by_node(struct device *dev,
244 struct device_node *node, struct notifier_block *nb)
245{
246 return ERR_PTR(-ENXIO);
247}
248
241static inline void usb_put_phy(struct usb_phy *x) 249static inline void usb_put_phy(struct usb_phy *x)
242{ 250{
243} 251}
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index f06529c14141..3dd5a781da99 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -169,8 +169,7 @@ struct renesas_usbhs_driver_param {
169#define USBHS_USB_DMAC_XFER_SIZE 32 /* hardcode the xfer size */ 169#define USBHS_USB_DMAC_XFER_SIZE 32 /* hardcode the xfer size */
170}; 170};
171 171
172#define USBHS_TYPE_R8A7790 1 172#define USBHS_TYPE_RCAR_GEN2 1
173#define USBHS_TYPE_R8A7791 2
174 173
175/* 174/*
176 * option: 175 * option:
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
index 5c295c26ad37..5f07407a367a 100644
--- a/include/linux/usb/ulpi.h
+++ b/include/linux/usb/ulpi.h
@@ -12,6 +12,8 @@
12#define __LINUX_USB_ULPI_H 12#define __LINUX_USB_ULPI_H
13 13
14#include <linux/usb/otg.h> 14#include <linux/usb/otg.h>
15#include <linux/ulpi/regs.h>
16
15/*-------------------------------------------------------------------------*/ 17/*-------------------------------------------------------------------------*/
16 18
17/* 19/*
@@ -49,138 +51,6 @@
49 51
50/*-------------------------------------------------------------------------*/ 52/*-------------------------------------------------------------------------*/
51 53
52/*
53 * Macros for Set and Clear
54 * See ULPI 1.1 specification to find the registers with Set and Clear offsets
55 */
56#define ULPI_SET(a) (a + 1)
57#define ULPI_CLR(a) (a + 2)
58
59/*-------------------------------------------------------------------------*/
60
61/*
62 * Register Map
63 */
64#define ULPI_VENDOR_ID_LOW 0x00
65#define ULPI_VENDOR_ID_HIGH 0x01
66#define ULPI_PRODUCT_ID_LOW 0x02
67#define ULPI_PRODUCT_ID_HIGH 0x03
68#define ULPI_FUNC_CTRL 0x04
69#define ULPI_IFC_CTRL 0x07
70#define ULPI_OTG_CTRL 0x0a
71#define ULPI_USB_INT_EN_RISE 0x0d
72#define ULPI_USB_INT_EN_FALL 0x10
73#define ULPI_USB_INT_STS 0x13
74#define ULPI_USB_INT_LATCH 0x14
75#define ULPI_DEBUG 0x15
76#define ULPI_SCRATCH 0x16
77/* Optional Carkit Registers */
78#define ULPI_CARCIT_CTRL 0x19
79#define ULPI_CARCIT_INT_DELAY 0x1c
80#define ULPI_CARCIT_INT_EN 0x1d
81#define ULPI_CARCIT_INT_STS 0x20
82#define ULPI_CARCIT_INT_LATCH 0x21
83#define ULPI_CARCIT_PLS_CTRL 0x22
84/* Other Optional Registers */
85#define ULPI_TX_POS_WIDTH 0x25
86#define ULPI_TX_NEG_WIDTH 0x26
87#define ULPI_POLARITY_RECOVERY 0x27
88/* Access Extended Register Set */
89#define ULPI_ACCESS_EXTENDED 0x2f
90/* Vendor Specific */
91#define ULPI_VENDOR_SPECIFIC 0x30
92/* Extended Registers */
93#define ULPI_EXT_VENDOR_SPECIFIC 0x80
94
95/*-------------------------------------------------------------------------*/
96
97/*
98 * Register Bits
99 */
100
101/* Function Control */
102#define ULPI_FUNC_CTRL_XCVRSEL (1 << 0)
103#define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0)
104#define ULPI_FUNC_CTRL_HIGH_SPEED (0 << 0)
105#define ULPI_FUNC_CTRL_FULL_SPEED (1 << 0)
106#define ULPI_FUNC_CTRL_LOW_SPEED (2 << 0)
107#define ULPI_FUNC_CTRL_FS4LS (3 << 0)
108#define ULPI_FUNC_CTRL_TERMSELECT (1 << 2)
109#define ULPI_FUNC_CTRL_OPMODE (1 << 3)
110#define ULPI_FUNC_CTRL_OPMODE_MASK (3 << 3)
111#define ULPI_FUNC_CTRL_OPMODE_NORMAL (0 << 3)
112#define ULPI_FUNC_CTRL_OPMODE_NONDRIVING (1 << 3)
113#define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI (2 << 3)
114#define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP (3 << 3)
115#define ULPI_FUNC_CTRL_RESET (1 << 5)
116#define ULPI_FUNC_CTRL_SUSPENDM (1 << 6)
117
118/* Interface Control */
119#define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE (1 << 0)
120#define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE (1 << 1)
121#define ULPI_IFC_CTRL_CARKITMODE (1 << 2)
122#define ULPI_IFC_CTRL_CLOCKSUSPENDM (1 << 3)
123#define ULPI_IFC_CTRL_AUTORESUME (1 << 4)
124#define ULPI_IFC_CTRL_EXTERNAL_VBUS (1 << 5)
125#define ULPI_IFC_CTRL_PASSTHRU (1 << 6)
126#define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE (1 << 7)
127
128/* OTG Control */
129#define ULPI_OTG_CTRL_ID_PULLUP (1 << 0)
130#define ULPI_OTG_CTRL_DP_PULLDOWN (1 << 1)
131#define ULPI_OTG_CTRL_DM_PULLDOWN (1 << 2)
132#define ULPI_OTG_CTRL_DISCHRGVBUS (1 << 3)
133#define ULPI_OTG_CTRL_CHRGVBUS (1 << 4)
134#define ULPI_OTG_CTRL_DRVVBUS (1 << 5)
135#define ULPI_OTG_CTRL_DRVVBUS_EXT (1 << 6)
136#define ULPI_OTG_CTRL_EXTVBUSIND (1 << 7)
137
138/* USB Interrupt Enable Rising,
139 * USB Interrupt Enable Falling,
140 * USB Interrupt Status and
141 * USB Interrupt Latch
142 */
143#define ULPI_INT_HOST_DISCONNECT (1 << 0)
144#define ULPI_INT_VBUS_VALID (1 << 1)
145#define ULPI_INT_SESS_VALID (1 << 2)
146#define ULPI_INT_SESS_END (1 << 3)
147#define ULPI_INT_IDGRD (1 << 4)
148
149/* Debug */
150#define ULPI_DEBUG_LINESTATE0 (1 << 0)
151#define ULPI_DEBUG_LINESTATE1 (1 << 1)
152
153/* Carkit Control */
154#define ULPI_CARKIT_CTRL_CARKITPWR (1 << 0)
155#define ULPI_CARKIT_CTRL_IDGNDDRV (1 << 1)
156#define ULPI_CARKIT_CTRL_TXDEN (1 << 2)
157#define ULPI_CARKIT_CTRL_RXDEN (1 << 3)
158#define ULPI_CARKIT_CTRL_SPKLEFTEN (1 << 4)
159#define ULPI_CARKIT_CTRL_SPKRIGHTEN (1 << 5)
160#define ULPI_CARKIT_CTRL_MICEN (1 << 6)
161
162/* Carkit Interrupt Enable */
163#define ULPI_CARKIT_INT_EN_IDFLOAT_RISE (1 << 0)
164#define ULPI_CARKIT_INT_EN_IDFLOAT_FALL (1 << 1)
165#define ULPI_CARKIT_INT_EN_CARINTDET (1 << 2)
166#define ULPI_CARKIT_INT_EN_DP_RISE (1 << 3)
167#define ULPI_CARKIT_INT_EN_DP_FALL (1 << 4)
168
169/* Carkit Interrupt Status and
170 * Carkit Interrupt Latch
171 */
172#define ULPI_CARKIT_INT_IDFLOAT (1 << 0)
173#define ULPI_CARKIT_INT_CARINTDET (1 << 1)
174#define ULPI_CARKIT_INT_DP (1 << 2)
175
176/* Carkit Pulse Control*/
177#define ULPI_CARKIT_PLS_CTRL_TXPLSEN (1 << 0)
178#define ULPI_CARKIT_PLS_CTRL_RXPLSEN (1 << 1)
179#define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN (1 << 2)
180#define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN (1 << 3)
181
182/*-------------------------------------------------------------------------*/
183
184#if IS_ENABLED(CONFIG_USB_ULPI) 54#if IS_ENABLED(CONFIG_USB_ULPI)
185struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, 55struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
186 unsigned int flags); 56 unsigned int flags);
diff --git a/include/linux/usb/usb338x.h b/include/linux/usb/usb338x.h
index f92eb635b9d3..11525d8d89a7 100644
--- a/include/linux/usb/usb338x.h
+++ b/include/linux/usb/usb338x.h
@@ -43,6 +43,10 @@
43#define IN_ENDPOINT_TYPE 12 43#define IN_ENDPOINT_TYPE 12
44#define OUT_ENDPOINT_ENABLE 10 44#define OUT_ENDPOINT_ENABLE 10
45#define OUT_ENDPOINT_TYPE 8 45#define OUT_ENDPOINT_TYPE 8
46#define USB3380_EP_CFG_MASK_IN ((0x3 << IN_ENDPOINT_TYPE) | \
47 BIT(IN_ENDPOINT_ENABLE))
48#define USB3380_EP_CFG_MASK_OUT ((0x3 << OUT_ENDPOINT_TYPE) | \
49 BIT(OUT_ENDPOINT_ENABLE))
46 50
47struct usb338x_usb_ext_regs { 51struct usb338x_usb_ext_regs {
48 u32 usbclass; 52 u32 usbclass;