[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240919074925.22860-3-chris.lu@mediatek.com>
Date: Thu, 19 Sep 2024 15:49:23 +0800
From: Chris Lu <chris.lu@...iatek.com>
To: Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg
<johan.hedberg@...il.com>, Luiz Von Dentz <luiz.dentz@...il.com>
CC: Sean Wang <sean.wang@...iatek.com>, Aaron Hou <aaron.hou@...iatek.com>,
Steve Lee <steve.lee@...iatek.com>, linux-bluetooth
<linux-bluetooth@...r.kernel.org>, linux-kernel
<linux-kernel@...r.kernel.org>, linux-mediatek
<linux-mediatek@...ts.infradead.org>, Chris Lu <chris.lu@...iatek.com>
Subject: [PATCH v2 2/4] Bluetooth: btusb: mediatek: add callback function in btusb_disconnect
Add disconnect callback function in btusb_disconnect which is reserved
for vendor specific usage before deregister hci in btusb_disconnect.
Signed-off-by: Chris Lu <chris.lu@...iatek.com>
---
drivers/bluetooth/btusb.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 6cf1729a8225..dfc42bdc8aaf 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -846,6 +846,7 @@ struct btusb_data {
int (*suspend)(struct hci_dev *hdev);
int (*resume)(struct hci_dev *hdev);
+ int (*disconnect)(struct hci_dev *hdev);
int oob_wake_irq; /* irq for out-of-band wake-on-bt */
unsigned cmd_timeout_cnt;
@@ -4011,6 +4012,9 @@ static void btusb_disconnect(struct usb_interface *intf)
if (data->diag)
usb_set_intfdata(data->diag, NULL);
+ if (data->disconnect)
+ data->disconnect(hdev);
+
hci_unregister_dev(hdev);
if (intf == data->intf) {
--
2.18.0
Powered by blists - more mailing lists