Commit 4b245722 authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by Marcel Holtmann

Bluetooth: btmrvl: add setup handler

Move initialization code to hdev's setup handler.
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 7d5b400c
...@@ -432,6 +432,21 @@ static int btmrvl_open(struct hci_dev *hdev) ...@@ -432,6 +432,21 @@ static int btmrvl_open(struct hci_dev *hdev)
return 0; 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 * This function handles the event generated by firmware, rx data
* received from firmware, and tx data sent from kernel. * received from firmware, and tx data sent from kernel.
...@@ -525,8 +540,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) ...@@ -525,8 +540,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
hdev->flush = btmrvl_flush; hdev->flush = btmrvl_flush;
hdev->send = btmrvl_send_frame; hdev->send = btmrvl_send_frame;
hdev->ioctl = btmrvl_ioctl; hdev->ioctl = btmrvl_ioctl;
hdev->setup = btmrvl_setup;
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
hdev->dev_type = priv->btmrvl_dev.dev_type; hdev->dev_type = priv->btmrvl_dev.dev_type;
......
...@@ -1046,12 +1046,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, ...@@ -1046,12 +1046,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
goto disable_host_int; goto disable_host_int;
} }
priv->btmrvl_dev.psmode = 1;
btmrvl_enable_ps(priv);
priv->btmrvl_dev.gpio_gap = 0xffff;
btmrvl_send_hscfg_cmd(priv);
return 0; return 0;
disable_host_int: disable_host_int:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment