mbox series

[RFC,0/4] Add WCN3988 Bluetooth support for Fairphone 4

Message ID 20230421-fp4-bluetooth-v1-0-0430e3a7e0a2@fairphone.com
Headers show
Series Add WCN3988 Bluetooth support for Fairphone 4 | expand

Message

Luca Weiss April 21, 2023, 2:11 p.m. UTC
Just to start with the important part why this is an RFC:

While Bluetooth chip init works totally fine and bluez seems to be
fairly happy with it, there's a (major) problem with scanning, as shown
with this bluetoothctl snippet and dmesg snippet:

  [bluetooth]# scan on
  Failed to start discovery: org.bluez.Error.InProgress

  [  202.371374] Bluetooth: hci0: Opcode 0x200b failed: -16

This opcode should be the following:

  include/net/bluetooth/hci.h:#define HCI_OP_LE_SET_SCAN_PARAM    0x200b

Unfortunately trying various existing code branches in the Bluetooth
driver doesn't show any sign of making this work and I don't really know
where to look to debug this further.

On the other hand "discoverable on" makes the device show up on other
devices during scanning , so the RF parts of the Bluetooth chip are
generally functional for sure.

Any ideas are welcome.

@Bjorn: Patch "arm64: dts: qcom: sm6350: add uart1 node" should be fine
to take regardless the RFC status, I don't think the problem is caused
there.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
Luca Weiss (4):
      dt-bindings: net: qualcomm: Add WCN3988
      Bluetooth: btqca: Add WCN3988 support
      arm64: dts: qcom: sm6350: add uart1 node
      arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth

 .../bindings/net/bluetooth/qualcomm-bluetooth.yaml |  2 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi               | 63 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 17 ++++++
 drivers/bluetooth/btqca.c                          | 13 ++++-
 drivers/bluetooth/btqca.h                          | 12 ++++-
 drivers/bluetooth/hci_qca.c                        | 12 +++++
 6 files changed, 115 insertions(+), 4 deletions(-)
---
base-commit: cf4c0112a0350cfe8a63b5eb3377e2366f57545b
change-id: 20230421-fp4-bluetooth-b36a0e87b9c8

Best regards,

Comments

Konrad Dybcio April 22, 2023, 12:03 p.m. UTC | #1
On 21.04.2023 16:11, Luca Weiss wrote:
> Just to start with the important part why this is an RFC:
> 
> While Bluetooth chip init works totally fine and bluez seems to be
> fairly happy with it, there's a (major) problem with scanning, as shown
> with this bluetoothctl snippet and dmesg snippet:
> 
>   [bluetooth]# scan on
>   Failed to start discovery: org.bluez.Error.InProgress
> 
>   [  202.371374] Bluetooth: hci0: Opcode 0x200b failed: -16
> 
> This opcode should be the following:
> 
>   include/net/bluetooth/hci.h:#define HCI_OP_LE_SET_SCAN_PARAM    0x200b
Not a bluetooth expert or anything, but does that thing support
bluetooth LE?

Konrad
> 
> Unfortunately trying various existing code branches in the Bluetooth
> driver doesn't show any sign of making this work and I don't really know
> where to look to debug this further.
> 
> On the other hand "discoverable on" makes the device show up on other
> devices during scanning , so the RF parts of the Bluetooth chip are
> generally functional for sure.
> 
> Any ideas are welcome.
> 
> @Bjorn: Patch "arm64: dts: qcom: sm6350: add uart1 node" should be fine
> to take regardless the RFC status, I don't think the problem is caused
> there.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
> Luca Weiss (4):
>       dt-bindings: net: qualcomm: Add WCN3988
>       Bluetooth: btqca: Add WCN3988 support
>       arm64: dts: qcom: sm6350: add uart1 node
>       arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth
> 
>  .../bindings/net/bluetooth/qualcomm-bluetooth.yaml |  2 +
>  arch/arm64/boot/dts/qcom/sm6350.dtsi               | 63 ++++++++++++++++++++++
>  arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 17 ++++++
>  drivers/bluetooth/btqca.c                          | 13 ++++-
>  drivers/bluetooth/btqca.h                          | 12 ++++-
>  drivers/bluetooth/hci_qca.c                        | 12 +++++
>  6 files changed, 115 insertions(+), 4 deletions(-)
> ---
> base-commit: cf4c0112a0350cfe8a63b5eb3377e2366f57545b
> change-id: 20230421-fp4-bluetooth-b36a0e87b9c8
> 
> Best regards,
Luca Weiss April 25, 2023, 6:48 a.m. UTC | #2
On Sat Apr 22, 2023 at 2:03 PM CEST, Konrad Dybcio wrote:
>
>
> On 21.04.2023 16:11, Luca Weiss wrote:
> > Just to start with the important part why this is an RFC:
> > 
> > While Bluetooth chip init works totally fine and bluez seems to be
> > fairly happy with it, there's a (major) problem with scanning, as shown
> > with this bluetoothctl snippet and dmesg snippet:
> > 
> >   [bluetooth]# scan on
> >   Failed to start discovery: org.bluez.Error.InProgress
> > 
> >   [  202.371374] Bluetooth: hci0: Opcode 0x200b failed: -16
> > 
> > This opcode should be the following:
> > 
> >   include/net/bluetooth/hci.h:#define HCI_OP_LE_SET_SCAN_PARAM    0x200b
> Not a bluetooth expert or anything, but does that thing support
> bluetooth LE?

I don't know too much about Bluetooth details either, but hasn't
Bluetooth LE been a consistently supported thing since like 10 years?

All the info I can easily find just states SM7225 SoC supports
"Bluetooth 5.1".

Regards
Luca

>
> Konrad
> > 
> > Unfortunately trying various existing code branches in the Bluetooth
> > driver doesn't show any sign of making this work and I don't really know
> > where to look to debug this further.
> > 
> > On the other hand "discoverable on" makes the device show up on other
> > devices during scanning , so the RF parts of the Bluetooth chip are
> > generally functional for sure.
> > 
> > Any ideas are welcome.
> > 
> > @Bjorn: Patch "arm64: dts: qcom: sm6350: add uart1 node" should be fine
> > to take regardless the RFC status, I don't think the problem is caused
> > there.
> > 
> > Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> > ---
> > Luca Weiss (4):
> >       dt-bindings: net: qualcomm: Add WCN3988
> >       Bluetooth: btqca: Add WCN3988 support
> >       arm64: dts: qcom: sm6350: add uart1 node
> >       arm64: dts: qcom: sm7225-fairphone-fp4: Add Bluetooth
> > 
> >  .../bindings/net/bluetooth/qualcomm-bluetooth.yaml |  2 +
> >  arch/arm64/boot/dts/qcom/sm6350.dtsi               | 63 ++++++++++++++++++++++
> >  arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 17 ++++++
> >  drivers/bluetooth/btqca.c                          | 13 ++++-
> >  drivers/bluetooth/btqca.h                          | 12 ++++-
> >  drivers/bluetooth/hci_qca.c                        | 12 +++++
> >  6 files changed, 115 insertions(+), 4 deletions(-)
> > ---
> > base-commit: cf4c0112a0350cfe8a63b5eb3377e2366f57545b
> > change-id: 20230421-fp4-bluetooth-b36a0e87b9c8
> > 
> > Best regards,