aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btmrvl_main.c
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2014-03-28 17:54:39 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-03-28 22:37:06 -0400
commit0d3674084c89130bcaf15b1a69881b31f198ee72 (patch)
treeea7e78cb189e6df4d2ea6279a18a860f3976ae95 /drivers/bluetooth/btmrvl_main.c
parent3d5a76f08bbac55305da87f4c810279189f64297 (diff)
Bluetooth: btmrvl: implement read-to-clear for SD8897 interrupts
For SD8897, CMD52 write_to_clear may have missing interrupts under certain corner case condition. Use CMD53 read-to-clear to fix the problem. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btmrvl_main.c')
-rw-r--r--drivers/bluetooth/btmrvl_main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index 2c4997ce2484..5c0b9444b5e1 100644
--- a/drivers/bluetooth/btmrvl_main.c
+++ b/drivers/bluetooth/btmrvl_main.c
@@ -24,6 +24,7 @@
24#include <net/bluetooth/hci_core.h> 24#include <net/bluetooth/hci_core.h>
25 25
26#include "btmrvl_drv.h" 26#include "btmrvl_drv.h"
27#include "btmrvl_sdio.h"
27 28
28#define VERSION "1.0" 29#define VERSION "1.0"
29 30
@@ -337,10 +338,25 @@ static int btmrvl_tx_pkt(struct btmrvl_private *priv, struct sk_buff *skb)
337 338
338static void btmrvl_init_adapter(struct btmrvl_private *priv) 339static void btmrvl_init_adapter(struct btmrvl_private *priv)
339{ 340{
341 int buf_size;
342
340 skb_queue_head_init(&priv->adapter->tx_queue); 343 skb_queue_head_init(&priv->adapter->tx_queue);
341 344
342 priv->adapter->ps_state = PS_AWAKE; 345 priv->adapter->ps_state = PS_AWAKE;
343 346
347 buf_size = ALIGN_SZ(SDIO_BLOCK_SIZE, BTSDIO_DMA_ALIGN);
348 priv->adapter->hw_regs_buf = kzalloc(buf_size, GFP_KERNEL);
349 if (!priv->adapter->hw_regs_buf) {
350 priv->adapter->hw_regs = NULL;
351 BT_ERR("Unable to allocate buffer for hw_regs.");
352 } else {
353 priv->adapter->hw_regs =
354 (u8 *)ALIGN_ADDR(priv->adapter->hw_regs_buf,
355 BTSDIO_DMA_ALIGN);
356 BT_DBG("hw_regs_buf=%p hw_regs=%p",
357 priv->adapter->hw_regs_buf, priv->adapter->hw_regs);
358 }
359
344 init_waitqueue_head(&priv->adapter->cmd_wait_q); 360 init_waitqueue_head(&priv->adapter->cmd_wait_q);
345} 361}
346 362
@@ -348,6 +364,7 @@ static void btmrvl_free_adapter(struct btmrvl_private *priv)
348{ 364{
349 skb_queue_purge(&priv->adapter->tx_queue); 365 skb_queue_purge(&priv->adapter->tx_queue);
350 366
367 kfree(priv->adapter->hw_regs_buf);
351 kfree(priv->adapter); 368 kfree(priv->adapter);
352 369
353 priv->adapter = NULL; 370 priv->adapter = NULL;