From patchwork Tue Dec 17 16:43:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11298229 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA14A138C for ; Tue, 17 Dec 2019 16:43:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C232C2465E for ; Tue, 17 Dec 2019 16:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727857AbfLQQnl (ORCPT ); Tue, 17 Dec 2019 11:43:41 -0500 Received: from nbd.name ([46.4.11.11]:51148 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbfLQQnl (ORCPT ); Tue, 17 Dec 2019 11:43:41 -0500 Received: from pd95fd66b.dip0.t-ipconnect.de ([217.95.214.107] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1ihFwe-0004wY-Vr; Tue, 17 Dec 2019 17:43:37 +0100 From: John Crispin To: Kalle Valo , Rob Herring Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, devicetree@vger.kernel.org, John Crispin Subject: [PATCH 1/2] dt: bindings: net: ath11k: add qcom,board_id definition Date: Tue, 17 Dec 2019 17:43:28 +0100 Message-Id: <20191217164329.4151-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org We need to be able to define what id the board has allowing us to load the correct definition data. This patch adds the description of the required property. Signed-off-by: John Crispin --- .../devicetree/bindings/net/wireless/qcom,ath11k.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml index a1717db36dba..c68daf6ad424 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml @@ -142,6 +142,11 @@ properties: * reg * reg-names + qcom,board_id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The board id defining what board definition should be loaded + required: - compatible - reg From patchwork Tue Dec 17 16:43:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11298231 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58F61139A for ; Tue, 17 Dec 2019 16:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3644224655 for ; Tue, 17 Dec 2019 16:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbfLQQnl (ORCPT ); Tue, 17 Dec 2019 11:43:41 -0500 Received: from nbd.name ([46.4.11.11]:51144 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbfLQQnl (ORCPT ); Tue, 17 Dec 2019 11:43:41 -0500 Received: from pd95fd66b.dip0.t-ipconnect.de ([217.95.214.107] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1ihFwf-0004wY-J1; Tue, 17 Dec 2019 17:43:37 +0100 From: John Crispin To: Kalle Valo , Rob Herring Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, devicetree@vger.kernel.org, Venkateswara Naralasetty , John Crispin Subject: [PATCH 2/2] ath11k: load appropriate board data based on board id Date: Tue, 17 Dec 2019 17:43:29 +0100 Message-Id: <20191217164329.4151-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191217164329.4151-1-john@phrozen.org> References: <20191217164329.4151-1-john@phrozen.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Venkateswara Naralasetty This patch add support to read board id from dts and load appropriate board data from userland. Signed-off-by: John Crispin Signed-off-by: Venkateswara Naralasetty --- drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index 2377895a58ec..e80290c7c9dd 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -1712,9 +1712,11 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) { + struct device *dev = ab->dev; struct qmi_wlanfw_cap_req_msg_v01 req; struct qmi_wlanfw_cap_resp_msg_v01 resp; struct qmi_txn txn = {}; + unsigned int board_id; int ret = 0; memset(&req, 0, sizeof(req)); @@ -1753,10 +1755,14 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) ab->qmi.target.chip_family = resp.chip_info.chip_family; } - if (resp.board_info_valid) + if (!of_property_read_u32(dev->of_node, "qcom,board_id", &board_id)) { + if (board_id != 0xFF) + ab->qmi.target.board_id = board_id; + } else if (resp.board_info_valid) { ab->qmi.target.board_id = resp.board_info.board_id; - else + } else { ab->qmi.target.board_id = 0xFF; + } if (resp.soc_info_valid) ab->qmi.target.soc_id = resp.soc_info.soc_id;