diff options
Diffstat (limited to 'drivers/usb/dwc3/dwc3-pci.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 7c4faf738747..82a439b075d7 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -22,9 +22,6 @@ | |||
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | 24 | ||
25 | #include <linux/usb/otg.h> | ||
26 | #include <linux/usb/usb_phy_generic.h> | ||
27 | |||
28 | #include "platform_data.h" | 25 | #include "platform_data.h" |
29 | 26 | ||
30 | /* FIXME define these in <linux/pci_ids.h> */ | 27 | /* FIXME define these in <linux/pci_ids.h> */ |
@@ -37,65 +34,8 @@ | |||
37 | struct dwc3_pci { | 34 | struct dwc3_pci { |
38 | struct device *dev; | 35 | struct device *dev; |
39 | struct platform_device *dwc3; | 36 | struct platform_device *dwc3; |
40 | struct platform_device *usb2_phy; | ||
41 | struct platform_device *usb3_phy; | ||
42 | }; | 37 | }; |
43 | 38 | ||
44 | static int dwc3_pci_register_phys(struct dwc3_pci *glue) | ||
45 | { | ||
46 | struct usb_phy_generic_platform_data pdata; | ||
47 | struct platform_device *pdev; | ||
48 | int ret; | ||
49 | |||
50 | memset(&pdata, 0x00, sizeof(pdata)); | ||
51 | |||
52 | pdev = platform_device_alloc("usb_phy_generic", 0); | ||
53 | if (!pdev) | ||
54 | return -ENOMEM; | ||
55 | |||
56 | glue->usb2_phy = pdev; | ||
57 | pdata.type = USB_PHY_TYPE_USB2; | ||
58 | pdata.gpio_reset = -1; | ||
59 | |||
60 | ret = platform_device_add_data(glue->usb2_phy, &pdata, sizeof(pdata)); | ||
61 | if (ret) | ||
62 | goto err1; | ||
63 | |||
64 | pdev = platform_device_alloc("usb_phy_generic", 1); | ||
65 | if (!pdev) { | ||
66 | ret = -ENOMEM; | ||
67 | goto err1; | ||
68 | } | ||
69 | |||
70 | glue->usb3_phy = pdev; | ||
71 | pdata.type = USB_PHY_TYPE_USB3; | ||
72 | |||
73 | ret = platform_device_add_data(glue->usb3_phy, &pdata, sizeof(pdata)); | ||
74 | if (ret) | ||
75 | goto err2; | ||
76 | |||
77 | ret = platform_device_add(glue->usb2_phy); | ||
78 | if (ret) | ||
79 | goto err2; | ||
80 | |||
81 | ret = platform_device_add(glue->usb3_phy); | ||
82 | if (ret) | ||
83 | goto err3; | ||
84 | |||
85 | return 0; | ||
86 | |||
87 | err3: | ||
88 | platform_device_del(glue->usb2_phy); | ||
89 | |||
90 | err2: | ||
91 | platform_device_put(glue->usb3_phy); | ||
92 | |||
93 | err1: | ||
94 | platform_device_put(glue->usb2_phy); | ||
95 | |||
96 | return ret; | ||
97 | } | ||
98 | |||
99 | static int dwc3_pci_probe(struct pci_dev *pci, | 39 | static int dwc3_pci_probe(struct pci_dev *pci, |
100 | const struct pci_device_id *id) | 40 | const struct pci_device_id *id) |
101 | { | 41 | { |
@@ -122,12 +62,6 @@ static int dwc3_pci_probe(struct pci_dev *pci, | |||
122 | 62 | ||
123 | pci_set_master(pci); | 63 | pci_set_master(pci); |
124 | 64 | ||
125 | ret = dwc3_pci_register_phys(glue); | ||
126 | if (ret) { | ||
127 | dev_err(dev, "couldn't register PHYs\n"); | ||
128 | return ret; | ||
129 | } | ||
130 | |||
131 | dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); | 65 | dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); |
132 | if (!dwc3) { | 66 | if (!dwc3) { |
133 | dev_err(dev, "couldn't allocate dwc3 device\n"); | 67 | dev_err(dev, "couldn't allocate dwc3 device\n"); |
@@ -207,8 +141,6 @@ static void dwc3_pci_remove(struct pci_dev *pci) | |||
207 | struct dwc3_pci *glue = pci_get_drvdata(pci); | 141 | struct dwc3_pci *glue = pci_get_drvdata(pci); |
208 | 142 | ||
209 | platform_device_unregister(glue->dwc3); | 143 | platform_device_unregister(glue->dwc3); |
210 | platform_device_unregister(glue->usb2_phy); | ||
211 | platform_device_unregister(glue->usb3_phy); | ||
212 | } | 144 | } |
213 | 145 | ||
214 | static const struct pci_device_id dwc3_pci_id_table[] = { | 146 | static const struct pci_device_id dwc3_pci_id_table[] = { |