hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/bluetooth/btqcomsmd.c
....@@ -122,6 +122,21 @@
122122 return 0;
123123 }
124124
125
+static int btqcomsmd_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
126
+{
127
+ int ret;
128
+
129
+ ret = qca_set_bdaddr_rome(hdev, bdaddr);
130
+ if (ret)
131
+ return ret;
132
+
133
+ /* The firmware stops responding for a while after setting the bdaddr,
134
+ * causing timeouts for subsequent commands. Sleep a bit to avoid this.
135
+ */
136
+ usleep_range(1000, 10000);
137
+ return 0;
138
+}
139
+
125140 static int btqcomsmd_probe(struct platform_device *pdev)
126141 {
127142 struct btqcomsmd *btq;
....@@ -162,7 +177,7 @@
162177 hdev->close = btqcomsmd_close;
163178 hdev->send = btqcomsmd_send;
164179 hdev->setup = btqcomsmd_setup;
165
- hdev->set_bdaddr = qca_set_bdaddr_rome;
180
+ hdev->set_bdaddr = btqcomsmd_set_bdaddr;
166181
167182 ret = hci_register_dev(hdev);
168183 if (ret < 0)