usb_phy_set_suspend(dwc->usb2_phy, 0);
usb_phy_set_suspend(dwc->usb3_phy, 0);
ret = phy_power_on(dwc->usb2_generic_phy);
-@@ -870,6 +1006,22 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -873,6 +1009,22 @@ static int dwc3_core_init(struct dwc3 *d
dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
}
return 0;
err4:
-@@ -1073,6 +1225,8 @@ static void dwc3_get_properties(struct d
+@@ -1079,6 +1231,8 @@ static void dwc3_get_properties(struct d
&hird_threshold);
dwc->usb3_lpm_capable = device_property_read_bool(dev,
"snps,usb3_lpm_capable");
dwc->disable_scramble_quirk = device_property_read_bool(dev,
"snps,disable_scramble_quirk");
-@@ -1105,8 +1259,16 @@ static void dwc3_get_properties(struct d
- dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev,
- "snps,dis-tx-ipgap-linecheck-quirk");
+@@ -1113,8 +1267,16 @@ static void dwc3_get_properties(struct d
+ dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev,
+ "snps,parkmode-disable-ss-quirk");
+ dwc->quirk_reverse_in_out = device_property_read_bool(dev,
+ "snps,quirk_reverse_in_out");
device_property_read_u8(dev, "snps,tx_de_emphasis",
&tx_de_emphasis);
device_property_read_string(dev, "snps,hsphy_interface",
-@@ -1117,6 +1279,9 @@ static void dwc3_get_properties(struct d
+@@ -1125,6 +1287,9 @@ static void dwc3_get_properties(struct d
dwc->dis_metastability_quirk = device_property_read_bool(dev,
"snps,dis_metastability_quirk");
dwc->lpm_nyet_threshold = lpm_nyet_threshold;
dwc->tx_de_emphasis = tx_de_emphasis;
-@@ -1367,12 +1532,14 @@ static int dwc3_resume_common(struct dwc
+@@ -1376,12 +1541,14 @@ static int dwc3_resume_common(struct dwc
switch (dwc->dr_mode) {
case USB_DR_MODE_PERIPHERAL:
+#define DWC3_GUCTL_HSTINAUTORETRY BIT(14)
+
/* Global User Control 1 Register */
+ #define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17)
#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28)
- #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24)
-@@ -477,6 +506,14 @@
+@@ -478,6 +507,14 @@
#define DWC3_DEV_IMOD_INTERVAL_SHIFT 0
#define DWC3_DEV_IMOD_INTERVAL_MASK (0xffff << 0)
/* Structures */
struct dwc3_trb;
-@@ -788,6 +825,7 @@ struct dwc3_scratchpad_array {
+@@ -789,6 +826,7 @@ struct dwc3_scratchpad_array {
* @regs: base address for our registers
* @regs_size: address space size
* @fladj: frame length adjustment
* @irq_gadget: peripheral controller's IRQ number
* @nr_scratch: number of scratch buffers
* @u1u2: only used on revisions <1.83a for workaround
-@@ -843,6 +881,7 @@ struct dwc3_scratchpad_array {
+@@ -844,6 +882,7 @@ struct dwc3_scratchpad_array {
* @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround
* @three_stage_setup: set if we perform a three phase setup
* @usb3_lpm_capable: set if hadrware supports Link Power Management
* @disable_scramble_quirk: set if we enable the disable scramble quirk
* @u2exit_lfps_quirk: set if we enable u2exit lfps quirk
* @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
-@@ -922,6 +961,12 @@ struct dwc3 {
+@@ -925,6 +964,12 @@ struct dwc3 {
enum usb_phy_interface hsphy_mode;
u32 fladj;
u32 irq_gadget;
u32 nr_scratch;
u32 u1u2;
-@@ -1006,6 +1051,7 @@ struct dwc3 {
+@@ -1009,6 +1054,7 @@ struct dwc3 {
unsigned setup_packet_pending:1;
unsigned three_stage_setup:1;
unsigned usb3_lpm_capable:1;
unsigned disable_scramble_quirk:1;
unsigned u2exit_lfps_quirk:1;
-@@ -1025,6 +1071,11 @@ struct dwc3 {
+@@ -1029,6 +1075,11 @@ struct dwc3 {
unsigned tx_de_emphasis_quirk:1;
unsigned tx_de_emphasis:2;
reg &= ~DWC3_DCTL_INITU2ENA;
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
-@@ -3220,6 +3220,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3216,6 +3216,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
{
int ret;
int irq;
irq = dwc3_gadget_get_irq(dwc);
if (irq < 0) {
-@@ -3299,6 +3300,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3294,6 +3295,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
xhci->quirks |= XHCI_BROKEN_PORT_PED;
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
-@@ -1976,10 +1976,12 @@ static int finish_td(struct xhci_hcd *xh
+@@ -1978,10 +1978,12 @@ static int finish_td(struct xhci_hcd *xh
union xhci_trb *ep_trb, struct xhci_transfer_event *event,
struct xhci_virt_ep *ep, int *status)
{
u32 trb_comp_code;
int ep_index;
-@@ -2002,14 +2004,30 @@ static int finish_td(struct xhci_hcd *xh
+@@ -2004,14 +2006,30 @@ static int finish_td(struct xhci_hcd *xh
if (trb_comp_code == COMP_STALL_ERROR ||
xhci_requires_manual_halt_cleanup(xhci, ep_ctx,
trb_comp_code)) {
while (ep_ring->dequeue != td->last_trb)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -1607,13 +1607,38 @@ static int xhci_urb_dequeue(struct usb_h
+@@ -1604,13 +1604,38 @@ static int xhci_urb_dequeue(struct usb_h
ret = -ENOMEM;
goto done;
}