[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69d548d8fa18183069fa27f76e8bb919d881c78d.1634592181.git.objelf@gmail.com>
Date: Tue, 19 Oct 2021 05:30:18 +0800
From: <sean.wang@...iatek.com>
To: <marcel@...tmann.org>, <johan.hedberg@...il.com>
CC: <Mark-YW.Chen@...iatek.com>, <sean.wang@...iatek.com>,
<Soul.Huang@...iatek.com>, <YN.Chen@...iatek.com>,
<Leon.Yen@...iatek.com>, <Eric-SY.Chang@...iatek.com>,
<Deren.Wu@...iatek.com>, <km.lin@...iatek.com>,
<robin.chiu@...iatek.com>, <Eddie.Chen@...iatek.com>,
<ch.yeh@...iatek.com>, <posh.sun@...iatek.com>,
<ted.huang@...iatek.com>, <Eric.Liang@...iatek.com>,
<Stella.Chang@...iatek.com>, <Tom.Chou@...iatek.com>,
<steve.lee@...iatek.com>, <jsiuda@...gle.com>,
<frankgor@...gle.com>, <jemele@...gle.com>,
<abhishekpandit@...gle.com>, <michaelfsun@...gle.com>,
<mcchou@...omium.org>, <shawnku@...gle.com>,
<linux-bluetooth@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
Mark-yw Chen <mark-yw.chen@...iatek.com>
Subject: [PATCH v2 07/10] Bluetooth: btmtksdio: use register CRPLR to read packet length
From: Sean Wang <sean.wang@...iatek.com>
That is a preliminary patch to introduce mt7921s support.
Use the register CRPLR to read packet length to make all the devices
share the common logic.
Co-developed-by: Mark-yw Chen <mark-yw.chen@...iatek.com>
Signed-off-by: Mark-yw Chen <mark-yw.chen@...iatek.com>
Signed-off-by: Sean Wang <sean.wang@...iatek.com>
---
drivers/bluetooth/btmtksdio.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 3381c8844902..f816a7cb0a74 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -83,6 +83,8 @@ MODULE_DEVICE_TABLE(sdio, btmtksdio_table);
#define MTK_REG_CRDR 0x1c
+#define MTK_REG_CRPLR 0x24
+
#define MTK_SDIO_BLOCK_SIZE 256
#define BTMTKSDIO_TX_WAIT_VND_EVT 1
@@ -404,9 +406,8 @@ static void btmtksdio_txrx_work(struct work_struct *work)
struct btmtksdio_dev *bdev = container_of(work, struct btmtksdio_dev,
txrx_work);
unsigned long txrx_timeout;
+ u32 int_status, rx_size;
struct sk_buff *skb;
- u32 int_status;
- u16 rx_size;
int err;
pm_runtime_get_sync(bdev->dev);
@@ -450,11 +451,11 @@ static void btmtksdio_txrx_work(struct work_struct *work)
bt_dev_warn(bdev->hdev, "Tx fifo overflow");
if (int_status & RX_DONE_INT) {
- rx_size = (int_status & RX_PKT_LEN) >> 16;
+ rx_size = sdio_readl(bdev->func, MTK_REG_CRPLR, NULL);
+ rx_size = (rx_size & RX_PKT_LEN) >> 16;
if (btmtksdio_rx_packet(bdev, rx_size) < 0)
bdev->hdev->stat.err_rx++;
}
-
} while (int_status || time_is_before_jiffies(txrx_timeout));
/* Enable interrupt */
--
2.25.1
Powered by blists - more mailing lists