All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
To: marcel@holtmann.org, johan.hedberg@gmail.com, devicetree@vger.kernel.org
Cc: mka@chromium.org, linux-kernel@vger.kernel.org,
	linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org,
	linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org,
	rjliao@codeaurora.org, hbandi@codeaurora.org,
	abhishekpandit@chromium.org,
	Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
Subject: [PATCH v4 3/5] Bluetooth: btqca: Moved extracting rom version info to common place
Date: Tue, 18 May 2021 22:04:44 +0530	[thread overview]
Message-ID: <1621355686-29550-4-git-send-email-gubbaven@codeaurora.org> (raw)
In-Reply-To: <1621355686-29550-1-git-send-email-gubbaven@codeaurora.org>

Moved extracting rom version info to common place as this code is
common in all if else ladder in qca_uart_setup.

Signed-off-by: Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org>
---
 drivers/bluetooth/btqca.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 3210283..be04d74 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -546,24 +546,20 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 
 	config.user_baud_rate = baudrate;
 
+	/* Firmware files to download are based on ROM version.
+	 * ROM version is derived from last two bytes of soc_ver.
+	 */
+	rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f);
+
 	/* Download rampatch file */
 	config.type = TLV_TYPE_PATCH;
 	if (qca_is_wcn399x(soc_type)) {
-		/* Firmware files to download are based on ROM version.
-		 * ROM version is derived from last two bytes of soc_ver.
-		 */
-		rom_ver = ((soc_ver & 0x00000f00) >> 0x04) |
-			    (soc_ver & 0x0000000f);
 		snprintf(config.fwname, sizeof(config.fwname),
 			 "qca/crbtfw%02x.tlv", rom_ver);
 	} else if (soc_type == QCA_QCA6390) {
-		rom_ver = ((soc_ver & 0x00000f00) >> 0x04) |
-			    (soc_ver & 0x0000000f);
 		snprintf(config.fwname, sizeof(config.fwname),
 			 "qca/htbtfw%02x.tlv", rom_ver);
 	} else if (soc_type == QCA_WCN6750) {
-		rom_ver = ((soc_ver & 0x00000f00) >> 0x04) |
-			    (soc_ver & 0x0000000f);
 		/* Choose mbn file by default.If mbn file is not found
 		 * then choose tlv file
 		 */
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


  parent reply	other threads:[~2021-05-18 16:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 16:34 [PATCH v4 0/5] Enable Bluetooth functionality for WCN6750 Venkata Lakshmi Narayana Gubba
2021-05-18 16:34 ` [PATCH v4 1/5] Bluetooth: hci_qca: Add support for QTI Bluetooth chip wcn6750 Venkata Lakshmi Narayana Gubba
2021-05-18 17:47   ` Enable Bluetooth functionality for WCN6750 bluez.test.bot
2021-05-18 16:34 ` [PATCH v4 2/5] Bluetooth: btqca: Add support for firmware image with mbn type " Venkata Lakshmi Narayana Gubba
2021-05-18 16:34 ` Venkata Lakshmi Narayana Gubba [this message]
2021-05-18 16:34 ` [PATCH v4 4/5] dt-bindings: net: bluetooth: Convert Qualcomm BT binding to DT schema Venkata Lakshmi Narayana Gubba
2021-05-19 18:41   ` Rob Herring
2021-05-18 16:34 ` [PATCH v4 5/5] dt-bindings: net: bluetooth: Add device tree bindings for QTI chip wcn6750 Venkata Lakshmi Narayana Gubba
2021-05-19 18:41   ` Rob Herring
2021-05-20 15:10 ` [PATCH v4 0/5] Enable Bluetooth functionality for WCN6750 Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1621355686-29550-4-git-send-email-gubbaven@codeaurora.org \
    --to=gubbaven@codeaurora.org \
    --cc=abhishekpandit@chromium.org \
    --cc=bgodavar@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hbandi@codeaurora.org \
    --cc=hemantg@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mka@chromium.org \
    --cc=rjliao@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.