kernel: import series to support Renesas Bluetooth HCI
[openwrt/staging/dangole.git] / target / linux / generic / pending-5.15 / 900-0005-Bluetooth-hci_renesas-Complete-the-setup-regardless-.patch
diff --git a/target/linux/generic/pending-5.15/900-0005-Bluetooth-hci_renesas-Complete-the-setup-regardless-.patch b/target/linux/generic/pending-5.15/900-0005-Bluetooth-hci_renesas-Complete-the-setup-regardless-.patch
new file mode 100644 (file)
index 0000000..45ddd49
--- /dev/null
@@ -0,0 +1,39 @@
+From e04d45f39ed3f1a2aa1ab3605b653ef943902ffe Mon Sep 17 00:00:00 2001
+From: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
+Date: Mon, 15 Aug 2022 15:56:03 +0100
+Subject: [PATCH] Bluetooth: hci_renesas: Complete the setup regardless of
+ firmware load
+
+The firmware loading step doesn't currently work, and the current
+implementation of the driver leaves the serial port with the wrong
+configuration, preventing the system from using the bluetooth device
+further.
+Disregard the outcome of the firmware loading step for now, so that we
+can use the bluetooth device.
+
+Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>
+---
+ drivers/bluetooth/hci_renesas.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/bluetooth/hci_renesas.c
++++ b/drivers/bluetooth/hci_renesas.c
+@@ -332,11 +332,13 @@ static int renesas_setup(struct hci_uart
+       hci_uart_set_flow_control(hu, true);
+       err = renesas_load_firmware(hu->hdev, FIRMWARE_DA14531);
+-      if (err)
+-              return err;
+-
+-      /* wait for HCI application to start */
+-      usleep_range(8000, 10000);
++      if (err) {
++              bt_dev_warn(hu->hdev, "Continuing despite being unable to "
++                          "load the firmware");
++      } else {
++              /* wait for HCI application to start */
++              usleep_range(8000, 10000);
++      }
+       rdata->state = STATE_FW_BOOTED;