diff options
author | Venkata Lakshmi Narayana Gubba <gubbaven@codeaurora.org> | 2021-05-18 22:04:44 +0530 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-06-26 07:12:30 +0200 |
commit | 99fba8e3f1d1fd60042187a90ba2381efc1833f7 (patch) | |
tree | dec47c50a9b9f02285663068a396687a2e5245f4 /drivers/bluetooth | |
parent | ecf6b2d9566606cd78bdc0af36e5a938624b13d1 (diff) |
Bluetooth: btqca: Moved extracting rom version info to common place
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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/btqca.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 3210283eb08f..be04d74037d2 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 */ |