Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ced8a03c authored by Vahram Aharonyan's avatar Vahram Aharonyan Committed by Felipe Balbi
Browse files

usb: dwc2: Add PCI properties



Add device parameters handling in dwc2-pci similar what is done in dwc3.

Signed-off-by: default avatarVahram Aharonyan <vahrama@synopsys.com>
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 6b66ce51
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -62,6 +62,21 @@ struct dwc2_pci_glue {
	struct platform_device *phy;
};

static int dwc2_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc2)
{
	if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS &&
	    pdev->device == PCI_PRODUCT_ID_HAPS_HSOTG) {
		struct property_entry properties[] = {
			PROPERTY_ENTRY_BOOL("g-use-dma"),
			{ },
		};

		return platform_device_add_properties(dwc2, properties);
	}

	return 0;
}

static void dwc2_pci_remove(struct pci_dev *pci)
{
	struct dwc2_pci_glue *glue = pci_get_drvdata(pci);
@@ -122,6 +137,10 @@ static int dwc2_pci_probe(struct pci_dev *pci,
		return PTR_ERR(phy);
	}

	ret = dwc2_pci_quirks(pci, dwc2);
	if (ret)
		goto err;

	ret = platform_device_add(dwc2);
	if (ret) {
		dev_err(dev, "failed to register dwc2 device\n");