@@ -88,6 +88,8 @@ struct qcom_pcie_resources_2_1_0 {
88
88
struct clk * iface_clk ;
89
89
struct clk * core_clk ;
90
90
struct clk * phy_clk ;
91
+ struct clk * aux_clk ;
92
+ struct clk * ref_clk ;
91
93
struct reset_control * pci_reset ;
92
94
struct reset_control * axi_reset ;
93
95
struct reset_control * ahb_reset ;
@@ -246,6 +248,14 @@ static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie)
246
248
if (IS_ERR (res -> phy_clk ))
247
249
return PTR_ERR (res -> phy_clk );
248
250
251
+ res -> aux_clk = devm_clk_get_optional (dev , "aux" );
252
+ if (IS_ERR (res -> aux_clk ))
253
+ return PTR_ERR (res -> aux_clk );
254
+
255
+ res -> ref_clk = devm_clk_get_optional (dev , "ref" );
256
+ if (IS_ERR (res -> ref_clk ))
257
+ return PTR_ERR (res -> ref_clk );
258
+
249
259
res -> pci_reset = devm_reset_control_get_exclusive (dev , "pci" );
250
260
if (IS_ERR (res -> pci_reset ))
251
261
return PTR_ERR (res -> pci_reset );
@@ -278,6 +288,8 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie)
278
288
clk_disable_unprepare (res -> iface_clk );
279
289
clk_disable_unprepare (res -> core_clk );
280
290
clk_disable_unprepare (res -> phy_clk );
291
+ clk_disable_unprepare (res -> aux_clk );
292
+ clk_disable_unprepare (res -> ref_clk );
281
293
regulator_bulk_disable (ARRAY_SIZE (res -> supplies ), res -> supplies );
282
294
}
283
295
@@ -307,16 +319,28 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
307
319
goto err_assert_ahb ;
308
320
}
309
321
322
+ ret = clk_prepare_enable (res -> core_clk );
323
+ if (ret ) {
324
+ dev_err (dev , "cannot prepare/enable core clock\n" );
325
+ goto err_clk_core ;
326
+ }
327
+
310
328
ret = clk_prepare_enable (res -> phy_clk );
311
329
if (ret ) {
312
330
dev_err (dev , "cannot prepare/enable phy clock\n" );
313
331
goto err_clk_phy ;
314
332
}
315
333
316
- ret = clk_prepare_enable (res -> core_clk );
334
+ ret = clk_prepare_enable (res -> aux_clk );
317
335
if (ret ) {
318
- dev_err (dev , "cannot prepare/enable core clock\n" );
319
- goto err_clk_core ;
336
+ dev_err (dev , "cannot prepare/enable aux clock\n" );
337
+ goto err_clk_aux ;
338
+ }
339
+
340
+ ret = clk_prepare_enable (res -> ref_clk );
341
+ if (ret ) {
342
+ dev_err (dev , "cannot prepare/enable ref clock\n" );
343
+ goto err_clk_ref ;
320
344
}
321
345
322
346
ret = reset_control_deassert (res -> ahb_reset );
@@ -372,10 +396,14 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
372
396
return 0 ;
373
397
374
398
err_deassert_ahb :
375
- clk_disable_unprepare (res -> core_clk );
376
- err_clk_core :
399
+ clk_disable_unprepare (res -> ref_clk );
400
+ err_clk_ref :
401
+ clk_disable_unprepare (res -> aux_clk );
402
+ err_clk_aux :
377
403
clk_disable_unprepare (res -> phy_clk );
378
404
err_clk_phy :
405
+ clk_disable_unprepare (res -> core_clk );
406
+ err_clk_core :
379
407
clk_disable_unprepare (res -> iface_clk );
380
408
err_assert_ahb :
381
409
regulator_bulk_disable (ARRAY_SIZE (res -> supplies ), res -> supplies );
0 commit comments