13
13
#include <linux/slab.h>
14
14
#include <linux/platform_device.h>
15
15
#include <linux/clk.h>
16
- #include <linux/usb/otg.h>
17
- #include <linux/usb/usb_phy_generic.h>
18
16
#include <linux/of.h>
19
17
#include <linux/of_platform.h>
20
18
#include <linux/regulator/consumer.h>
21
19
22
20
struct dwc3_exynos {
23
- struct platform_device * usb2_phy ;
24
- struct platform_device * usb3_phy ;
25
21
struct device * dev ;
26
22
27
23
struct clk * clk ;
@@ -32,61 +28,6 @@ struct dwc3_exynos {
32
28
struct regulator * vdd10 ;
33
29
};
34
30
35
- static int dwc3_exynos_register_phys (struct dwc3_exynos * exynos )
36
- {
37
- struct usb_phy_generic_platform_data pdata ;
38
- struct platform_device * pdev ;
39
- int ret ;
40
-
41
- memset (& pdata , 0x00 , sizeof (pdata ));
42
-
43
- pdev = platform_device_alloc ("usb_phy_generic" , PLATFORM_DEVID_AUTO );
44
- if (!pdev )
45
- return - ENOMEM ;
46
-
47
- exynos -> usb2_phy = pdev ;
48
- pdata .type = USB_PHY_TYPE_USB2 ;
49
- pdata .gpio_reset = -1 ;
50
-
51
- ret = platform_device_add_data (exynos -> usb2_phy , & pdata , sizeof (pdata ));
52
- if (ret )
53
- goto err1 ;
54
-
55
- pdev = platform_device_alloc ("usb_phy_generic" , PLATFORM_DEVID_AUTO );
56
- if (!pdev ) {
57
- ret = - ENOMEM ;
58
- goto err1 ;
59
- }
60
-
61
- exynos -> usb3_phy = pdev ;
62
- pdata .type = USB_PHY_TYPE_USB3 ;
63
-
64
- ret = platform_device_add_data (exynos -> usb3_phy , & pdata , sizeof (pdata ));
65
- if (ret )
66
- goto err2 ;
67
-
68
- ret = platform_device_add (exynos -> usb2_phy );
69
- if (ret )
70
- goto err2 ;
71
-
72
- ret = platform_device_add (exynos -> usb3_phy );
73
- if (ret )
74
- goto err3 ;
75
-
76
- return 0 ;
77
-
78
- err3 :
79
- platform_device_del (exynos -> usb2_phy );
80
-
81
- err2 :
82
- platform_device_put (exynos -> usb3_phy );
83
-
84
- err1 :
85
- platform_device_put (exynos -> usb2_phy );
86
-
87
- return ret ;
88
- }
89
-
90
31
static int dwc3_exynos_remove_child (struct device * dev , void * unused )
91
32
{
92
33
struct platform_device * pdev = to_platform_device (dev );
@@ -164,12 +105,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
164
105
goto vdd10_err ;
165
106
}
166
107
167
- ret = dwc3_exynos_register_phys (exynos );
168
- if (ret ) {
169
- dev_err (dev , "couldn't register PHYs\n" );
170
- goto phys_err ;
171
- }
172
-
173
108
if (node ) {
174
109
ret = of_platform_populate (node , NULL , NULL , dev );
175
110
if (ret ) {
@@ -185,9 +120,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
185
120
return 0 ;
186
121
187
122
populate_err :
188
- platform_device_unregister (exynos -> usb2_phy );
189
- platform_device_unregister (exynos -> usb3_phy );
190
- phys_err :
191
123
regulator_disable (exynos -> vdd10 );
192
124
vdd10_err :
193
125
regulator_disable (exynos -> vdd33 );
@@ -205,8 +137,6 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
205
137
struct dwc3_exynos * exynos = platform_get_drvdata (pdev );
206
138
207
139
device_for_each_child (& pdev -> dev , NULL , dwc3_exynos_remove_child );
208
- platform_device_unregister (exynos -> usb2_phy );
209
- platform_device_unregister (exynos -> usb3_phy );
210
140
211
141
clk_disable_unprepare (exynos -> axius_clk );
212
142
clk_disable_unprepare (exynos -> susp_clk );
@@ -258,11 +188,6 @@ static int dwc3_exynos_resume(struct device *dev)
258
188
clk_enable (exynos -> clk );
259
189
clk_enable (exynos -> axius_clk );
260
190
261
- /* runtime set active to reflect active state. */
262
- pm_runtime_disable (dev );
263
- pm_runtime_set_active (dev );
264
- pm_runtime_enable (dev );
265
-
266
191
return 0 ;
267
192
}
268
193
0 commit comments