]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/bluetooth/btsdio.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
[karo-tx-linux.git] / drivers / bluetooth / btsdio.c
index b61440aaee658210143f435a872ed51e649485e6..7b624423a7e8f790e8448b421d39b1bf91616b23 100644 (file)
@@ -73,6 +73,7 @@ struct btsdio_data {
 #define REG_CL_INTRD 0x13      /* Interrupt Clear */
 #define REG_EN_INTRD 0x14      /* Interrupt Enable */
 #define REG_MD_STAT  0x20      /* Bluetooth Mode Status */
+#define REG_MD_SET   0x20      /* Bluetooth Mode Set */
 
 static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
 {
@@ -193,26 +194,20 @@ static int btsdio_open(struct hci_dev *hdev)
 
        BT_DBG("%s", hdev->name);
 
-       if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
-               return 0;
-
        sdio_claim_host(data->func);
 
        err = sdio_enable_func(data->func);
-       if (err < 0) {
-               clear_bit(HCI_RUNNING, &hdev->flags);
+       if (err < 0)
                goto release;
-       }
 
        err = sdio_claim_irq(data->func, btsdio_interrupt);
        if (err < 0) {
                sdio_disable_func(data->func);
-               clear_bit(HCI_RUNNING, &hdev->flags);
                goto release;
        }
 
        if (data->func->class == SDIO_CLASS_BT_B)
-               sdio_writeb(data->func, 0x00, REG_MD_STAT, NULL);
+               sdio_writeb(data->func, 0x00, REG_MD_SET, NULL);
 
        sdio_writeb(data->func, 0x01, REG_EN_INTRD, NULL);
 
@@ -228,9 +223,6 @@ static int btsdio_close(struct hci_dev *hdev)
 
        BT_DBG("%s", hdev->name);
 
-       if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
-               return 0;
-
        sdio_claim_host(data->func);
 
        sdio_writeb(data->func, 0x00, REG_EN_INTRD, NULL);
@@ -260,9 +252,6 @@ static int btsdio_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
 
        BT_DBG("%s", hdev->name);
 
-       if (!test_bit(HCI_RUNNING, &hdev->flags))
-               return -EBUSY;
-
        switch (bt_cb(skb)->pkt_type) {
        case HCI_COMMAND_PKT:
                hdev->stat.cmd_tx++;
@@ -333,6 +322,9 @@ static int btsdio_probe(struct sdio_func *func,
        hdev->flush    = btsdio_flush;
        hdev->send     = btsdio_send_frame;
 
+       if (func->vendor == 0x0104 && func->device == 0x00c5)
+               set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
+
        err = hci_register_dev(hdev);
        if (err < 0) {
                hci_free_dev(hdev);