diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2019-04-29 19:21:30 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2019-05-05 13:34:00 -0400 |
commit | 62a91990f4c52f0b56cfae3e4093a27ed61c49db (patch) | |
tree | b29caebb41b73cce339da4ef7929e20e2c406b97 /drivers/bluetooth | |
parent | f80c5dad7b6467b884c445ffea45985793b4b2d0 (diff) |
Bluetooth: hci_qca: Rename STATE_<flags> to QCA_<flags>
Rename STATE_IN_BAND_SLEEP_ENABLED to QCA_IBS_ENABLED. The constant
represents a flag (multiple flags can be set at once), not a unique
state of the controller or driver.
Also make the flag an enum value instead of a pre-processor constant
(more flags will be added to the enum group by another patch).
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/hci_qca.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index c53ee8d8ca15..57322c42bb2d 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c | |||
@@ -54,9 +54,6 @@ | |||
54 | #define HCI_IBS_WAKE_ACK 0xFC | 54 | #define HCI_IBS_WAKE_ACK 0xFC |
55 | #define HCI_MAX_IBS_SIZE 10 | 55 | #define HCI_MAX_IBS_SIZE 10 |
56 | 56 | ||
57 | /* Controller states */ | ||
58 | #define STATE_IN_BAND_SLEEP_ENABLED 1 | ||
59 | |||
60 | #define IBS_WAKE_RETRANS_TIMEOUT_MS 100 | 57 | #define IBS_WAKE_RETRANS_TIMEOUT_MS 100 |
61 | #define IBS_TX_IDLE_TIMEOUT_MS 2000 | 58 | #define IBS_TX_IDLE_TIMEOUT_MS 2000 |
62 | #define CMD_TRANS_TIMEOUT_MS 100 | 59 | #define CMD_TRANS_TIMEOUT_MS 100 |
@@ -67,6 +64,10 @@ | |||
67 | /* Controller debug log header */ | 64 | /* Controller debug log header */ |
68 | #define QCA_DEBUG_HANDLE 0x2EDC | 65 | #define QCA_DEBUG_HANDLE 0x2EDC |
69 | 66 | ||
67 | enum qca_flags { | ||
68 | QCA_IBS_ENABLED, | ||
69 | }; | ||
70 | |||
70 | /* HCI_IBS transmit side sleep protocol states */ | 71 | /* HCI_IBS transmit side sleep protocol states */ |
71 | enum tx_ibs_states { | 72 | enum tx_ibs_states { |
72 | HCI_IBS_TX_ASLEEP, | 73 | HCI_IBS_TX_ASLEEP, |
@@ -792,7 +793,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) | |||
792 | /* Don't go to sleep in middle of patch download or | 793 | /* Don't go to sleep in middle of patch download or |
793 | * Out-Of-Band(GPIOs control) sleep is selected. | 794 | * Out-Of-Band(GPIOs control) sleep is selected. |
794 | */ | 795 | */ |
795 | if (!test_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags)) { | 796 | if (!test_bit(QCA_IBS_ENABLED, &qca->flags)) { |
796 | skb_queue_tail(&qca->txq, skb); | 797 | skb_queue_tail(&qca->txq, skb); |
797 | spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); | 798 | spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); |
798 | return 0; | 799 | return 0; |
@@ -1202,7 +1203,7 @@ static int qca_setup(struct hci_uart *hu) | |||
1202 | return ret; | 1203 | return ret; |
1203 | 1204 | ||
1204 | /* Patch downloading has to be done without IBS mode */ | 1205 | /* Patch downloading has to be done without IBS mode */ |
1205 | clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); | 1206 | clear_bit(QCA_IBS_ENABLED, &qca->flags); |
1206 | 1207 | ||
1207 | if (qca_is_wcn399x(soc_type)) { | 1208 | if (qca_is_wcn399x(soc_type)) { |
1208 | bt_dev_info(hdev, "setting up wcn3990"); | 1209 | bt_dev_info(hdev, "setting up wcn3990"); |
@@ -1246,7 +1247,7 @@ static int qca_setup(struct hci_uart *hu) | |||
1246 | /* Setup patch / NVM configurations */ | 1247 | /* Setup patch / NVM configurations */ |
1247 | ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver); | 1248 | ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver); |
1248 | if (!ret) { | 1249 | if (!ret) { |
1249 | set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); | 1250 | set_bit(QCA_IBS_ENABLED, &qca->flags); |
1250 | qca_debugfs_init(hdev); | 1251 | qca_debugfs_init(hdev); |
1251 | } else if (ret == -ENOENT) { | 1252 | } else if (ret == -ENOENT) { |
1252 | /* No patch/nvm-config found, run with original fw/config */ | 1253 | /* No patch/nvm-config found, run with original fw/config */ |
@@ -1315,7 +1316,7 @@ static void qca_power_shutdown(struct hci_uart *hu) | |||
1315 | * data in skb's. | 1316 | * data in skb's. |
1316 | */ | 1317 | */ |
1317 | spin_lock_irqsave(&qca->hci_ibs_lock, flags); | 1318 | spin_lock_irqsave(&qca->hci_ibs_lock, flags); |
1318 | clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); | 1319 | clear_bit(QCA_IBS_ENABLED, &qca->flags); |
1319 | qca_flush(hu); | 1320 | qca_flush(hu); |
1320 | spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); | 1321 | spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); |
1321 | 1322 | ||