From: Felipe Balbi Date: Mon, 19 Jan 2015 15:57:20 +0000 (-0600) Subject: Merge tag 'v3.19-rc5' into next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d1fc4440d761af47fd0c32661725011bf66ebb51;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge tag 'v3.19-rc5' into next Linux 3.19-rc5 Conflicts: drivers/usb/dwc2/gadget.c drivers/usb/gadget/udc/bdc/bdc_ep.c --- d1fc4440d761af47fd0c32661725011bf66ebb51 diff --cc drivers/usb/dwc3/dwc3-pci.c index 5f5fa98f399d,b642a2f998f9..8d950569d557 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@@ -30,42 -33,69 +30,44 @@@ #define PCI_DEVICE_ID_INTEL_BYT 0x0f37 #define PCI_DEVICE_ID_INTEL_MRFLD 0x119e #define PCI_DEVICE_ID_INTEL_BSW 0x22B7 + #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 + #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 -struct dwc3_pci { - struct device *dev; - struct platform_device *dwc3; - struct platform_device *usb2_phy; - struct platform_device *usb3_phy; -}; - -static int dwc3_pci_register_phys(struct dwc3_pci *glue) +static int dwc3_pci_quirks(struct pci_dev *pdev) { - struct usb_phy_generic_platform_data pdata; - struct platform_device *pdev; - int ret; + if (pdev->vendor == PCI_VENDOR_ID_AMD && + pdev->device == PCI_DEVICE_ID_AMD_NL_USB) { + struct dwc3_platform_data pdata; - memset(&pdata, 0x00, sizeof(pdata)); + memset(&pdata, 0, sizeof(pdata)); - pdev = platform_device_alloc("usb_phy_generic", 0); - if (!pdev) - return -ENOMEM; - - glue->usb2_phy = pdev; - pdata.type = USB_PHY_TYPE_USB2; - pdata.gpio_reset = -1; + pdata.has_lpm_erratum = true; + pdata.lpm_nyet_threshold = 0xf; - ret = platform_device_add_data(glue->usb2_phy, &pdata, sizeof(pdata)); - if (ret) - goto err1; + pdata.u2exit_lfps_quirk = true; + pdata.u2ss_inp3_quirk = true; + pdata.req_p1p2p3_quirk = true; + pdata.del_p1p2p3_quirk = true; + pdata.del_phy_power_chg_quirk = true; + pdata.lfps_filter_quirk = true; + pdata.rx_detect_poll_quirk = true; - pdev = platform_device_alloc("usb_phy_generic", 1); - if (!pdev) { - ret = -ENOMEM; - goto err1; - } + pdata.tx_de_emphasis_quirk = true; + pdata.tx_de_emphasis = 1; - glue->usb3_phy = pdev; - pdata.type = USB_PHY_TYPE_USB3; - - ret = platform_device_add_data(glue->usb3_phy, &pdata, sizeof(pdata)); - if (ret) - goto err2; - - ret = platform_device_add(glue->usb2_phy); - if (ret) - goto err2; + /* + * FIXME these quirks should be removed when AMD NL + * taps out + */ + pdata.disable_scramble_quirk = true; + pdata.dis_u3_susphy_quirk = true; + pdata.dis_u2_susphy_quirk = true; - ret = platform_device_add(glue->usb3_phy); - if (ret) - goto err3; + return platform_device_add_data(pci_get_drvdata(pdev), &pdata, + sizeof(pdata)); + } return 0; - -err3: - platform_device_del(glue->usb2_phy); - -err2: - platform_device_put(glue->usb3_phy); - -err1: - platform_device_put(glue->usb2_phy); - - return ret; } static int dwc3_pci_probe(struct pci_dev *pci, diff --cc drivers/usb/gadget/udc/bdc/bdc_ep.c index fdc0e9fc39d0,d4fe8d769bd6..b04980cf6dc4 --- a/drivers/usb/gadget/udc/bdc/bdc_ep.c +++ b/drivers/usb/gadget/udc/bdc/bdc_ep.c @@@ -718,10 -718,11 +718,11 @@@ static int ep_queue(struct bdc_ep *ep, struct bdc *bdc; int ret = 0; - bdc = ep->bdc; - if (!req || !ep || !ep->usb_ep.desc) + if (!req || !ep->usb_ep.desc) return -EINVAL; + bdc = ep->bdc; + req->usb_req.actual = 0; req->usb_req.status = -EINPROGRESS; req->epnum = ep->ep_num; diff --cc drivers/usb/musb/musb_debugfs.c index bb13e0420140,48131aa8472c..78a283e9ce40 --- a/drivers/usb/musb/musb_debugfs.c +++ b/drivers/usb/musb/musb_debugfs.c @@@ -194,22 -196,22 +196,22 @@@ static ssize_t musb_test_mode_write(str memset(buf, 0x00, sizeof(buf)); - if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) + if (copy_from_user(buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) return -EFAULT; - if (!strncmp(buf, "force host", 9)) + if (strstarts(buf, "force host")) test = MUSB_TEST_FORCE_HOST; - if (!strncmp(buf, "fifo access", 11)) + if (strstarts(buf, "fifo access")) test = MUSB_TEST_FIFO_ACCESS; - if (!strncmp(buf, "force full-speed", 15)) + if (strstarts(buf, "force full-speed")) test = MUSB_TEST_FORCE_FS; - if (!strncmp(buf, "force high-speed", 15)) + if (strstarts(buf, "force high-speed")) test = MUSB_TEST_FORCE_HS; - if (!strncmp(buf, "test packet", 10)) { + if (strstarts(buf, "test packet")) { test = MUSB_TEST_PACKET; musb_load_testpacket(musb); }