From: Frederic Danis <frederic.danis@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v7 5/6] Bluetooth: hci_uart: Update Broadcom UART setup
Date: Thu, 28 May 2015 11:25:05 +0200 [thread overview]
Message-ID: <1432805106-25719-6-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1432805106-25719-1-git-send-email-frederic.danis@linux.intel.com>
Use btbcm helpers to perform controller setup.
Perform host UART reset to init speed between btbcm_patchram() and
btbcm_finalize(). This may be need because firmware loading may have
reseted controller UART to init speed.
Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
---
drivers/bluetooth/hci_bcm.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 1ec0b4a..6c34135 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -79,11 +79,39 @@ static int bcm_flush(struct hci_uart *hu)
static int bcm_setup(struct hci_uart *hu)
{
+ char fw_name[64];
+ const struct firmware *fw;
+ int err;
+
BT_DBG("hu %p", hu);
hu->hdev->set_bdaddr = btbcm_set_bdaddr;
- return btbcm_setup_patchram(hu->hdev);
+ err = btbcm_initialize(hu->hdev, fw_name, sizeof(fw_name));
+ if (err)
+ return err;
+
+ err = request_firmware(&fw, fw_name, &hu->hdev->dev);
+ if (err < 0) {
+ BT_INFO("%s: BCM: Patch %s not found", hu->hdev->name, fw_name);
+ return 0;
+ }
+
+ err = btbcm_patchram(hu->hdev, fw);
+ if (err) {
+ BT_INFO("%s: BCM: Patch failed (%d)", hu->hdev->name, err);
+ goto finalize;
+ }
+
+ if (hu->proto->init_speed)
+ hci_uart_set_baudrate(hu, hu->proto->init_speed);
+
+finalize:
+ release_firmware(fw);
+
+ err = btbcm_finalize(hu->hdev);
+
+ return err;
}
static const struct h4_recv_pkt bcm_recv_pkts[] = {
--
1.9.1
next prev parent reply other threads:[~2015-05-28 9:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 9:25 [PATCH v7 0/6] Add baudrate management for Bluetooth UART Frederic Danis
2015-05-28 9:25 ` [PATCH v7 1/6] Bluetooth: btbcm: Move request/release_firmware() Frederic Danis
2015-06-06 5:41 ` Marcel Holtmann
2015-05-28 9:25 ` [PATCH v7 2/6] Bluetooth: btbcm: Add BCM4324B3 UART device Frederic Danis
2015-06-06 5:41 ` Marcel Holtmann
2015-05-28 9:25 ` [PATCH v7 3/6] Bluetooth: hci_uart: Support operational speed during setup Frederic Danis
2015-05-28 9:25 ` [PATCH v7 4/6] Bluetooth: btbcm: Add helper functions for UART setup Frederic Danis
2015-06-06 5:41 ` Marcel Holtmann
2015-05-28 9:25 ` Frederic Danis [this message]
2015-05-28 9:25 ` [PATCH v7 6/6] Bluetooth: hci_uart: Add bcm_set_baudrate() Frederic Danis
2015-06-06 5:47 ` Marcel Holtmann
2015-06-06 5:48 ` [PATCH v7 0/6] Add baudrate management for Bluetooth UART Marcel Holtmann
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=1432805106-25719-6-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).