summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/hci_qca.c
diff options
context:
space:
mode:
authorSai Teja Aluvala <quic_saluvala@quicinc.com>2023-06-14 10:28:15 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-08-11 11:38:40 -0700
commit6ce95a304c816a4cd71329e22e3aaeefe5173fdf (patch)
tree45f190e46c0150ed33a19d48966208262a81f3bb /drivers/bluetooth/hci_qca.c
parent6a42e9bfd17f7135d59701f93942a3392da482f4 (diff)
downloadlwn-6ce95a304c816a4cd71329e22e3aaeefe5173fdf.tar.gz
lwn-6ce95a304c816a4cd71329e22e3aaeefe5173fdf.zip
Bluetooth: hci_qca: Add qcom devcoredump sysfs support
This patch implements the hci_qca driver side .coredump() callback to trigger a devcoredump via sysfs. Signed-off-by: Sai Teja Aluvala <quic_saluvala@quicinc.com> v2 -> V3: -------- Updated commit text v1 -> V2: -------- Updated to work with the updated HCI devcoredump API. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth/hci_qca.c')
-rw-r--r--drivers/bluetooth/hci_qca.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index e30c979535b1..1ee5323ada7d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -2384,6 +2384,18 @@ static const struct acpi_device_id qca_bluetooth_acpi_match[] = {
MODULE_DEVICE_TABLE(acpi, qca_bluetooth_acpi_match);
#endif
+#ifdef CONFIG_DEV_COREDUMP
+static void hciqca_coredump(struct device *dev)
+{
+ struct serdev_device *serdev = to_serdev_device(dev);
+ struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
+ struct hci_uart *hu = &qcadev->serdev_hu;
+ struct hci_dev *hdev = hu->hdev;
+
+ if (hdev->dump.coredump)
+ hdev->dump.coredump(hdev);
+}
+#endif
static struct serdev_device_driver qca_serdev_driver = {
.probe = qca_serdev_probe,
@@ -2394,6 +2406,9 @@ static struct serdev_device_driver qca_serdev_driver = {
.acpi_match_table = ACPI_PTR(qca_bluetooth_acpi_match),
.shutdown = qca_serdev_shutdown,
.pm = &qca_pm_ops,
+#ifdef CONFIG_DEV_COREDUMP
+ .coredump = hciqca_coredump,
+#endif
},
};