Re: [PATCH v4 1/1] Bluetooth: mediatek: add gpio pin to reset bt
From: Krzysztof Kozlowski
Date: Mon Jun 23 2025 - 07:56:18 EST
On 23/06/2025 12:23, Zhangchao Zhang wrote:
> Makes the platform Bluetooth to be reset by hardware pin,
> it provides two methods to do it for mediatek controller,
> and it has been tested locally many times and can reset normally.
>
> When an exception occurs, resetting Bluetooth by hardware pin
> is more stable than resetting Bluetooth by software.
> If the corresponding pin is not found in dts,
> bluetooth can also be reset successfully.
>
> Co-developed: Hao Qin <hao.qin@xxxxxxxxxxxx>
> Co-developed: Chris Lu <chris.lu@xxxxxxxxxxxx>
> Co-developed: Jiande Lu <jiande.lu@xxxxxxxxxxxx>
> Signed-off-by: Zhangchao Zhang <ot_zhangchao.zhang@xxxxxxxxxxxx>
> ---
> drivers/bluetooth/btmtk.c | 69 +++++++++++++++++++++++++++++++++++++++
> drivers/bluetooth/btmtk.h | 5 +++
> 2 files changed, 74 insertions(+)
>
> diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> index 4390fd571dbd..3e5f3ca6f0d5 100644
> --- a/drivers/bluetooth/btmtk.c
> +++ b/drivers/bluetooth/btmtk.c
> @@ -6,6 +6,8 @@
> #include <linux/firmware.h>
> #include <linux/usb.h>
> #include <linux/iopoll.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>
> #include <linux/unaligned.h>
>
> #include <net/bluetooth/bluetooth.h>
> @@ -109,6 +111,65 @@ static void btmtk_coredump_notify(struct hci_dev *hdev, int state)
> }
> }
>
> +static void btmtk_reset_by_gpio_work(struct work_struct *work)
> +{
> + struct btmtk_reset_gpio *reset_gpio_data =
> + container_of(work, struct btmtk_reset_gpio, reset_work.work);
> +
> + gpio_direction_output(reset_gpio_data->gpio_number, 1);
> + kfree(reset_gpio_data);
> +}
> +
> +static int btmtk_reset_by_gpio(struct hci_dev *hdev)
> +{
> + struct btmtk_data *data = hci_get_priv(hdev);
> + struct btmtk_reset_gpio *reset_gpio_data;
> + struct device_node *node;
> + int reset_gpio_number;
> +
> + node = of_find_compatible_node(NULL, NULL, "mediatek,usb-bluetooth");
Can you finally respond to the comments you got weeks ago at v1?
NAK and I will keep NAKing your patches because total disregard to
review is not going to make this patch accepted.
Best regards,
Krzysztof