summaryrefslogtreecommitdiffstats
path: root/target/linux/qualcommax/patches-6.1/0908-remoteproc-qcom_q6v5_wcss-add-optional-qdss_at-clock.patch
blob: cfc9adda043019187a1aa9355485b2259758e645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 87dbcc69a7e3fe6ccddf4fe9bdbf51330f5e4a77 Mon Sep 17 00:00:00 2001
From: Mantas Pucka <mantas@8devices.com>
Date: Tue, 23 Jan 2024 11:04:04 +0200
Subject: [PATCH] remoteproc: qcom_q6v5_wcss: add optional qdss_at clock

IPQ6018 needs QDSS_AT clock enabled when loading wifi. Optionally enable it
when provided by DT.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
 drivers/remoteproc/qcom_q6v5_wcss.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -120,6 +120,7 @@ struct q6v5_wcss {
 	struct clk *qdsp6ss_core_gfmux;
 	struct clk *lcc_bcr_sleep;
 	struct clk *prng_clk;
+	struct clk *qdss_clk;
 	struct regulator *cx_supply;
 	struct qcom_sysmon *sysmon;
 
@@ -259,6 +260,9 @@ static int q6v5_wcss_start(struct rproc
 		return ret;
 	}
 
+	if (wcss->qdss_clk)
+		clk_prepare_enable(wcss->qdss_clk);
+
 	qcom_q6v5_prepare(&wcss->q6v5);
 
 	if (wcss->need_mem_protection) {
@@ -772,6 +776,8 @@ static int q6v5_wcss_stop(struct rproc *
 	}
 
 pas_done:
+	if (wcss->qdss_clk)
+		clk_disable_unprepare(wcss->qdss_clk);
 	clk_disable_unprepare(wcss->prng_clk);
 	qcom_q6v5_unprepare(&wcss->q6v5);
 
@@ -981,6 +987,12 @@ static int ipq_init_clock(struct q6v5_wc
 			dev_err(wcss->dev, "Failed to get prng clock\n");
 		return ret;
 	}
+
+	wcss->qdss_clk = devm_clk_get(wcss->dev, "qdss");
+	if (IS_ERR(wcss->qdss_clk)) {
+		wcss->qdss_clk = NULL;
+	}
+
 	return 0;
 }