History log of /linux-master/drivers/bluetooth/btbcm.h
Revision Date Author Comments
# af35e28f 30-May-2022 Hakan Jansson <hakan.jansson@infineon.com>

Bluetooth: hci_bcm: Add support for FW loading in autobaud mode

Use the presence of a DT property, "brcm,requires-autobaud-mode", to enable
startup in autobaud mode. If the property is present, the device is started
in autobaud mode by asserting RTS (BT_UART_CTS_N) prior to powering on the
device.

Also prevent the use of unsupported commands for devices started in
autobaud mode. Only a limited subset of HCI commands are supported in
autobaud mode.

Some devices (e.g. CYW5557x) require autobaud mode to enable FW loading.
Autobaud mode can also be required on some boards where the controller
device is using a non-standard baud rate in normal mode when first powered
on.

Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 0383f16a 17-Apr-2020 Hans de Goede <hdegoede@redhat.com>

Bluetooth: btbcm: Make btbcm_setup_patchram use btbcm_finalize

On UART attached devices we do:

1. btbcm_initialize()
2. Setup UART baudrate, etc.
3. btbcm_finalize()

After our previous changes we can now also use btbcm_finalize() from
the btbcm_setup_patchram() function used on USB devices without any
functional changes. This completes unifying the USB and UART paths
as much as possible.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 0287c5d8 17-Apr-2020 Hans de Goede <hdegoede@redhat.com>

Bluetooth: btbcm: Fold Patch loading + applying into btbcm_initialize()

Instead of having btbcm_initialize() fill a passed in fw_name buffer
and then have its callers use that to request the firmware + load
it into the HCI, make btbcm_initialize() do this itself the first
time it is called (its get called a second time to reset the HCI
after the firmware has been loaded).

This removes some code duplication and makes it easier for further
patches in this series to try more then 1 firmware filename.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 5bd64c64 26-Dec-2019 Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

Bluetooth: btbcm: Add missing static inline in header

This fixes a double definition error when CONFIG_BT_BCM is not set.

Fixes: 528379902337 ("Bluetooth: btbcm: Support pcm configuration")
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 52837990 26-Nov-2019 Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

Bluetooth: btbcm: Support pcm configuration

Add BCM vendor specific command to configure PCM parameters. The new
vendor opcode allows us to set the sco routing, the pcm interface rate,
and a few other pcm specific options (frame sync, sync mode, and clock
mode). See broadcom-bluetooth.txt in Documentation for more information
about valid values for those settings.

Here is an example trace where this opcode was used to configure
a BCM4354:

< HCI Command: Vendor (0x3f|0x001c) plen 5
01 02 00 01 01
> HCI Event: Command Complete (0x0e) plen 4
Vendor (0x3f|0x001c) ncmd 1
Status: Success (0x00)

We can read back the values as well with ocf 0x001d to confirm the
values that were set:
$ hcitool cmd 0x3f 0x001d
< HCI Command: ogf 0x3f, ocf 0x001d, plen 0
> HCI Event: 0x0e plen 9
01 1D FC 00 01 02 00 01 01

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 22ac1916 20-Apr-2018 Hans de Goede <hdegoede@redhat.com>

Bluetooth: btbcm: Allow using btbcm_initialize() for reinit

btbcm_finalize() does a re-init of the controller, which is almost the
same as the initial init. Modify btbcm_initialize() so that it can be
used for this re-init and modify btbcm_finalize() to use it.

As an added bonus this also makes the dev_info from btbcm_finalize()
use the proper hw_name instead of always printing "BCM".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# ff875960 10-Jan-2018 Lukas Wunner <lukas@wunner.de>

Bluetooth: btbcm: Fix sleep mode struct ordering

According to the documentation for Laird SD40 radio modules (which use
the BCM4329 chipset), the order of the Enable_BREAK_To_Host and
Pulsed_HOST_WAKE parameters in the sleep mode struct is reversed
vis-à-vis our struct declaration. See page 46 of this PDF:

http://cdn.lairdtech.com/home/brandworld/files/Application%20Note%20-%2040%20Series%20Bluetooth.pdf

The documentation is dated Oct 2015, so fairly recent, making it appear
more likely that the documentation is correct and our code is wrong.
Amend our code to be in congruence with the documentation.

Cc: Sue White <sue.white@lairdtech.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 40db5f0e 17-Jun-2015 Ilya Faenson <ifaenson@broadcom.com>

Bluetooth: btbcm: Support the BCM4354 Bluetooth UART device

Support the BCM4354 chip and introduce vendor specific command
parameter definitions.

Signed-off-by: Ilya Faenson <ifaenson@broadcom.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 61b2fc2b 09-Jun-2015 Frederic Danis <frederic.danis@linux.intel.com>

Bluetooth: hci_uart: Add bcm_set_baudrate()

Add vendor specific command to change controller device speed.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 75e167e6 28-May-2015 Frederic Danis <frederic.danis@linux.intel.com>

Bluetooth: btbcm: Add helper functions for UART setup

Firmware loading may reset the controller UART speed and needs to set
host UART speed back to init speed.

UART drivers setup is split in 3 parts:
- btbcm_initialize() resets the controller and returns the firmware
name based on controller revision and sub_version.
- btbtcm_patchram() (already existing and public), which takes the
firmware name as parameter, requests the firmware and loads it to
the controller.
- btbcm_finalize() which resets the controller, reads local version
and checks if the controller address is a default one or not.

Remove firmware name retrieval for UART controllers from
btbcm_setup_patchram().

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 18aeb444 28-May-2015 Frederic Danis <frederic.danis@linux.intel.com>

Bluetooth: btbcm: Move request/release_firmware()

Move request/release_firmware() out of btbcm_patchram().
This allows a better error management, if request_firmware() returns an
error then the controller will be used without firmware loading and 0 is
returned.
This will imply to change btbcm_patchram() to accept a firmware instead
of firmware name.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>


# 50862ee5 10-Apr-2015 Marcel Holtmann <marcel@holtmann.org>

Bluetooth: btbcm: Export patchram download as separate function

This isolates the Broadcom patchram download procedure as separate
function so that it can be easily used from USB and UART based drivers.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>


# 1c8ba6d0 05-Apr-2015 Marcel Holtmann <marcel@holtmann.org>

Bluetooth: btbcm: Add support for Broadcom controller setup

To unify the controller setup of Broadcom devices between USB and UART
transport, add the patchram download support into the Broadcom module.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>


# 4fba30f0 05-Apr-2015 Marcel Holtmann <marcel@holtmann.org>

Bluetooth: btbcm: Introduce generic Broadcom Bluetooth support

The majority of Broadcom Bluetooth vendor commands are shared between
USB and UART transports. This creates a separate module that eventually
will hold all Broadcom specific commands, but for now just start with
the commands to change the Bluetooth public address and check for the
default address.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>