diff mbox series

[v3,3/5] Bluetooth: btqca: Moved extracting rom version info to common place

Message ID 1620322392-27148-4-git-send-email-gubbaven@codeaurora.org
State Superseded
Headers show
Series Enable Bluetooth functinality for WCN6750 | expand

Commit Message

Venkata Lakshmi Narayana Gubba May 6, 2021, 5:33 p.m. UTC
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 | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Comments

Venkata Lakshmi Narayana Gubba May 10, 2021, 5:09 p.m. UTC | #1
Hi Marcel,
On 2021-05-07 13:23, Marcel Holtmann wrote:
> Hi Venkata,

> 

>> 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 | 15 ++++++---------

>> 1 file changed, 6 insertions(+), 9 deletions(-)

>> 

>> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c

>> index 320c555..658fd8e4 100644

>> --- a/drivers/bluetooth/btqca.c

>> +++ b/drivers/bluetooth/btqca.c

>> @@ -533,24 +533,21 @@ 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);

>> +

> 

> please try to align this properly.

> 

[Venkata]:
Sure, I will update in next patchset.
> Regards

> 

> Marcel


Regards,
Lakshmi Narayana.
diff mbox series

Patch

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 320c555..658fd8e4 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -533,24 +533,21 @@  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
 		 */