Merge 6.3-rc4 into usb-next
We need the USB fixes here, and the USB gadget update for future development patches to be based on. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@ -60,6 +60,11 @@ static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (func->devfn != PCI_DEV_FN_HOST_DEVICE &&
|
||||
func->devfn != PCI_DEV_FN_OTG) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
|
@ -403,20 +403,6 @@ static int cdnsp_ep0_std_request(struct cdnsp_device *pdev,
|
||||
case USB_REQ_SET_ISOCH_DELAY:
|
||||
ret = cdnsp_ep0_set_isoch_delay(pdev, ctrl);
|
||||
break;
|
||||
case USB_REQ_SET_INTERFACE:
|
||||
/*
|
||||
* Add request into pending list to block sending status stage
|
||||
* by libcomposite.
|
||||
*/
|
||||
list_add_tail(&pdev->ep0_preq.list,
|
||||
&pdev->ep0_preq.pep->pending_list);
|
||||
|
||||
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
|
||||
if (ret == -EBUSY)
|
||||
ret = 0;
|
||||
|
||||
list_del(&pdev->ep0_preq.list);
|
||||
break;
|
||||
default:
|
||||
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
|
||||
break;
|
||||
@ -474,9 +460,6 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
|
||||
else
|
||||
ret = cdnsp_ep0_delegate_req(pdev, ctrl);
|
||||
|
||||
if (!len)
|
||||
pdev->ep0_stage = CDNSP_STATUS_STAGE;
|
||||
|
||||
if (ret == USB_GADGET_DELAYED_STATUS) {
|
||||
trace_cdnsp_ep0_status_stage("delayed");
|
||||
return;
|
||||
@ -484,6 +467,6 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
|
||||
out:
|
||||
if (ret < 0)
|
||||
cdnsp_ep0_stall(pdev);
|
||||
else if (pdev->ep0_stage == CDNSP_STATUS_STAGE)
|
||||
else if (!len && pdev->ep0_stage != CDNSP_STATUS_STAGE)
|
||||
cdnsp_status_stage(pdev);
|
||||
}
|
||||
|
@ -29,30 +29,23 @@
|
||||
#define PLAT_DRIVER_NAME "cdns-usbssp"
|
||||
|
||||
#define CDNS_VENDOR_ID 0x17cd
|
||||
#define CDNS_DEVICE_ID 0x0100
|
||||
#define CDNS_DEVICE_ID 0x0200
|
||||
#define CDNS_DRD_ID 0x0100
|
||||
#define CDNS_DRD_IF (PCI_CLASS_SERIAL_USB << 8 | 0x80)
|
||||
|
||||
static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
|
||||
{
|
||||
struct pci_dev *func;
|
||||
|
||||
/*
|
||||
* Gets the second function.
|
||||
* It's little tricky, but this platform has two function.
|
||||
* The fist keeps resources for Host/Device while the second
|
||||
* keeps resources for DRD/OTG.
|
||||
* Platform has two function. The fist keeps resources for
|
||||
* Host/Device while the secon keeps resources for DRD/OTG.
|
||||
*/
|
||||
func = pci_get_device(pdev->vendor, pdev->device, NULL);
|
||||
if (!func)
|
||||
return NULL;
|
||||
if (pdev->device == CDNS_DEVICE_ID)
|
||||
return pci_get_device(pdev->vendor, CDNS_DRD_ID, NULL);
|
||||
else if (pdev->device == CDNS_DRD_ID)
|
||||
return pci_get_device(pdev->vendor, CDNS_DEVICE_ID, NULL);
|
||||
|
||||
if (func->devfn == pdev->devfn) {
|
||||
func = pci_get_device(pdev->vendor, pdev->device, func);
|
||||
if (!func)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return func;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int cdnsp_pci_probe(struct pci_dev *pdev,
|
||||
@ -230,6 +223,8 @@ static const struct pci_device_id cdnsp_pci_ids[] = {
|
||||
PCI_CLASS_SERIAL_USB_DEVICE, PCI_ANY_ID },
|
||||
{ PCI_VENDOR_ID_CDNS, CDNS_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
CDNS_DRD_IF, PCI_ANY_ID },
|
||||
{ PCI_VENDOR_ID_CDNS, CDNS_DRD_ID, PCI_ANY_ID, PCI_ANY_ID,
|
||||
CDNS_DRD_IF, PCI_ANY_ID },
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user