dwc3-pci.c (ebc01f593b58e1896150fc2e3cbdd0116323c52c) | dwc3-pci.c (8f317b47140ddbce831176db9669d2100030d18a) |
---|---|
1/** 2 * dwc3-pci.c - PCI Specific glue layer 3 * 4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com 5 * 6 * Authors: Felipe Balbi <balbi@ti.com>, 7 * Sebastian Andrzej Siewior <bigeasy@linutronix.de> 8 * --- 11 unchanged lines hidden (view full) --- 20#include <linux/module.h> 21#include <linux/slab.h> 22#include <linux/pci.h> 23#include <linux/platform_device.h> 24 25#include <linux/usb/otg.h> 26#include <linux/usb/usb_phy_generic.h> 27 | 1/** 2 * dwc3-pci.c - PCI Specific glue layer 3 * 4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com 5 * 6 * Authors: Felipe Balbi <balbi@ti.com>, 7 * Sebastian Andrzej Siewior <bigeasy@linutronix.de> 8 * --- 11 unchanged lines hidden (view full) --- 20#include <linux/module.h> 21#include <linux/slab.h> 22#include <linux/pci.h> 23#include <linux/platform_device.h> 24 25#include <linux/usb/otg.h> 26#include <linux/usb/usb_phy_generic.h> 27 |
28#include "platform_data.h" 29 |
|
28/* FIXME define these in <linux/pci_ids.h> */ 29#define PCI_VENDOR_ID_SYNOPSYS 0x16c3 30#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd 31#define PCI_DEVICE_ID_INTEL_BYT 0x0f37 32#define PCI_DEVICE_ID_INTEL_MRFLD 0x119e 33#define PCI_DEVICE_ID_INTEL_BSW 0x22B7 34 35struct dwc3_pci { --- 61 unchanged lines hidden (view full) --- 97static int dwc3_pci_probe(struct pci_dev *pci, 98 const struct pci_device_id *id) 99{ 100 struct resource res[2]; 101 struct platform_device *dwc3; 102 struct dwc3_pci *glue; 103 int ret; 104 struct device *dev = &pci->dev; | 30/* FIXME define these in <linux/pci_ids.h> */ 31#define PCI_VENDOR_ID_SYNOPSYS 0x16c3 32#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd 33#define PCI_DEVICE_ID_INTEL_BYT 0x0f37 34#define PCI_DEVICE_ID_INTEL_MRFLD 0x119e 35#define PCI_DEVICE_ID_INTEL_BSW 0x22B7 36 37struct dwc3_pci { --- 61 unchanged lines hidden (view full) --- 99static int dwc3_pci_probe(struct pci_dev *pci, 100 const struct pci_device_id *id) 101{ 102 struct resource res[2]; 103 struct platform_device *dwc3; 104 struct dwc3_pci *glue; 105 int ret; 106 struct device *dev = &pci->dev; |
107 struct dwc3_platform_data dwc3_pdata; |
|
105 | 108 |
109 memset(&dwc3_pdata, 0x00, sizeof(dwc3_pdata)); 110 |
|
106 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); 107 if (!glue) 108 return -ENOMEM; 109 110 glue->dev = dev; 111 112 ret = pcim_enable_device(pci); 113 if (ret) { --- 29 unchanged lines hidden (view full) --- 143 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); 144 if (ret) { 145 dev_err(dev, "couldn't add resources to dwc3 device\n"); 146 return ret; 147 } 148 149 pci_set_drvdata(pci, glue); 150 | 111 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); 112 if (!glue) 113 return -ENOMEM; 114 115 glue->dev = dev; 116 117 ret = pcim_enable_device(pci); 118 if (ret) { --- 29 unchanged lines hidden (view full) --- 148 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); 149 if (ret) { 150 dev_err(dev, "couldn't add resources to dwc3 device\n"); 151 return ret; 152 } 153 154 pci_set_drvdata(pci, glue); 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); 152 153 dwc3->dev.dma_mask = dev->dma_mask; 154 dwc3->dev.dma_parms = dev->dma_parms; 155 dwc3->dev.parent = dev; 156 glue->dwc3 = dwc3; 157 158 ret = platform_device_add(dwc3); --- 79 unchanged lines hidden --- | 160 dma_set_coherent_mask(&dwc3->dev, dev->coherent_dma_mask); 161 162 dwc3->dev.dma_mask = dev->dma_mask; 163 dwc3->dev.dma_parms = dev->dma_parms; 164 dwc3->dev.parent = dev; 165 glue->dwc3 = dwc3; 166 167 ret = platform_device_add(dwc3); --- 79 unchanged lines hidden --- |