From: Bing Zhao <bzhao@marvell.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Marcel Holtmann <marcel@holtmann.org>,
Gustavo Padovan <gustavo@padovan.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
<linux-wireless@vger.kernel.org>,
Mike Frysinger <vapier@chromium.org>,
Hyuckjoo Lee <hyuckjoo.lee@samsung.com>,
Amitkumar Karwar <akarwar@marvell.com>,
Bing Zhao <bzhao@marvell.com>
Subject: [PATCH v6 3/4] Bluetooth: btmrvl: add setup handler
Date: Tue, 1 Oct 2013 12:19:14 -0700 [thread overview]
Message-ID: <1380655155-10007-4-git-send-email-bzhao@marvell.com> (raw)
In-Reply-To: <1380655155-10007-1-git-send-email-bzhao@marvell.com>
From: Amitkumar Karwar <akarwar@marvell.com>
Move initialization code to hdev's setup handler.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
v6: remove setup_done variable (Marcel Holtmann)
This change requires a fix in hci_core for hci_setup.
v5: make use of hdev's setup handler (Marcel Holtmann)
drivers/bluetooth/btmrvl_main.c | 18 ++++++++++++++++--
drivers/bluetooth/btmrvl_sdio.c | 6 ------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/bluetooth/btmrvl_main.c b/drivers/bluetooth/btmrvl_main.c
index a4da7c8..e0ae1f4 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;
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 00da6df..5b70bcb 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -1046,12 +1046,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
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;
disable_host_int:
--
1.8.0
next prev parent reply other threads:[~2013-10-01 19:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 19:19 [PATCH v6 0/4] Bluetooth: btmrvl cal data downloading Bing Zhao
2013-10-01 19:19 ` [PATCH v6 1/4] Bluetooth: btmrvl: add btmrvl_send_sync_cmd() function Bing Zhao
2013-10-02 5:30 ` Marcel Holtmann
2013-10-01 19:19 ` [PATCH v6 2/4] Bluetooth: btmrvl: get rid of struct btmrvl_cmd Bing Zhao
2013-10-02 5:26 ` Marcel Holtmann
2013-10-01 19:19 ` Bing Zhao [this message]
2013-10-02 5:28 ` [PATCH v6 3/4] Bluetooth: btmrvl: add setup handler Marcel Holtmann
2013-10-01 19:19 ` [PATCH v6 4/4] Bluetooth: btmrvl: add calibration data download support Bing Zhao
2013-10-02 5:32 ` Marcel Holtmann
2013-10-02 7:37 ` [PATCH v6 0/4] Bluetooth: btmrvl cal data downloading Marcel Holtmann
2013-10-03 18:20 ` Bing Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380655155-10007-4-git-send-email-bzhao@marvell.com \
--to=bzhao@marvell.com \
--cc=akarwar@marvell.com \
--cc=gustavo@padovan.org \
--cc=hyuckjoo.lee@samsung.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=vapier@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox