linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support
@ 2019-11-12  0:19 Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 1/4] Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354 Abhishek Pandit-Subedi
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2019-11-12  0:19 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Rob Herring
  Cc: linux-bluetooth, dianders, Abhishek Pandit-Subedi, devicetree,
	David S. Miller, netdev, linux-kernel, Ondrej Jirman,
	Mark Rutland, Chen-Yu Tsai


While adding support for the BCM4354, I discovered a few more things
that weren't working as they should have.

First, we disallow serdev from setting the baudrate on BCM4354. Serdev
sets the oper_speed first before calling hu->setup() in
hci_uart_setup(). On the BCM4354, this results in bcm_setup() failing
when the hci reset times out.

Next, we add support for setting the PCM parameters, which consists of
a pair of vendor specific opcodes to set the pcm parameters. The
documentation for these params are available in the brcm_patchram_plus
package (i.e. https://github.com/balena-os/brcm_patchram_plus). This is
necessary for PCM to work properly.

All changes were tested with rk3288-veyron-minnie.dts.


Changes in v3:
- Change disallow baudrate setting to return -EBUSY if called before
  ready. bcm_proto is no longer modified and is back to being const.
- Changed btbcm_set_pcm_params to btbcm_set_pcm_int_params
- Changed brcm,sco-routing to brcm,bt-sco-routing

Changes in v2:
- Use match data to disallow baudrate setting
- Parse pcm parameters by name instead of as a byte string
- Fix prefix for dt-bindings commit

Abhishek Pandit-Subedi (4):
  Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354
  Bluetooth: btbcm: Support pcm configuration
  Bluetooth: hci_bcm: Support pcm params in dts
  dt-bindings: net: broadcom-bluetooth: Add pcm config

 .../bindings/net/broadcom-bluetooth.txt       | 11 +++
 drivers/bluetooth/btbcm.c                     | 18 +++++
 drivers/bluetooth/btbcm.h                     |  8 +++
 drivers/bluetooth/hci_bcm.c                   | 70 ++++++++++++++++++-
 4 files changed, 106 insertions(+), 1 deletion(-)

-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/4] Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354
  2019-11-12  0:19 [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support Abhishek Pandit-Subedi
@ 2019-11-12  0:19 ` Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 2/4] Bluetooth: btbcm: Support pcm configuration Abhishek Pandit-Subedi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2019-11-12  0:19 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Rob Herring
  Cc: linux-bluetooth, dianders, Abhishek Pandit-Subedi, linux-kernel

Without updating the patchram, the BCM4354 does not support a higher
operating speed. The normal bcm_setup follows the correct order
(init_speed, patchram and then oper_speed) but the serdev driver will
set the operating speed before calling the hu->setup function. Thus,
for the BCM4354, disallow setting the operating speed before patchram.
If set_baudrate is called before setup, it will return -EBUSY.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/bluetooth/hci_bcm.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 0f851c0dde7f..6134bff58748 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -47,6 +47,14 @@
 
 #define BCM_NUM_SUPPLIES 2
 
+/**
+ * struct bcm_device_data - device specific data
+ * @no_early_set_baudrate: Disallow set baudrate before driver setup()
+ */
+struct bcm_device_data {
+	bool	no_early_set_baudrate;
+};
+
 /**
  * struct bcm_device - device driver resources
  * @serdev_hu: HCI UART controller struct
@@ -79,6 +87,7 @@
  * @hu: pointer to HCI UART controller struct,
  *	used to disable flow control during runtime suspend and system sleep
  * @is_suspended: whether flow control is currently disabled
+ * @disallow_set_baudrate: don't allow set_baudrate
  */
 struct bcm_device {
 	/* Must be the first member, hci_serdev.c expects this. */
@@ -112,6 +121,7 @@ struct bcm_device {
 	struct hci_uart		*hu;
 	bool			is_suspended;
 #endif
+	bool			disallow_set_baudrate;
 };
 
 /* generic bcm uart resources */
@@ -141,9 +151,13 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
 static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
 {
 	struct hci_dev *hdev = hu->hdev;
+	struct bcm_data *bcm = hu->priv;
 	struct sk_buff *skb;
 	struct bcm_update_uart_baud_rate param;
 
+	if (bcm && bcm->dev && bcm->dev->disallow_set_baudrate)
+		return -EBUSY;
+
 	if (speed > 3000000) {
 		struct bcm_write_uart_clock_setting clock;
 
@@ -551,6 +565,12 @@ static int bcm_setup(struct hci_uart *hu)
 		goto finalize;
 	}
 
+	/* If we disallow early set baudrate, we can re-enable it now that
+	 * patchram is done
+	 */
+	if (bcm->dev && bcm->dev->disallow_set_baudrate)
+		bcm->dev->disallow_set_baudrate = false;
+
 	/* Init speed if any */
 	if (hu->init_speed)
 		speed = hu->init_speed;
@@ -1371,6 +1391,15 @@ static struct platform_driver bcm_driver = {
 	},
 };
 
+static void bcm_configure_device_data(struct bcm_device *bdev)
+{
+	const struct bcm_device_data *data = device_get_match_data(bdev->dev);
+
+	if (data) {
+		bdev->disallow_set_baudrate = data->no_early_set_baudrate;
+	}
+}
+
 static int bcm_serdev_probe(struct serdev_device *serdev)
 {
 	struct bcm_device *bcmdev;
@@ -1408,6 +1437,8 @@ static int bcm_serdev_probe(struct serdev_device *serdev)
 	if (err)
 		dev_err(&serdev->dev, "Failed to power down\n");
 
+	bcm_configure_device_data(bcmdev);
+
 	return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto);
 }
 
@@ -1419,12 +1450,16 @@ static void bcm_serdev_remove(struct serdev_device *serdev)
 }
 
 #ifdef CONFIG_OF
+struct bcm_device_data bcm4354_device_data = {
+	.no_early_set_baudrate = true,
+};
+
 static const struct of_device_id bcm_bluetooth_of_match[] = {
 	{ .compatible = "brcm,bcm20702a1" },
 	{ .compatible = "brcm,bcm4345c5" },
 	{ .compatible = "brcm,bcm4330-bt" },
 	{ .compatible = "brcm,bcm43438-bt" },
-	{ .compatible = "brcm,bcm43540-bt" },
+	{ .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/4] Bluetooth: btbcm: Support pcm configuration
  2019-11-12  0:19 [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 1/4] Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354 Abhishek Pandit-Subedi
@ 2019-11-12  0:19 ` Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 4/4] dt-bindings: net: broadcom-bluetooth: Add pcm config Abhishek Pandit-Subedi
  3 siblings, 0 replies; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2019-11-12  0:19 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Rob Herring
  Cc: linux-bluetooth, dianders, Abhishek Pandit-Subedi, linux-kernel

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)

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/bluetooth/btbcm.c | 18 ++++++++++++++++++
 drivers/bluetooth/btbcm.h |  8 ++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 2d2e6d862068..d22a2025f7e1 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -105,6 +105,24 @@ int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 }
 EXPORT_SYMBOL_GPL(btbcm_set_bdaddr);
 
