All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btqca: Add valid le states quirk
@ 2020-09-30 20:01 Abhishek Pandit-Subedi
  2020-10-01  7:03 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Abhishek Pandit-Subedi @ 2020-09-30 20:01 UTC (permalink / raw)
  To: marcel
  Cc: chromeos-bluetooth-upstreaming, linux-bluetooth,
	Abhishek Pandit-Subedi, Johan Hedberg, linux-kernel

WCN3991 supports connectable advertisements so we need to add the valid
le states quirk so the 'central-peripheral' role is exposed in
userspace.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---
Example result showing the central-peripheral role correctly.

localhost # bluetoothctl show
Controller 3C:28:6D:4F:A0:1F (public)
        Name: BlueZ 5.54
        Alias: Chromebook_63FC
        Class: 0x00480000
        Powered: yes
        Discoverable: no
        DiscoverableTimeout: 0x000000b4
        Pairable: yes
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        Modalias: bluetooth:v00E0pC405d0057
        Discovering: no
        Roles: central
        Roles: peripheral
        Roles: central-peripheral

 drivers/bluetooth/hci_qca.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 244b8feba52327..2d3f1f179a1e3d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -78,6 +78,7 @@ enum qca_flags {
 
 enum qca_capabilities {
 	QCA_CAP_WIDEBAND_SPEECH = BIT(0),
+	QCA_CAP_VALID_LE_STATES = BIT(1),
 };
 
 /* HCI_IBS transmit side sleep protocol states */
@@ -1780,7 +1781,7 @@ static const struct qca_device_data qca_soc_data_wcn3991 = {
 		{ "vddch0", 450000 },
 	},
 	.num_vregs = 4,
-	.capabilities = QCA_CAP_WIDEBAND_SPEECH,
+	.capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES,
 };
 
 static const struct qca_device_data qca_soc_data_wcn3998 = {
@@ -2017,11 +2018,17 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 		hdev->shutdown = qca_power_off;
 	}
 
-	/* Wideband speech support must be set per driver since it can't be
-	 * queried via hci.
-	 */
-	if (data && (data->capabilities & QCA_CAP_WIDEBAND_SPEECH))
-		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
+	if (data) {
+		/* Wideband speech support must be set per driver since it can't
+		 * be queried via hci. Same with the valid le states quirk.
+		 */
+		if (data->capabilities & QCA_CAP_WIDEBAND_SPEECH)
+			set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
+				&hdev->quirks);
+
+		if (data->capabilities & QCA_CAP_VALID_LE_STATES)
+			set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
+	}
 
 	return 0;
 }
-- 
2.28.0.709.gb0816b6eb0-goog


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

* Re: [PATCH] Bluetooth: btqca: Add valid le states quirk
  2020-09-30 20:01 [PATCH] Bluetooth: btqca: Add valid le states quirk Abhishek Pandit-Subedi
@ 2020-10-01  7:03 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2020-10-01  7:03 UTC (permalink / raw)
  To: Abhishek Pandit-Subedi
  Cc: CrosBT Upstreaming, linux-bluetooth, Johan Hedberg, linux-kernel

Hi Abhishek,

> WCN3991 supports connectable advertisements so we need to add the valid
> le states quirk so the 'central-peripheral' role is exposed in
> userspace.
> 
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> ---
> Example result showing the central-peripheral role correctly.
> 
> localhost # bluetoothctl show
> Controller 3C:28:6D:4F:A0:1F (public)
>        Name: BlueZ 5.54
>        Alias: Chromebook_63FC
>        Class: 0x00480000
>        Powered: yes
>        Discoverable: no
>        DiscoverableTimeout: 0x000000b4
>        Pairable: yes
>        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
>        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
>        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
>        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
>        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
>        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
>        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
>        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
>        Modalias: bluetooth:v00E0pC405d0057
>        Discovering: no
>        Roles: central
>        Roles: peripheral
>        Roles: central-peripheral
> 
> drivers/bluetooth/hci_qca.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2020-10-01  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 20:01 [PATCH] Bluetooth: btqca: Add valid le states quirk Abhishek Pandit-Subedi
2020-10-01  7:03 ` Marcel Holtmann

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.