}
static void __dwc3_set_mode(struct work_struct *work)
-@@ -766,6 +810,96 @@ static void dwc3_core_setup_global_contr
+@@ -765,6 +809,96 @@ static void dwc3_core_setup_global_contr
static int dwc3_core_get_phy(struct dwc3 *dwc);
static int dwc3_core_ulpi_init(struct dwc3 *dwc);
/**
* dwc3_core_init - Low-level initialization of DWC3 Core
* @dwc: Pointer to our controller context structure
-@@ -828,6 +962,8 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -827,6 +961,8 @@ static int dwc3_core_init(struct dwc3 *d
/* Adjust Frame Length */
dwc3_frame_length_adjustment(dwc);
usb_phy_set_suspend(dwc->usb2_phy, 0);
usb_phy_set_suspend(dwc->usb3_phy, 0);
ret = phy_power_on(dwc->usb2_generic_phy);
-@@ -871,6 +1007,22 @@ static int dwc3_core_init(struct dwc3 *d
+@@ -870,6 +1006,22 @@ static int dwc3_core_init(struct dwc3 *d
dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
}
return 0;
err4:
-@@ -1074,6 +1226,8 @@ static void dwc3_get_properties(struct d
+@@ -1076,6 +1228,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");
-@@ -1106,8 +1260,16 @@ static void dwc3_get_properties(struct d
+@@ -1108,8 +1262,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");
device_property_read_u8(dev, "snps,tx_de_emphasis",
&tx_de_emphasis);
device_property_read_string(dev, "snps,hsphy_interface",
-@@ -1115,6 +1277,9 @@ static void dwc3_get_properties(struct d
- device_property_read_u32(dev, "snps,quirk-frame-length-adjustment",
- &dwc->fladj);
+@@ -1120,6 +1282,9 @@ static void dwc3_get_properties(struct d
+ dwc->dis_metastability_quirk = device_property_read_bool(dev,
+ "snps,dis_metastability_quirk");
+ dwc->host_vbus_glitches = device_property_read_bool(dev,
+ "snps,host-vbus-glitches");
dwc->lpm_nyet_threshold = lpm_nyet_threshold;
dwc->tx_de_emphasis = tx_de_emphasis;
-@@ -1365,12 +1530,14 @@ static int dwc3_resume_common(struct dwc
+@@ -1371,12 +1536,14 @@ static int dwc3_resume_common(struct dwc
switch (dwc->dr_mode) {
case USB_DR_MODE_PERIPHERAL:
* @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
-@@ -869,6 +908,13 @@ struct dwc3_scratchpad_array {
- * 1 - -3.5dB de-emphasis
- * 2 - No de-emphasis
- * 3 - Reserved
-+ * @disable_devinit_u1u2_quirk: disable device-initiated U1/U2 request.
-+ * @quirk_reverse_in_out: prevent tx fifo reverse the data direction
-+ * @quirk_stop_transfer_in_block: prevent block transmission from being
-+ * interrupted
-+ * @quirk_stop_ep_in_u1: replace stop commad with disable slot command
-+ * @host-vbus-glitches: set to avoid vbus glitch during
-+ * xhci reset.
- * @imod_interval: set the interrupt moderation interval in 250ns
- * increments or 0 to disable.
- */
-@@ -921,6 +967,12 @@ struct dwc3 {
+@@ -922,6 +961,12 @@ struct dwc3 {
enum usb_phy_interface hsphy_mode;
u32 fladj;
u32 irq_gadget;
u32 nr_scratch;
u32 u1u2;
-@@ -1005,6 +1057,7 @@ struct dwc3 {
+@@ -1006,6 +1051,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;
-@@ -1024,6 +1077,11 @@ struct dwc3 {
+@@ -1025,6 +1071,11 @@ struct dwc3 {
unsigned tx_de_emphasis_quirk:1;
unsigned tx_de_emphasis:2;
+ unsigned quirk_stop_ep_in_u1:1;
+ unsigned host_vbus_glitches:1;
- u16 imod_interval;
- };
+ unsigned dis_metastability_quirk:1;
+
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -391,7 +391,7 @@ static int dwc3_ep0_handle_u1(struct dwc
reg &= ~DWC3_DCTL_INITU2ENA;
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
-@@ -3210,6 +3210,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3220,6 +3220,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
{
int ret;
int irq;
irq = dwc3_gadget_get_irq(dwc);
if (irq < 0) {
-@@ -3288,6 +3289,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3299,6 +3300,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
/* DR has been stopped in usb_gadget_unregister_driver() */
remove_proc_file();
-@@ -2569,7 +2579,7 @@ static int fsl_udc_remove(struct platfor
- dma_pool_destroy(udc_controller->td_pool);
- free_irq(udc_controller->irq, udc_controller);
- iounmap(dr_regs);
-- if (pdata->operating_mode == FSL_USB2_DR_DEVICE)
-+ if (res && (pdata->operating_mode == FSL_USB2_DR_DEVICE))
- release_mem_region(res->start, resource_size(res));
-
- /* free udc --wait for the release() finished */
--- a/drivers/usb/gadget/udc/fsl_usb2_udc.h
+++ b/drivers/usb/gadget/udc/fsl_usb2_udc.h
@@ -20,6 +20,10 @@
while (ep_ring->dequeue != td->last_trb)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
-@@ -1597,13 +1597,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;
}