blob: 158ab3956cf5e3527cdd51505c1ddc0e8bf55c9e [file] [log] [blame]
vijay kumardd51c592015-01-05 12:46:28 +05301/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
Aparna Mallavarapu9e014372013-10-19 15:04:58 +05302 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of The Linux Foundation nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <err.h>
30#include <assert.h>
31#include <debug.h>
32#include <reg.h>
33#include <platform/timer.h>
34#include <platform/iomap.h>
35#include <mmc.h>
36#include <clock.h>
37#include <platform/clock.h>
Aparna Mallavarapu3f24f3b2014-05-15 11:50:37 +053038#include <blsp_qup.h>
Unnati Gandhibd9dbea2014-07-17 14:30:29 +053039#include <platform.h>
Aparna Mallavarapu9e014372013-10-19 15:04:58 +053040
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -070041#define MAX_LOOPS 500
42
Aparna Mallavarapu9e014372013-10-19 15:04:58 +053043void hsusb_clock_init(void)
44{
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -080045 int ret;
46 struct clk *iclk, *cclk;
Aparna Mallavarapu9e014372013-10-19 15:04:58 +053047
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -080048 ret = clk_get_set_enable("usb_iface_clk", 0, 1);
49 if(ret)
50 {
51 dprintf(CRITICAL, "failed to set usb_iface_clk ret = %d\n", ret);
52 ASSERT(0);
53 }
54
55 ret = clk_get_set_enable("usb_core_clk", 80000000, 1);
56 if(ret)
57 {
58 dprintf(CRITICAL, "failed to set usb_core_clk ret = %d\n", ret);
59 ASSERT(0);
60 }
61
62 mdelay(20);
63
64 iclk = clk_get("usb_iface_clk");
65 cclk = clk_get("usb_core_clk");
66
67 clk_disable(iclk);
68 clk_disable(cclk);
69
70 mdelay(20);
71
72 /* Start the block reset for usb */
73 writel(1, USB_HS_BCR);
74
75 mdelay(20);
76
77 /* Take usb block out of reset */
78 writel(0, USB_HS_BCR);
79
80 mdelay(20);
81
82 ret = clk_enable(iclk);
83
84 if(ret)
85 {
86 dprintf(CRITICAL, "failed to set usb_iface_clk after async ret = %d\n", ret);
87 ASSERT(0);
88 }
89
90 ret = clk_enable(cclk);
91
92 if(ret)
93 {
94 dprintf(CRITICAL, "failed to set usb_iface_clk after async ret = %d\n", ret);
95 ASSERT(0);
96 }
Aparna Mallavarapu9e014372013-10-19 15:04:58 +053097}
98
99void clock_init_mmc(uint32_t interface)
100{
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800101 char clk_name[64];
102 int ret;
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530103
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800104 snprintf(clk_name, sizeof(clk_name), "sdc%u_iface_clk", interface);
105
106 /* enable interface clock */
107 ret = clk_get_set_enable(clk_name, 0, 1);
108 if(ret)
109 {
110 dprintf(CRITICAL, "failed to set sdc1_iface_clk ret = %d\n", ret);
111 ASSERT(0);
112 }
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530113}
114
115/* Configure MMC clock */
116void clock_config_mmc(uint32_t interface, uint32_t freq)
117{
Unnati Gandhibd9dbea2014-07-17 14:30:29 +0530118 int ret = 1;
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800119 char clk_name[64];
120
121 snprintf(clk_name, sizeof(clk_name), "sdc%u_core_clk", interface);
122
123 if(freq == MMC_CLK_400KHZ)
124 {
125 ret = clk_get_set_enable(clk_name, 400000, 1);
126 }
127 else if(freq == MMC_CLK_50MHZ)
128 {
129 ret = clk_get_set_enable(clk_name, 50000000, 1);
130 }
131 else if(freq == MMC_CLK_200MHZ)
132 {
133 ret = clk_get_set_enable(clk_name, 200000000, 1);
134 }
135 else if(freq == MMC_CLK_177MHZ)
136 {
137 ret = clk_get_set_enable(clk_name, 177770000, 1);
138 }
139 else
140 {
141 dprintf(CRITICAL, "sdc frequency (%u) is not supported\n", freq);
142 ASSERT(0);
143 }
144
145 if(ret)
146 {
147 dprintf(CRITICAL, "failed to set %s ret = %d\n", clk_name, ret);
148 ASSERT(0);
149 }
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530150}
151
152/* Configure UART clock based on the UART block id*/
153void clock_config_uart_dm(uint8_t id)
154{
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800155 int ret;
156 char iclk[64];
157 char cclk[64];
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530158
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800159 snprintf(iclk, sizeof(iclk), "uart%u_iface_clk", id);
160 snprintf(cclk, sizeof(cclk), "uart%u_core_clk", id);
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530161
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800162 ret = clk_get_set_enable(iclk, 0, 1);
163 if(ret)
164 {
165 dprintf(CRITICAL, "failed to set %s ret = %d\n", iclk, ret);
166 ASSERT(0);
167 }
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530168
Aparna Mallavarapu70e5df52014-02-27 22:51:29 -0800169 ret = clk_get_set_enable(cclk, 7372800, 1);
170 if(ret)
171 {
172 dprintf(CRITICAL, "failed to set %s ret = %d\n", cclk, ret);
173 ASSERT(0);
174 }
Aparna Mallavarapu9e014372013-10-19 15:04:58 +0530175}
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530176
177/* Control the MDSS GDSC */
178void mdp_gdsc_ctrl(uint8_t enable)
179{
180 uint32_t reg = 0;
181 reg = readl(MDP_GDSCR);
182 if (enable) {
183 if (!(reg & GDSC_POWER_ON_BIT)) {
184 reg &= ~(BIT(0) | GDSC_EN_FEW_WAIT_MASK);
185 reg |= GDSC_EN_FEW_WAIT_256_MASK;
186 writel(reg, MDP_GDSCR);
187 while(!(readl(MDP_GDSCR) & (GDSC_POWER_ON_BIT)));
188 } else {
189 dprintf(SPEW, "MDP GDSC already enabled\n");
190 }
191 } else {
192 reg |= BIT(0);
193 writel(reg, MDP_GDSCR);
194 while(readl(MDP_GDSCR) & (GDSC_POWER_ON_BIT));
195 }
196}
197
198/* Enable all the MDP branch clocks */
199void mdp_clock_enable(void)
200{
201 int ret;
202
203 ret = clk_get_set_enable("mdp_ahb_clk", 0, 1);
204 if(ret)
205 {
206 dprintf(CRITICAL, "failed to set mdp_ahb_clk ret = %d\n", ret);
207 ASSERT(0);
208 }
209
vijay kumardd51c592015-01-05 12:46:28 +0530210 if (platform_is_msm8939() || platform_is_msm8929())
Radhika Ranjan Sonibc86e2c2014-06-11 17:46:56 +0530211 ret = clk_get_set_enable("mdss_mdp_clk_src", 307200000, 1);
212 else
213 /* Set MDP clock to 320MHz */
214 ret = clk_get_set_enable("mdss_mdp_clk_src", 320000000, 1);
215
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530216 if(ret)
217 {
218 dprintf(CRITICAL, "failed to set mdp_clk_src ret = %d\n", ret);
219 ASSERT(0);
220 }
221
222 ret = clk_get_set_enable("mdss_vsync_clk", 0, 1);
223 if(ret)
224 {
225 dprintf(CRITICAL, "failed to set mdss vsync clk ret = %d\n", ret);
226 ASSERT(0);
227 }
228
229 ret = clk_get_set_enable("mdss_mdp_clk", 0, 1);
230 if(ret)
231 {
232 dprintf(CRITICAL, "failed to set mdp_clk ret = %d\n", ret);
233 ASSERT(0);
234 }
235}
236
237/* Disable all the MDP branch clocks */
238void mdp_clock_disable(void)
239{
240 clk_disable(clk_get("mdss_vsync_clk"));
241 clk_disable(clk_get("mdss_mdp_clk"));
242 clk_disable(clk_get("mdss_mdp_clk_src"));
243 clk_disable(clk_get("mdp_ahb_clk"));
244}
245
246/* Disable all the bus clocks needed by MDSS */
247void mdss_bus_clocks_disable(void)
248{
249 /* Disable MDSS AXI clock */
250 clk_disable(clk_get("mdss_axi_clk"));
251}
252
253/* Enable all the bus clocks needed by MDSS */
254void mdss_bus_clocks_enable(void)
255{
256 int ret;
257
258 /* Configure AXI clock */
259 ret = clk_get_set_enable("mdss_axi_clk", 0, 1);
260 if(ret)
261 {
262 dprintf(CRITICAL, "failed to set mdss_axi_clk ret = %d\n", ret);
263 ASSERT(0);
264 }
265}
266
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700267static void rcg_update_config(uint32_t reg)
268{
269 int i;
270
271 for (i = 0; i < MAX_LOOPS; i++) {
272 if (!(readl(reg) & BIT(0)))
273 return;
274 udelay(1);
275 }
276
277 dprintf(CRITICAL, "failed to update rcg config for reg = 0x%x\n", reg);
278 ASSERT(0);
279}
280
281static void branch_clk_halt_check(uint32_t reg)
282{
283 int i;
284
285 for (i = 0; i < MAX_LOOPS; i++) {
286 if (!(readl(reg) & BIT(31)))
287 return;
288 udelay(1);
289 }
290
291 dprintf(CRITICAL, "failed to enable branch for reg = 0x%x\n", reg);
292 ASSERT(0);
293}
294
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530295/* Disable all the branch clocks needed by the DSI controller */
Vineet Bajaje022da62014-07-24 19:13:34 +0530296void gcc_dsi_clocks_disable(uint8_t dual_dsi)
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530297{
298 clk_disable(clk_get("mdss_esc0_clk"));
299 writel(0x0, DSI_PIXEL0_CBCR);
300 writel(0x0, DSI_BYTE0_CBCR);
Vineet Bajaje022da62014-07-24 19:13:34 +0530301 if (dual_dsi) {
302 clk_disable(clk_get("mdss_esc1_clk"));
303 writel(0x0, DSI_PIXEL1_CBCR);
304 writel(0x0, DSI_BYTE1_CBCR);
305 }
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530306}
307
308/* Configure all the branch clocks needed by the DSI controller */
Vineet Bajaje022da62014-07-24 19:13:34 +0530309void gcc_dsi_clocks_enable(uint8_t dual_dsi, uint8_t pclk0_m, uint8_t pclk0_n, uint8_t pclk0_d)
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530310{
311 int ret;
312
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700313 /*
314 * Configure Byte clock -autopll- This will not change becasue
315 * byte clock does not need any divider
316 */
317 /* Set the source for DSI0 byte RCG */
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530318 writel(0x100, DSI_BYTE0_CFG_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700319 /* Set the update RCG bit */
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530320 writel(0x1, DSI_BYTE0_CMD_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700321 rcg_update_config(DSI_BYTE0_CMD_RCGR);
322 /* Enable the branch clock */
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530323 writel(0x1, DSI_BYTE0_CBCR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700324 branch_clk_halt_check(DSI_BYTE0_CBCR);
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530325
326 /* Configure Pixel clock */
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700327 /* Set the source for DSI0 pixel RCG */
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530328 writel(0x100, DSI_PIXEL0_CFG_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700329 /* Set the MND for DSI0 pixel clock */
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530330 writel(pclk0_m, DSI_PIXEL0_M);
331 writel(pclk0_n, DSI_PIXEL0_N);
332 writel(pclk0_d, DSI_PIXEL0_D);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700333 /* Set the update RCG bit */
334 writel(0x1, DSI_PIXEL0_CMD_RCGR);
335 rcg_update_config(DSI_PIXEL0_CMD_RCGR);
336 /* Enable the branch clock */
337 writel(0x1, DSI_PIXEL0_CBCR);
338 branch_clk_halt_check(DSI_PIXEL0_CBCR);
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530339
340 /* Configure ESC clock */
341 ret = clk_get_set_enable("mdss_esc0_clk", 0, 1);
342 if (ret) {
343 dprintf(CRITICAL, "failed to set esc0_clk ret = %d\n", ret);
344 ASSERT(0);
345 }
Vineet Bajaje022da62014-07-24 19:13:34 +0530346
347 if (dual_dsi) {
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700348 /* Set the source for DSI1 byte RCG */
Vineet Bajaje022da62014-07-24 19:13:34 +0530349 writel(0x100, DSI_BYTE1_CFG_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700350 /* Set the update RCG bit */
Vineet Bajaje022da62014-07-24 19:13:34 +0530351 writel(0x1, DSI_BYTE1_CMD_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700352 rcg_update_config(DSI_BYTE1_CMD_RCGR);
353 /* Enable the branch clock */
Vineet Bajaje022da62014-07-24 19:13:34 +0530354 writel(0x1, DSI_BYTE1_CBCR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700355 branch_clk_halt_check(DSI_BYTE1_CBCR);
Vineet Bajaje022da62014-07-24 19:13:34 +0530356
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700357 /* Set the source for DSI1 pixel RCG */
Vineet Bajaje022da62014-07-24 19:13:34 +0530358 writel(0x100, DSI_PIXEL1_CFG_RCGR);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700359 /* Set the MND for DSI1 pixel clock */
Vineet Bajaje022da62014-07-24 19:13:34 +0530360 writel(pclk0_m, DSI_PIXEL1_M);
361 writel(pclk0_n, DSI_PIXEL1_N);
362 writel(pclk0_d, DSI_PIXEL1_D);
Padmanabhan Komanduru36e609f2015-05-04 12:52:26 -0700363 /* Set the update RCG bit */
364 writel(0x1, DSI_PIXEL1_CMD_RCGR);
365 rcg_update_config(DSI_PIXEL1_CMD_RCGR);
366 /* Enable the branch clock */
367 writel(0x1, DSI_PIXEL1_CBCR);
368 branch_clk_halt_check(DSI_PIXEL1_CBCR);
Vineet Bajaje022da62014-07-24 19:13:34 +0530369
370 /* Configure ESC clock */
371 ret = clk_get_set_enable("mdss_esc1_clk", 0, 1);
372 if (ret) {
373 dprintf(CRITICAL, "failed to set esc1_clk ret = %d\n", ret);
374 ASSERT(0);
375 }
376 }
Padmanabhan Komandurudd778b92014-03-21 19:25:17 +0530377}
Aparna Mallavarapu2e899672014-04-22 15:12:05 +0530378
379/* Function to asynchronously reset CE.
380 * Function assumes that all the CE clocks are off.
381 */
382static void ce_async_reset(uint8_t instance)
383{
384 /* Start the block reset for CE */
385 writel(1, GCC_CRYPTO_BCR);
386
387 udelay(2);
388
389 /* Take CE block out of reset */
390 writel(0, GCC_CRYPTO_BCR);
391
392 udelay(2);
393}
394
395void clock_ce_enable(uint8_t instance)
396{
397 int ret;
398 char clk_name[64];
399
400 snprintf(clk_name, sizeof(clk_name), "ce%u_src_clk", instance);
401 ret = clk_get_set_enable(clk_name, 160000000, 1);
402 if(ret)
403 {
404 dprintf(CRITICAL, "failed to set ce%u_src_clk ret = %d\n", instance, ret);
405 ASSERT(0);
406 }
407
408 snprintf(clk_name, sizeof(clk_name), "ce%u_core_clk", instance);
409 ret = clk_get_set_enable(clk_name, 0, 1);
410 if(ret)
411 {
412 dprintf(CRITICAL, "failed to set ce%u_core_clk ret = %d\n", instance, ret);
413 ASSERT(0);
414 }
415
416 snprintf(clk_name, sizeof(clk_name), "ce%u_ahb_clk", instance);
417 ret = clk_get_set_enable(clk_name, 0, 1);
418 if(ret)
419 {
420 dprintf(CRITICAL, "failed to set ce%u_ahb_clk ret = %d\n", instance, ret);
421 ASSERT(0);
422 }
423
424 snprintf(clk_name, sizeof(clk_name), "ce%u_axi_clk", instance);
425 ret = clk_get_set_enable(clk_name, 0, 1);
426 if(ret)
427 {
428 dprintf(CRITICAL, "failed to set ce%u_axi_clk ret = %d\n", instance, ret);
429 ASSERT(0);
430 }
431
432 /* Wait for 48 * #pipes cycles.
433 * This is necessary as immediately after an access control reset (boot up)
434 * or a debug re-enable, the Crypto core sequentially clears its internal
435 * pipe key storage memory. If pipe key initialization writes are attempted
436 * during this time, they may be overwritten by the internal clearing logic.
437 */
438 udelay(1);
439}
440
441void clock_ce_disable(uint8_t instance)
442{
443 struct clk *ahb_clk;
444 struct clk *cclk;
445 struct clk *axi_clk;
446 struct clk *src_clk;
447 char clk_name[64];
448
449 snprintf(clk_name, sizeof(clk_name), "ce%u_src_clk", instance);
450 src_clk = clk_get(clk_name);
451
452 snprintf(clk_name, sizeof(clk_name), "ce%u_ahb_clk", instance);
453 ahb_clk = clk_get(clk_name);
454
455 snprintf(clk_name, sizeof(clk_name), "ce%u_axi_clk", instance);
456 axi_clk = clk_get(clk_name);
457
458 snprintf(clk_name, sizeof(clk_name), "ce%u_core_clk", instance);
459 cclk = clk_get(clk_name);
460
461 clk_disable(ahb_clk);
462 clk_disable(axi_clk);
463 clk_disable(cclk);
464 clk_disable(src_clk);
465
466 /* Some delay for the clocks to stabalize. */
467 udelay(1);
468}
469
470void clock_config_ce(uint8_t instance)
471{
472 /* Need to enable the clock before disabling since the clk_disable()
473 * has a check to default to nop when the clk_enable() is not called
474 * on that particular clock.
475 */
476 clock_ce_enable(instance);
477
478 clock_ce_disable(instance);
479
480 ce_async_reset(instance);
481
482 clock_ce_enable(instance);
483}
Aparna Mallavarapu3f24f3b2014-05-15 11:50:37 +0530484
485void clock_config_blsp_i2c(uint8_t blsp_id, uint8_t qup_id)
486{
487 uint8_t ret = 0;
488 char clk_name[64];
489
490 struct clk *qup_clk;
491
vijay kumar0251c7d2015-04-06 19:16:06 +0530492 if((blsp_id != BLSP_ID_1) || ((qup_id != QUP_ID_1) && (qup_id != QUP_ID_3))) {
Aparna Mallavarapu3f24f3b2014-05-15 11:50:37 +0530493 dprintf(CRITICAL, "Incorrect BLSP-%d or QUP-%d configuration\n", blsp_id, qup_id);
494 ASSERT(0);
495 }
496
vijay kumar0251c7d2015-04-06 19:16:06 +0530497 if (qup_id == QUP_ID_1) {
498 snprintf(clk_name, sizeof(clk_name), "blsp1_qup2_ahb_iface_clk");
499 }
500 else if (qup_id == QUP_ID_3) {
501 snprintf(clk_name, sizeof(clk_name), "blsp1_qup4_ahb_iface_clk");
502 }
Aparna Mallavarapu3f24f3b2014-05-15 11:50:37 +0530503
504 ret = clk_get_set_enable(clk_name, 0 , 1);
505
506 if (ret) {
507 dprintf(CRITICAL, "Failed to enable %s clock\n", clk_name);
508 return;
509 }
510
vijay kumar0251c7d2015-04-06 19:16:06 +0530511 if (qup_id == QUP_ID_1) {
512 snprintf(clk_name, sizeof(clk_name), "gcc_blsp1_qup2_i2c_apps_clk");
513 }
514 else if (qup_id == QUP_ID_3) {
515 snprintf(clk_name, sizeof(clk_name), "gcc_blsp1_qup4_i2c_apps_clk");
516 }
Aparna Mallavarapu3f24f3b2014-05-15 11:50:37 +0530517
518 qup_clk = clk_get(clk_name);
519
520 if (!qup_clk) {
521 dprintf(CRITICAL, "Failed to get %s\n", clk_name);
522 return;
523 }
524
525 ret = clk_enable(qup_clk);
526
527 if (ret) {
528 dprintf(CRITICAL, "Failed to enable %s\n", clk_name);
529 return;
530 }
531}