mbox series

[v6,0/4] Bluetooth: hci_bcm: Additional changes for BCM4354 support

Message ID 20191118192123.82430-1-abhishekpandit@chromium.org
Headers show
Series Bluetooth: hci_bcm: Additional changes for BCM4354 support | expand

Message

Abhishek Pandit-Subedi Nov. 18, 2019, 7:21 p.m. UTC
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 v6:
- Added btbcm_read_pcm_int_params and change pcm params to first read
  the pcm params before setting it

Changes in v5:
- Rename parameters to bt-* and read as integer instead of bytestring
- Update documentation with defaults and put values in header
- Changed patch order

Changes in v4:
- Fix incorrect function name in hci_bcm

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
  dt-bindings: net: broadcom-bluetooth: Add pcm config
  Bluetooth: hci_bcm: Support pcm params in dts

 .../bindings/net/broadcom-bluetooth.txt       | 16 ++++
 drivers/bluetooth/btbcm.c                     | 47 ++++++++++
 drivers/bluetooth/btbcm.h                     | 16 ++++
 drivers/bluetooth/hci_bcm.c                   | 88 ++++++++++++++++++-
 include/dt-bindings/bluetooth/brcm.h          | 32 +++++++
 5 files changed, 197 insertions(+), 2 deletions(-)
 create mode 100644 include/dt-bindings/bluetooth/brcm.h

Comments

Marcel Holtmann Nov. 23, 2019, 10:04 a.m. UTC | #1
Hi Abhishek,

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

so I have re-factored your patch set now to apply to latest bluetooth-next tree and posted it to the mailing list. Please have a look at it if this works for you. If it does, then we might just apply it this way and focus on getting detailed PCM codec configuration for all vendors in once we have a second vendor to unify it.

Regards

Marcel
Abhishek Pandit-Subedi Nov. 25, 2019, 6:20 p.m. UTC | #2
Hey,

It looks about the same as one of my earlier patch series. Outside a
few nitpicks, I'm ok with merging this.

Thanks
Abhishek

On Sat, Nov 23, 2019 at 2:04 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Abhishek,
>
> > 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.
>
> so I have re-factored your patch set now to apply to latest bluetooth-next tree and posted it to the mailing list. Please have a look at it if this works for you. If it does, then we might just apply it this way and focus on getting detailed PCM codec configuration for all vendors in once we have a second vendor to unify it.
>
> Regards
>
> Marcel
>
Marcel Holtmann Nov. 26, 2019, 7:19 a.m. UTC | #3
Hi Abhishek,

> It looks about the same as one of my earlier patch series. Outside a
> few nitpicks, I'm ok with merging this.

I fixed the nitpicks up and send a v2.

However we should still work towards a generic description of Bluetooth PCM settings for all vendors. Any ideas are welcome.

Regards

Marcel
Abhishek Pandit-Subedi Nov. 26, 2019, 8:40 p.m. UTC | #4
Hey Marcel,

The series looks good to me.

Thanks
Abhishek

On Mon, Nov 25, 2019 at 11:19 PM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Abhishek,
>
> > It looks about the same as one of my earlier patch series. Outside a
> > few nitpicks, I'm ok with merging this.
>
> I fixed the nitpicks up and send a v2.
>
> However we should still work towards a generic description of Bluetooth PCM settings for all vendors. Any ideas are welcome.
>
> Regards
>
> Marcel
>
Marcel Holtmann Nov. 27, 2019, 5:37 a.m. UTC | #5
Hi Abhishek,

> The series looks good to me.

you also tested it on your hardware?

Regards

Marcel
Abhishek Pandit-Subedi Nov. 27, 2019, 10:14 p.m. UTC | #6
On Tue, Nov 26, 2019 at 9:37 PM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Abhishek,
>
> > The series looks good to me.
>
> you also tested it on your hardware?
>
> Regards
>
> Marcel
>

I have tested it on my hardware and it looks good now.

Only problem is it looks like the documentation is slightly wrong:

+               brcm,bt-pcm-int-params = [1 2 0 1 1];
should be
+               brcm,bt-pcm-int-params = [01 02 00 01 01];
or
+               brcm,bt-pcm-int-params = /bits/ 8 <1 2 0 1 1>;

Thanks
Abhishek
Marcel Holtmann Nov. 27, 2019, 10:18 p.m. UTC | #7
Hi Abhishek,

>>> The series looks good to me.
>> 
>> you also tested it on your hardware?
>> 
>> Regards
>> 
>> Marcel
>> 
> 
> I have tested it on my hardware and it looks good now.
> 
> Only problem is it looks like the documentation is slightly wrong:
> 
> +               brcm,bt-pcm-int-params = [1 2 0 1 1];
> should be
> +               brcm,bt-pcm-int-params = [01 02 00 01 01];
> or
> +               brcm,bt-pcm-int-params = /bits/ 8 <1 2 0 1 1>;
> 

since Johan already applied the patches, send a follow up patch for the docs.

Regards

Marcel