diff mbox series

[qca6390-bringup] ath11k: enable internal sleep clock

Message ID 1576812528-24979-1-git-send-email-cjhuang@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series [qca6390-bringup] ath11k: enable internal sleep clock | expand

Commit Message

Carl Huang Dec. 20, 2019, 3:28 a.m. UTC
For QCA6390 on x86 and non-qcom platfrom, host need explicitly tell firmware
to use internal sleep clock. Some QCA6390 modules have OTP burnt with external
sleep clock selected, and these moduesl usually can't  work normally on
these platforms unless firmware selects internal sleep clock.

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Kalle Valo Dec. 20, 2019, 2:18 p.m. UTC | #1
Carl Huang <cjhuang@codeaurora.org> writes:

> For QCA6390 on x86 and non-qcom platfrom, host need explicitly tell firmware
> to use internal sleep clock. Some QCA6390 modules have OTP burnt with external
> sleep clock selected, and these moduesl usually can't  work normally on
> these platforms unless firmware selects internal sleep clock.
>
> Signed-off-by: Carl Huang <cjhuang@codeaurora.org>

I applied the 8 qca6390 patches you submitted to ath11k-qca6390-bringup
branch now.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index d96446c..6612637 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -14,6 +14,8 @@ 
 #define BDF_FILE_NAME_PREFIX		"bdwlan"
 #define MAX_M3_FILE_NAME_LENGTH		13
 #define DEFAULT_M3_FILE_NAME		"m3.bin"
+#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02
+#define HOST_CSTATE_BIT 0x04
 
 static struct qmi_elem_info qmi_wlanfw_host_cap_req_msg_v01_ei[] = {
 	{
@@ -1537,6 +1539,15 @@  static int ath11k_qmi_host_cap_send(struct ath11k_base *ab)
 	req.cal_done_valid = 1;
 	req.cal_done = ab->qmi.cal_done;
 
+	req.nm_modem_valid = 1;
+	/*notify firmware that os is X86*/
+	req.nm_modem |= HOST_CSTATE_BIT;
+	/* notify firmware about the sleep clock selection,
+	 * discussed with firmware, nm_modem_bit[1] used for this purpose
+	 * x86 host driver should select internal sleep clock.
+	 */
+	req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT;
+
 	ret = qmi_txn_init(&ab->qmi.handle, &txn,
 			   qmi_wlanfw_host_cap_resp_msg_v01_ei, &resp);
 	if (ret < 0)