diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2013-10-01 21:19:14 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-02 09:36:16 +0200 |
commit | 4b245722cabc6ee6d56924f10944b14a725ffd61 (patch) | |
tree | 641320870df1f44d4098a6ebc290cb9e19b2aeee /drivers/bluetooth/btmrvl_main.c | |
parent | Bluetooth: btmrvl: get rid of struct btmrvl_cmd (diff) | |
download | linux-4b245722cabc6ee6d56924f10944b14a725ffd61.tar.xz linux-4b245722cabc6ee6d56924f10944b14a725ffd61.zip |
Bluetooth: btmrvl: add setup handler
Move initialization code to hdev's setup handler.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
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.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c index a4da7c830b12..e0ae1f4ea406 100644 --- a/drivers/bluetooth/btmrvl_main.c +++ b/drivers/bluetooth/btmrvl_main.c @@ -432,6 +432,21 @@ static int btmrvl_open(struct hci_dev *hdev) return 0; } +static int btmrvl_setup(struct hci_dev *hdev) +{ + struct btmrvl_private *priv = hci_get_drvdata(hdev); + + btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); + + priv->btmrvl_dev.psmode = 1; + btmrvl_enable_ps(priv); + + priv->btmrvl_dev.gpio_gap = 0xffff; + btmrvl_send_hscfg_cmd(priv); + + return 0; +} + /* * This function handles the event generated by firmware, rx data * received from firmware, and tx data sent from kernel. @@ -525,8 +540,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) hdev->flush = btmrvl_flush; hdev->send = btmrvl_send_frame; hdev->ioctl = btmrvl_ioctl; - - btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); + hdev->setup = btmrvl_setup; hdev->dev_type = priv->btmrvl_dev.dev_type; |