summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/btmtksdio.c
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2021-10-19 05:30:15 +0800
committerMarcel Holtmann <marcel@holtmann.org>2021-10-25 15:36:23 +0200
commit77b210d1ae7870159f4ec9ab10b0c29d661b7f99 (patch)
tree39b1dcfc9f5dd314e83294f81471b224a24fb656 /drivers/bluetooth/btmtksdio.c
parent877ec9e1d07b631587dbaf205ed929fa08579adf (diff)
Bluetooth: btmtksdio: explicitly set WHISR as write-1-clear
That is a preliminary patch to introduce mt7921s support. Explicitly set WHISR as write-1-clear method to all devices that is the expected behavior the driver rely on. Co-developed-by: Mark-yw Chen <mark-yw.chen@mediatek.com> Signed-off-by: Mark-yw Chen <mark-yw.chen@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btmtksdio.c')
-rw-r--r--drivers/bluetooth/btmtksdio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 77d1c4ac582d..57126a95e292 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -487,8 +487,8 @@ static void btmtksdio_interrupt(struct sdio_func *func)
static int btmtksdio_open(struct hci_dev *hdev)
{
struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+ u32 status, val;
int err;
- u32 status;
sdio_claim_host(bdev->func);
@@ -533,8 +533,13 @@ static int btmtksdio_open(struct hci_dev *hdev)
if (err < 0)
goto err_release_irq;
- /* Setup write-1-clear for CHISR register */
- sdio_writel(bdev->func, C_INT_CLR_CTRL, MTK_REG_CHCR, &err);
+ /* Explitly set write-1-clear method */
+ val = sdio_readl(bdev->func, MTK_REG_CHCR, &err);
+ if (err < 0)
+ goto err_release_irq;
+
+ val |= C_INT_CLR_CTRL;
+ sdio_writel(bdev->func, val, MTK_REG_CHCR, &err);
if (err < 0)
goto err_release_irq;