From: Frederic Danis <frederic.danis@linux.intel.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 4/5] Bluetooth: btbcm: Split setup() function
Date: Fri, 15 May 2015 16:11:31 +0200 [thread overview]
Message-ID: <5555FE93.30401@linux.intel.com> (raw)
In-Reply-To: <6F8C6327-C7F0-4081-B3A8-8A3A609C915E@holtmann.org>
Hello Marcel,
On 07/05/2015 18:22, Marcel Holtmann wrote:
> Hi Fred,
>
>> Split btbcm_setup_patchram in 3 functions : btbcm_setup_patchram,
>> btbcm_patchram (already existing) and btbcm_setup_post.
>> For UART controllers this will allow to reset speed to default one
>> after firmware loading, which will have reseted controller speed to
>> default one.
>>
>> Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
>> ---
>> drivers/bluetooth/btbcm.c | 29 +++++++++++++++++------------
>> drivers/bluetooth/btbcm.h | 11 +++++++++--
>> drivers/bluetooth/btusb.c | 23 ++++++++++++++++++++++-
>> drivers/bluetooth/hci_bcm.c | 19 ++++++++++++++++++-
>> 4 files changed, 66 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
>> index b258454..f2efbbd 100644
>> --- a/drivers/bluetooth/btbcm.c
>> +++ b/drivers/bluetooth/btbcm.c
>> @@ -277,9 +277,8 @@ static const struct {
>> { }
>> };
>>
>> -int btbcm_setup_patchram(struct hci_dev *hdev)
>> +int btbcm_setup_patchram(struct hci_dev *hdev, char *fw_name, size_t len)
>
> what is this len for? The fw_name is not a return value. I think the functions for doing the patchram should just get a firmware and then just do patchram.
I split btbcm_setup_patchram() in 3 functions:
- btbcm_setup_patchram() which resets the controller and returns the
firmware name.
- btbtcm_patchram() (already existing and public), which takes the
firmware name as parameter, requests the firmware and loads it to the
controller.
- btbcm_setup_post() which resets the controller, reads local version
and checks if the controller address is a default one or not.
I split it between btbcm_patchram() and btbcm_setup_post() as firmware
loading may reset the controller UART speed and it needs to set host
UART speed back to init speed.
I also split it between btbcm_setup_patchram() and btbtcm_patchram()
because error is not managed the same way for both of them.
When btbcm_setup_patchram() returns an error, this error is forwarded to
caller.
When btbtcm_patchram() returns an error, if the error is -ENOENT then
this error is discarded and 0 is returned to caller. Otherwise, the
error is also discarded but there is a need to call btbcm_setup_post()
to reset controller.
Regards
Fred
--
Frederic Danis Open Source Technology Center
frederic.danis@intel.com Intel Corporation
next prev parent reply other threads:[~2015-05-15 14:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 14:24 [PATCH v2 1/5] Bluetooth: hci_core: return cmd status in __hci_cmd_sync() Frederic Danis
2015-05-07 14:24 ` [PATCH v2 2/5] Bluetooth: btbcm: Add BCM4324B3 UART device Frederic Danis
2015-05-07 16:19 ` Marcel Holtmann
2015-05-13 14:10 ` Frederic Danis
2015-05-07 14:24 ` [PATCH v2 3/5] Bluetooth: hci_uart: Support operational speed during setup Frederic Danis
2015-05-07 16:13 ` Marcel Holtmann
2015-05-07 14:24 ` [PATCH v2 4/5] Bluetooth: btbcm: Split setup() function Frederic Danis
2015-05-07 16:22 ` Marcel Holtmann
2015-05-15 14:11 ` Frederic Danis [this message]
2015-05-15 17:17 ` Marcel Holtmann
2015-05-07 14:24 ` [PATCH v2 5/5] Bluetooth: btbcm: Add bcm_set_baudrate() Frederic Danis
2015-05-07 16:16 ` Marcel Holtmann
2015-05-07 16:11 ` [PATCH v2 1/5] Bluetooth: hci_core: return cmd status in __hci_cmd_sync() 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=5555FE93.30401@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.