@@ -58,9 +58,7 @@ static struct i2c_client *isp1301_i2c_client;
58
58
59
59
extern int usb_disabled (void );
60
60
61
- static struct clk * usb_pll_clk ;
62
- static struct clk * usb_dev_clk ;
63
- static struct clk * usb_otg_clk ;
61
+ static struct clk * usb_host_clk ;
64
62
65
63
static void isp1301_configure_lpc32xx (void )
66
64
{
@@ -172,54 +170,20 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
172
170
goto fail_disable ;
173
171
}
174
172
175
- /* Enable USB PLL */
176
- usb_pll_clk = devm_clk_get (& pdev -> dev , "ck_pll5" );
177
- if (IS_ERR (usb_pll_clk )) {
178
- dev_err (& pdev -> dev , "failed to acquire USB PLL \n" );
179
- ret = PTR_ERR (usb_pll_clk );
173
+ /* Enable USB host clock */
174
+ usb_host_clk = devm_clk_get (& pdev -> dev , NULL );
175
+ if (IS_ERR (usb_host_clk )) {
176
+ dev_err (& pdev -> dev , "failed to acquire USB OHCI clock \n" );
177
+ ret = PTR_ERR (usb_host_clk );
180
178
goto fail_disable ;
181
179
}
182
180
183
- ret = clk_prepare_enable (usb_pll_clk );
181
+ ret = clk_prepare_enable (usb_host_clk );
184
182
if (ret < 0 ) {
185
- dev_err (& pdev -> dev , "failed to start USB PLL \n" );
183
+ dev_err (& pdev -> dev , "failed to start USB OHCI clock \n" );
186
184
goto fail_disable ;
187
185
}
188
186
189
- ret = clk_set_rate (usb_pll_clk , 48000 );
190
- if (ret < 0 ) {
191
- dev_err (& pdev -> dev , "failed to set USB clock rate\n" );
192
- goto fail_rate ;
193
- }
194
-
195
- /* Enable USB device clock */
196
- usb_dev_clk = devm_clk_get (& pdev -> dev , "ck_usbd" );
197
- if (IS_ERR (usb_dev_clk )) {
198
- dev_err (& pdev -> dev , "failed to acquire USB DEV Clock\n" );
199
- ret = PTR_ERR (usb_dev_clk );
200
- goto fail_rate ;
201
- }
202
-
203
- ret = clk_prepare_enable (usb_dev_clk );
204
- if (ret < 0 ) {
205
- dev_err (& pdev -> dev , "failed to start USB DEV Clock\n" );
206
- goto fail_rate ;
207
- }
208
-
209
- /* Enable USB otg clocks */
210
- usb_otg_clk = devm_clk_get (& pdev -> dev , "ck_usb_otg" );
211
- if (IS_ERR (usb_otg_clk )) {
212
- dev_err (& pdev -> dev , "failed to acquire USB DEV Clock\n" );
213
- ret = PTR_ERR (usb_otg_clk );
214
- goto fail_otg ;
215
- }
216
-
217
- ret = clk_prepare_enable (usb_otg_clk );
218
- if (ret < 0 ) {
219
- dev_err (& pdev -> dev , "failed to start USB DEV Clock\n" );
220
- goto fail_otg ;
221
- }
222
-
223
187
isp1301_configure ();
224
188
225
189
hcd = usb_create_hcd (driver , & pdev -> dev , dev_name (& pdev -> dev ));
@@ -258,11 +222,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
258
222
fail_resource :
259
223
usb_put_hcd (hcd );
260
224
fail_hcd :
261
- clk_disable_unprepare (usb_otg_clk );
262
- fail_otg :
263
- clk_disable_unprepare (usb_dev_clk );
264
- fail_rate :
265
- clk_disable_unprepare (usb_pll_clk );
225
+ clk_disable_unprepare (usb_host_clk );
266
226
fail_disable :
267
227
isp1301_i2c_client = NULL ;
268
228
return ret ;
@@ -275,9 +235,7 @@ static int ohci_hcd_nxp_remove(struct platform_device *pdev)
275
235
usb_remove_hcd (hcd );
276
236
ohci_nxp_stop_hc ();
277
237
usb_put_hcd (hcd );
278
- clk_disable_unprepare (usb_otg_clk );
279
- clk_disable_unprepare (usb_dev_clk );
280
- clk_disable_unprepare (usb_pll_clk );
238
+ clk_disable_unprepare (usb_host_clk );
281
239
isp1301_i2c_client = NULL ;
282
240
283
241
return 0 ;
0 commit comments