+int btbcm_set_pcm_int_params(struct hci_dev *hdev,
+			     const struct bcm_set_pcm_int_params *int_params)
+{
+	struct sk_buff *skb;
+	int err;
+
+	skb = __hci_cmd_sync(hdev, 0xfc1c, 5, int_params, HCI_INIT_TIMEOUT);
+	if (IS_ERR(skb)) {
+		err = PTR_ERR(skb);
+		bt_dev_err(hdev, "BCM: Set PCM int params failed (%d)", err);
+		return err;
+	}
+	kfree_skb(skb);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(btbcm_set_pcm_int_params);
+
 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
 {
 	const struct hci_command_hdr *cmd;
diff --git a/drivers/bluetooth/btbcm.h b/drivers/bluetooth/btbcm.h
index d204be8a84bf..bf9d86924787 100644
--- a/drivers/bluetooth/btbcm.h
+++ b/drivers/bluetooth/btbcm.h
@@ -54,6 +54,8 @@ struct bcm_set_pcm_format_params {
 int btbcm_check_bdaddr(struct hci_dev *hdev);
 int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
 int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw);
+int btbcm_set_pcm_int_params(struct hci_dev *hdev,
+			     const struct bcm_set_pcm_int_params *int_params);
 
 int btbcm_setup_patchram(struct hci_dev *hdev);
 int btbcm_setup_apple(struct hci_dev *hdev);
@@ -74,6 +76,12 @@ static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 	return -EOPNOTSUPP;
 }
 
+int btbcm_set_pcm_int_params(struct hci_dev *hdev,
+			     const struct bcm_set_pcm_int_params *int_params)
+{
+	return -EOPNOTSUPP;
+}
+
 static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
 {
 	return -EOPNOTSUPP;
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts
  2019-11-12  0:19 [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 1/4] Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354 Abhishek Pandit-Subedi
  2019-11-12  0:19 ` [PATCH v3 2/4] Bluetooth: btbcm: Support pcm configuration Abhishek Pandit-Subedi
@ 2019-11-12  0:19 ` Abhishek Pandit-Subedi
  2019-11-12 22:49   ` kbuild test robot
  2019-11-12  0:19 ` [PATCH v3 4/4] dt-bindings: net: broadcom-bluetooth: Add pcm config Abhishek Pandit-Subedi
  3 siblings, 1 reply; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2019-11-12  0:19 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Rob Herring
  Cc: linux-bluetooth, dianders, Abhishek Pandit-Subedi, linux-kernel

BCM chips may require configuration of PCM to operate correctly and
there is a vendor specific HCI command to do this. Add support in the
hci_bcm driver to parse this from devicetree and configure the chip.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/bluetooth/hci_bcm.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 6134bff58748..b7f47d9edb7d 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -88,6 +88,8 @@ struct bcm_device_data {
  *	used to disable flow control during runtime suspend and system sleep
  * @is_suspended: whether flow control is currently disabled
  * @disallow_set_baudrate: don't allow set_baudrate
+ * @has_pcm_params: whether PCM parameters need to be configured
+ * @pcm_params: PCM and routing parameters
  */
 struct bcm_device {
 	/* Must be the first member, hci_serdev.c expects this. */
@@ -122,6 +124,9 @@ struct bcm_device {
 	bool			is_suspended;
 #endif
 	bool			disallow_set_baudrate;
+
+	bool				has_pcm_params;
+	struct bcm_set_pcm_int_params	pcm_params;
 };
 
 /* generic bcm uart resources */
@@ -596,6 +601,17 @@ static int bcm_setup(struct hci_uart *hu)
 			host_set_baudrate(hu, speed);
 	}
 
+	/* PCM parameters if any*/
+	if (bcm->dev && bcm->dev->has_pcm_params) {
+		err = btbcm_set_pcm_params(hu->hdev, &bcm->dev->pcm_params,
+					   NULL);
+
+		if (err) {
+			bt_dev_info(hu->hdev, "BCM: Set pcm params failed (%d)",
+				    err);
+		}
+	}
+
 finalize:
 	release_firmware(fw);
 
@@ -1132,7 +1148,24 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 
 static int bcm_of_probe(struct bcm_device *bdev)
 {
+	int err;
+
 	device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed);
+
+	err = device_property_read_u8(bdev->dev, "brcm,bt-sco-routing",
+				      &bdev->pcm_params.routing);
+	if (!err)
+		bdev->has_pcm_params = true;
+
+	device_property_read_u8(bdev->dev, "brcm,pcm-interface-rate",
+				&bdev->pcm_params.rate);
+	device_property_read_u8(bdev->dev, "brcm,pcm-frame-type",
+				&bdev->pcm_params.frame_sync);
+	device_property_read_u8(bdev->dev, "brcm,pcm-sync-mode",
+				&bdev->pcm_params.sync_mode);
+	device_property_read_u8(bdev->dev, "brcm,pcm-clock-mode",
+				&bdev->pcm_params.clock_mode);
+
 	return 0;
 }
 
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 4/4] dt-bindings: net: broadcom-bluetooth: Add pcm config
  2019-11-12  0:19 [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support Abhishek Pandit-Subedi
                   ` (2 preceding siblings ...)
  2019-11-12  0:19 ` [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts Abhishek Pandit-Subedi
@ 2019-11-12  0:19 ` Abhishek Pandit-Subedi
  3 siblings, 0 replies; 6+ messages in thread
From: Abhishek Pandit-Subedi @ 2019-11-12  0:19 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Rob Herring
  Cc: linux-bluetooth, dianders, Abhishek Pandit-Subedi, devicetree,
	David S. Miller, netdev, linux-kernel, Ondrej Jirman,
	Mark Rutland, Chen-Yu Tsai

Add documentation for pcm parameters.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

---

Changes in v3:
- Change disallow baudrate setting to return -EBUSY if called before
  ready. bcm_proto is no longer modified and is back to being const.
- Changed btbcm_set_pcm_params to btbcm_set_pcm_int_params
- Changed brcm,sco-routing to brcm,bt-sco-routing

Changes in v2:
- Use match data to disallow baudrate setting
- Parse pcm parameters by name instead of as a byte string
- Fix prefix for dt-bindings commit

 .../devicetree/bindings/net/broadcom-bluetooth.txt    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
index c749dc297624..42fb2fa8143d 100644
--- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
+++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
@@ -29,6 +29,11 @@ Optional properties:
    - "lpo": external low power 32.768 kHz clock
  - vbat-supply: phandle to regulator supply for VBAT
  - vddio-supply: phandle to regulator supply for VDDIO
+ - brcm,bt-sco-routing: 0-3 (PCM, Transport, Codec, I2S)
+ - brcm,pcm-interface-rate: 0-4 (128KBps, 256KBps, 512KBps, 1024KBps, 2048KBps)
+ - brcm,pcm-frame-type: 0-1 (short, long)
+ - brcm,pcm-sync-mode: 0-1 (slave, master)
+ - brcm,pcm-clock-mode: 0-1 (slave, master)
 
 
 Example:
@@ -40,5 +45,11 @@ Example:
        bluetooth {
                compatible = "brcm,bcm43438-bt";
                max-speed = <921600>;
+
+               brcm,bt-sco-routing = [01];
+               brcm,pcm-interface-rate = [02];
+               brcm,pcm-frame-type = [00];
+               brcm,pcm-sync-mode = [01];
+               brcm,pcm-clock-mode = [01];
        };
 };
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts
  2019-11-12  0:19 ` [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts Abhishek Pandit-Subedi
@ 2019-11-12 22:49   ` kbuild test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-11-12 22:49 UTC (permalink / raw)
  To: Abhishek Pandit-Subedi
  Cc: kbuild-all, Marcel Holtmann, Johan Hedberg, Rob Herring,
	linux-bluetooth, dianders, Abhishek Pandit-Subedi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4044 bytes --]

Hi Abhishek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[cannot apply to v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Abhishek-Pandit-Subedi/Bluetooth-hci_bcm-Additional-changes-for-BCM4354-support/20191113-053047
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/bluetooth/hci_bcm.c: In function 'bcm_setup':
>> drivers/bluetooth/hci_bcm.c:606:9: error: implicit declaration of function 'btbcm_set_pcm_params'; did you mean 'btbcm_set_pcm_int_params'? [-Werror=implicit-function-declaration]
      err = btbcm_set_pcm_params(hu->hdev, &bcm->dev->pcm_params,
            ^~~~~~~~~~~~~~~~~~~~
            btbcm_set_pcm_int_params
   cc1: some warnings being treated as errors

vim +606 drivers/bluetooth/hci_bcm.c

   543	
   544	static int bcm_setup(struct hci_uart *hu)
   545	{
   546		struct bcm_data *bcm = hu->priv;
   547		char fw_name[64];
   548		const struct firmware *fw;
   549		unsigned int speed;
   550		int err;
   551	
   552		bt_dev_dbg(hu->hdev, "hu %p", hu);
   553	
   554		hu->hdev->set_diag = bcm_set_diag;
   555		hu->hdev->set_bdaddr = btbcm_set_bdaddr;
   556	
   557		err = btbcm_initialize(hu->hdev, fw_name, sizeof(fw_name), false);
   558		if (err)
   559			return err;
   560	
   561		err = request_firmware(&fw, fw_name, &hu->hdev->dev);
   562		if (err < 0) {
   563			bt_dev_info(hu->hdev, "BCM: Patch %s not found", fw_name);
   564			return 0;
   565		}
   566	
   567		err = btbcm_patchram(hu->hdev, fw);
   568		if (err) {
   569			bt_dev_info(hu->hdev, "BCM: Patch failed (%d)", err);
   570			goto finalize;
   571		}
   572	
   573		/* If we disallow early set baudrate, we can re-enable it now that
   574		 * patchram is done
   575		 */
   576		if (bcm->dev && bcm->dev->disallow_set_baudrate)
   577			bcm->dev->disallow_set_baudrate = false;
   578	
   579		/* Init speed if any */
   580		if (hu->init_speed)
   581			speed = hu->init_speed;
   582		else if (hu->proto->init_speed)
   583			speed = hu->proto->init_speed;
   584		else
   585			speed = 0;
   586	
   587		if (speed)
   588			host_set_baudrate(hu, speed);
   589	
   590		/* Operational speed if any */
   591		if (hu->oper_speed)
   592			speed = hu->oper_speed;
   593		else if (hu->proto->oper_speed)
   594			speed = hu->proto->oper_speed;
   595		else
   596			speed = 0;
   597	
   598		if (speed) {
   599			err = bcm_set_baudrate(hu, speed);
   600			if (!err)
   601				host_set_baudrate(hu, speed);
   602		}
   603	
   604		/* PCM parameters if any*/
   605		if (bcm->dev && bcm->dev->has_pcm_params) {
 > 606			err = btbcm_set_pcm_params(hu->hdev, &bcm->dev->pcm_params,
   607						   NULL);
   608	
   609			if (err) {
   610				bt_dev_info(hu->hdev, "BCM: Set pcm params failed (%d)",
   611					    err);
   612			}
   613		}
   614	
   615	finalize:
   616		release_firmware(fw);
   617	
   618		err = btbcm_finalize(hu->hdev);
   619		if (err)
   620			return err;
   621	
   622		if (!bcm_request_irq(bcm))
   623			err = bcm_setup_sleep(hu);
   624	
   625		return err;
   626	}
   627	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59102 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-12 22:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12  0:19 [PATCH v3 0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support Abhishek Pandit-Subedi
2019-11-12  0:19 ` [PATCH v3 1/4] Bluetooth: hci_bcm: Disallow set_baudrate for BCM4354 Abhishek Pandit-Subedi
2019-11-12  0:19 ` [PATCH v3 2/4] Bluetooth: btbcm: Support pcm configuration Abhishek Pandit-Subedi
2019-11-12  0:19 ` [PATCH v3 3/4] Bluetooth: hci_bcm: Support pcm params in dts Abhishek Pandit-Subedi
2019-11-12 22:49   ` kbuild test robot
2019-11-12  0:19 ` [PATCH v3 4/4] dt-bindings: net: broadcom-bluetooth: Add pcm config Abhishek Pandit-Subedi

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).