aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2014-10-28 07:54:24 -0400
committerFelipe Balbi <balbi@ti.com>2014-11-03 11:03:35 -0500
commit8f317b47140ddbce831176db9669d2100030d18a (patch)
tree33df6399cbdea39a09815013a936868d24c9d381 /drivers
parent946bd579a6385508bd93c9d453916c1a06c548ae (diff)
usb: dwc3: initialize platform data at pci glue layer
This patch initializes platform data at pci glue layer, and SoCs x86-based platform vendor is able to define their flags in platform data at bus glue layer. Then do some independent behaviors at dwc3 core level. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index a36cf66302fb..ada975f0b365 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -25,6 +25,8 @@
25#include <linux/usb/otg.h> 25#include <linux/usb/otg.h>
26#include <linux/usb/usb_phy_generic.h> 26#include <linux/usb/usb_phy_generic.h>
27 27
28#include "platform_data.h"
29
28/* FIXME define these in <linux/pci_ids.h> */ 30/* FIXME define these in <linux/pci_ids.h> */
29#define PCI_VENDOR_ID_SYNOPSYS 0x16c3 31#define PCI_VENDOR_ID_SYNOPSYS 0x16c3
30#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd 32#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd
@@ -102,6 +104,9 @@ static int dwc3_pci_probe(struct pci_dev *pci,
102 struct dwc3_pci *glue; 104 struct dwc3_pci *glue;
103 int ret; 105 int ret;
104 struct device *dev = &pci->dev; 106 struct device *dev = &pci->dev;
107 struct dwc3_platform_data dwc3_pdata;
108
109 memset(&dwc3_pdata, 0x00, sizeof(dwc3_pdata));
105 110
106 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); 111 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
107 if (!glue) 112 if (!glue)
@@ -148,6 +153,10 @@ static int dwc3_pci_probe(struct pci_dev *pci,
148 153
149 pci_set_drvdata(pci, glue); 154 pci_set_drvdata(pci, glue);
150 155
156 ret = platform_device_add_data(dwc3, &dwc3_pdata, sizeof(dwc3_pdata));
157 if (ret)
158 goto err3;
159
151 dma_set_coherent_mask(&dwc3->dev, dev->coherent_dma_mask); 160 dma_set_coherent_mask(&dwc3->dev, dev->coherent_dma_mask);
152 161
153 dwc3->dev.dma_mask = dev->dma_mask; 162 dwc3->dev.dma_mask = dev->dma_mask;