qualcommax: add ipq60xx support
[openwrt/staging/jow.git] / target / linux / qualcommax / patches-6.1 / 0908-remoteproc-qcom_q6v5_wcss-add-optional-qdss_at-clock.patch
1 From 87dbcc69a7e3fe6ccddf4fe9bdbf51330f5e4a77 Mon Sep 17 00:00:00 2001
2 From: Mantas Pucka <mantas@8devices.com>
3 Date: Tue, 23 Jan 2024 11:04:04 +0200
4 Subject: [PATCH] remoteproc: qcom_q6v5_wcss: add optional qdss_at clock
5
6 IPQ6018 needs QDSS_AT clock enabled when loading wifi. Optionally enable it
7 when provided by DT.
8
9 Signed-off-by: Mantas Pucka <mantas@8devices.com>
10 ---
11 drivers/remoteproc/qcom_q6v5_wcss.c | 24 ++++++++++++++++++++++++
12 1 file changed, 24 insertions(+)
13
14 --- a/drivers/remoteproc/qcom_q6v5_wcss.c
15 +++ b/drivers/remoteproc/qcom_q6v5_wcss.c
16 @@ -120,6 +120,7 @@ struct q6v5_wcss {
17 struct clk *qdsp6ss_core_gfmux;
18 struct clk *lcc_bcr_sleep;
19 struct clk *prng_clk;
20 + struct clk *qdss_clk;
21 struct regulator *cx_supply;
22 struct qcom_sysmon *sysmon;
23
24 @@ -259,6 +260,9 @@ static int q6v5_wcss_start(struct rproc
25 return ret;
26 }
27
28 + if (wcss->qdss_clk)
29 + clk_prepare_enable(wcss->qdss_clk);
30 +
31 qcom_q6v5_prepare(&wcss->q6v5);
32
33 if (wcss->need_mem_protection) {
34 @@ -772,6 +776,8 @@ static int q6v5_wcss_stop(struct rproc *
35 }
36
37 pas_done:
38 + if (wcss->qdss_clk)
39 + clk_disable_unprepare(wcss->qdss_clk);
40 clk_disable_unprepare(wcss->prng_clk);
41 qcom_q6v5_unprepare(&wcss->q6v5);
42
43 @@ -981,6 +987,12 @@ static int ipq_init_clock(struct q6v5_wc
44 dev_err(wcss->dev, "Failed to get prng clock\n");
45 return ret;
46 }
47 +
48 + wcss->qdss_clk = devm_clk_get(wcss->dev, "qdss");
49 + if (IS_ERR(wcss->qdss_clk)) {
50 + wcss->qdss_clk = NULL;
51 + }
52 +
53 return 0;
54 }
55