Skip to content

Commit b638825

Browse files
rjliao-qcaholtmann
authored andcommitted
Bluetooth: btqca: Fix the NVM baudrate tag offcet for wcn3991
The baudrate set byte of wcn3991 in the NVM tag is byte 1, not byte 2. This patch will set correct byte for wcn3991. Signed-off-by: Rocky Liao <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 4f9ed5b commit b638825

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/bluetooth/btqca.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int qca_send_pre_shutdown_cmd(struct hci_dev *hdev)
139139
EXPORT_SYMBOL_GPL(qca_send_pre_shutdown_cmd);
140140

141141
static void qca_tlv_check_data(struct qca_fw_config *config,
142-
const struct firmware *fw)
142+
const struct firmware *fw, enum qca_btsoc_type soc_type)
143143
{
144144
const u8 *data;
145145
u32 type_len;
@@ -148,6 +148,7 @@ static void qca_tlv_check_data(struct qca_fw_config *config,
148148
struct tlv_type_hdr *tlv;
149149
struct tlv_type_patch *tlv_patch;
150150
struct tlv_type_nvm *tlv_nvm;
151+
uint8_t nvm_baud_rate = config->user_baud_rate;
151152

152153
tlv = (struct tlv_type_hdr *)fw->data;
153154

@@ -216,7 +217,10 @@ static void qca_tlv_check_data(struct qca_fw_config *config,
216217
tlv_nvm->data[0] |= 0x80;
217218

218219
/* UART Baud Rate */
219-
tlv_nvm->data[2] = config->user_baud_rate;
220+
if (soc_type == QCA_WCN3991)
221+
tlv_nvm->data[1] = nvm_baud_rate;
222+
else
223+
tlv_nvm->data[2] = nvm_baud_rate;
220224

221225
break;
222226

@@ -354,7 +358,7 @@ static int qca_download_firmware(struct hci_dev *hdev,
354358
return ret;
355359
}
356360

357-
qca_tlv_check_data(config, fw);
361+
qca_tlv_check_data(config, fw, soc_type);
358362

359363
segment = fw->data;
360364
remain = fw->size;

0 commit comments

Comments
 (0)