From: Sean Wang Date: Mon, 18 Oct 2021 21:30:17 +0000 (+0800) Subject: Bluetooth: btmtksdio: update register CSDIOCSR operation X-Git-Tag: v5.19~1494^2~428^2~44 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5b23ac1adbc55fc0cda3553a12a6ec4785af748a;p=mirror_ubuntu-kernels.git Bluetooth: btmtksdio: update register CSDIOCSR operation That is a preliminary patch to introduce mt7921s support. Update register CSDIOCSR operation that is suggested from the vendor driver and is compatible to the all devices. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann --- diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index f712b52e5797..3381c8844902 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -520,8 +520,12 @@ static int btmtksdio_open(struct hci_dev *hdev) /* SDIO CMD 5 allows the SDIO device back to idle state an * synchronous interrupt is supported in SDIO 4-bit mode */ - sdio_writel(bdev->func, SDIO_INT_CTL | SDIO_RE_INIT_EN, - MTK_REG_CSDIOCSR, &err); + val = sdio_readl(bdev->func, MTK_REG_CSDIOCSR, &err); + if (err < 0) + goto err_release_irq; + + val |= SDIO_INT_CTL; + sdio_writel(bdev->func, val, MTK_REG_CSDIOCSR, &err); if (err < 0) goto err_release_irq;