diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2009-09-30 14:18:30 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-12-03 13:34:25 -0500 |
commit | 32fd63981ed453bd882f22e3e9b0ccbc11fb47e5 (patch) | |
tree | 2fa97bdd50bf07fedf65ec3170695ce2d8e74716 | |
parent | 2ab25cdd7b54473dd42dcffc9872737de2517466 (diff) |
Bluetooth: Enable auto sleep mode for btmrvl driver
The auto sleep mode for btmrvl driver is not enabled by default.
This patch enables auto sleep mode when card is probed.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | drivers/bluetooth/btmrvl_drv.h | 1 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_main.c | 55 | ||||
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 2 |
3 files changed, 36 insertions, 22 deletions
diff --git a/drivers/bluetooth/btmrvl_drv.h b/drivers/bluetooth/btmrvl_drv.h index 411c7a77082d..523d197b9824 100644 --- a/drivers/bluetooth/btmrvl_drv.h +++ b/drivers/bluetooth/btmrvl_drv.h | |||
@@ -131,6 +131,7 @@ void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb); | |||
131 | int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); | 131 | int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb); |
132 | 132 | ||
133 | int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); | 133 | int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd); |
134 | int btmrvl_enable_ps(struct btmrvl_private *priv); | ||
134 | int btmrvl_prepare_command(struct btmrvl_private *priv); | 135 | int btmrvl_prepare_command(struct btmrvl_private *priv); |
135 | 136 | ||
136 | #ifdef CONFIG_DEBUG_FS | 137 | #ifdef CONFIG_DEBUG_FS |
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index e605563b4eaa..f97771ce432c 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c | |||
@@ -189,6 +189,38 @@ int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd) | |||
189 | } | 189 | } |
190 | EXPORT_SYMBOL_GPL(btmrvl_send_module_cfg_cmd); | 190 | EXPORT_SYMBOL_GPL(btmrvl_send_module_cfg_cmd); |
191 | 191 | ||
192 | int btmrvl_enable_ps(struct btmrvl_private *priv) | ||
193 | { | ||
194 | struct sk_buff *skb; | ||
195 | struct btmrvl_cmd *cmd; | ||
196 | |||
197 | skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC); | ||
198 | if (skb == NULL) { | ||
199 | BT_ERR("No free skb"); | ||
200 | return -ENOMEM; | ||
201 | } | ||
202 | |||
203 | cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd)); | ||
204 | cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, | ||
205 | BT_CMD_AUTO_SLEEP_MODE)); | ||
206 | cmd->length = 1; | ||
207 | |||
208 | if (priv->btmrvl_dev.psmode) | ||
209 | cmd->data[0] = BT_PS_ENABLE; | ||
210 | else | ||
211 | cmd->data[0] = BT_PS_DISABLE; | ||
212 | |||
213 | bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT; | ||
214 | |||
215 | skb->dev = (void *) priv->btmrvl_dev.hcidev; | ||
216 | skb_queue_head(&priv->adapter->tx_queue, skb); | ||
217 | |||
218 | BT_DBG("Queue PSMODE Command:%d", cmd->data[0]); | ||
219 | |||
220 | return 0; | ||
221 | } | ||
222 | EXPORT_SYMBOL_GPL(btmrvl_enable_ps); | ||
223 | |||
192 | static int btmrvl_enable_hs(struct btmrvl_private *priv) | 224 | static int btmrvl_enable_hs(struct btmrvl_private *priv) |
193 | { | 225 | { |
194 | struct sk_buff *skb; | 226 | struct sk_buff *skb; |
@@ -258,28 +290,7 @@ int btmrvl_prepare_command(struct btmrvl_private *priv) | |||
258 | 290 | ||
259 | if (priv->btmrvl_dev.pscmd) { | 291 | if (priv->btmrvl_dev.pscmd) { |
260 | priv->btmrvl_dev.pscmd = 0; | 292 | priv->btmrvl_dev.pscmd = 0; |
261 | 293 | btmrvl_enable_ps(priv); | |
262 | skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC); | ||
263 | if (skb == NULL) { | ||
264 | BT_ERR("No free skb"); | ||
265 | return -ENOMEM; | ||
266 | } | ||
267 | |||
268 | cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd)); | ||
269 | cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, BT_CMD_AUTO_SLEEP_MODE)); | ||
270 | cmd->length = 1; | ||
271 | |||
272 | if (priv->btmrvl_dev.psmode) | ||
273 | cmd->data[0] = BT_PS_ENABLE; | ||
274 | else | ||
275 | cmd->data[0] = BT_PS_DISABLE; | ||
276 | |||
277 | bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT; | ||
278 | |||
279 | skb->dev = (void *) priv->btmrvl_dev.hcidev; | ||
280 | skb_queue_head(&priv->adapter->tx_queue, skb); | ||
281 | |||
282 | BT_DBG("Queue PSMODE Command:%d", cmd->data[0]); | ||
283 | } | 294 | } |
284 | 295 | ||
285 | if (priv->btmrvl_dev.hscmd) { | 296 | if (priv->btmrvl_dev.hscmd) { |
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index 5b33b85790f2..d6aaf511a4f4 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -930,6 +930,8 @@ static int btmrvl_sdio_probe(struct sdio_func *func, | |||
930 | priv->hw_wakeup_firmware = btmrvl_sdio_wakeup_fw; | 930 | priv->hw_wakeup_firmware = btmrvl_sdio_wakeup_fw; |
931 | 931 | ||
932 | btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); | 932 | btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); |
933 | priv->btmrvl_dev.psmode = 1; | ||
934 | btmrvl_enable_ps(priv); | ||
933 | 935 | ||
934 | return 0; | 936 | return 0; |
935 | 937 | ||