Skip to content

Commit

Permalink
Bluetooth: btmtksdio: use register CRPLR to read packet length
Browse files Browse the repository at this point in the history
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@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>
  • Loading branch information
Sean Wang authored and Marcel Holtmann committed Oct 25, 2021
1 parent 5b23ac1 commit 184ea40
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/bluetooth/btmtksdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 184ea40

Please sign in to comment.