From 6b294fb91ee0514418018c1440f01b8416597b7b Mon Sep 17 00:00:00 2001 From: heitbaum Date: Wed, 19 Jan 2022 09:12:08 +0000 Subject: [PATCH] linux (Allwinner): Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open --- ...ower-reset-via-gpio-in-h5-btrtl-open.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 projects/Allwinner/patches/linux/0059-bluetooth-hci-h5-add-power-reset-via-gpio-in-h5-btrtl-open.patch diff --git a/projects/Allwinner/patches/linux/0059-bluetooth-hci-h5-add-power-reset-via-gpio-in-h5-btrtl-open.patch b/projects/Allwinner/patches/linux/0059-bluetooth-hci-h5-add-power-reset-via-gpio-in-h5-btrtl-open.patch new file mode 100644 index 0000000000..daf6a2caac --- /dev/null +++ b/projects/Allwinner/patches/linux/0059-bluetooth-hci-h5-add-power-reset-via-gpio-in-h5-btrtl-open.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Vyacheslav Bocharov +Subject: [PATCH v3 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open +Date: Wed, 27 Oct 2021 12:14:16 +0300 + +Add power reset via enable-gpios in h5_btrtl_open function. + +Signed-off-by: Vyacheslav Bocharov +--- + drivers/bluetooth/hci_h5.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c +index 34286ffe0568..fdf504b0d265 100644 +--- a/drivers/bluetooth/hci_h5.c ++++ b/drivers/bluetooth/hci_h5.c +@@ -966,6 +966,11 @@ static void h5_btrtl_open(struct h5 *h5) + pm_runtime_enable(&h5->hu->serdev->dev); + } + ++ /* The controller needs reset to startup */ ++ gpiod_set_value_cansleep(h5->enable_gpio, 0); ++ gpiod_set_value_cansleep(h5->device_wake_gpio, 0); ++ msleep(100); ++ + /* The controller needs up to 500ms to wakeup */ + gpiod_set_value_cansleep(h5->enable_gpio, 1); + gpiod_set_value_cansleep(h5->device_wake_gpio, 1);