Skip to contentSkip to conversation

add support of interrupt for host wakeup from devicetree in BCM HCI driver

PATCH Superseded Guillaume La Roque 3 participants 7 messages Jan 9, 2020 – Jan 13, 2020

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover add support of interrupt for host wakeup from devicetree in BCM HCI driver

add interrupts and interrupt-names properties to set host wakeup IRQ. actually driver find this IRQ from host-wakeup-gpios propety but some platforms are not supported gpiod_to_irq function. so to have possibility to use interrupt mode we need to add interrupts field in devicetree and support it in driver.

change sinve v5:
- add tags

change sinve v4 [1]:
- add patch to update Documentation
- use of_irq_get_byname to be more clear and move call in bcm_of_probe
- update commit message

change since v3:
- move on of_irq instead of platform_get_irq

change since v2:
- fix commit message

change since v1:
- rebase patch

[1] https://lore.kernel.org/linux-bluetooth/[email protected]/

Guillaume La Roque (2):
dt-bindings: net: bluetooth: add interrupts properties
bluetooth: hci_bcm: enable IRQ capability from devicetree

 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 drivers/bluetooth/hci_bcm.c                                  | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v6 1/2 dt-bindings: net: bluetooth: add interrupts properties

add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +3 -1
index c44a30dbe43d..d33bbc998687 100644
@@ -37,7 +37,9 @@ Optional properties:
     - pcm-frame-type: short, long
     - pcm-sync-mode: slave, master
     - pcm-clock-mode: slave, master
-
+ - interrupts: must be one, used to wakeup the host processor if
+   gpiod_to_irq function not supported
+ - interrupt-names: must be "host-wakeup"
 
 Example:
 
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties

Quoted 14 lines · Guillaume La Roque

add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +0 -0
index c44a30dbe43d..d33bbc998687 100644

Documentation/devicetree/bindings/net/broadcom-bluetooth.txt Optional properties: · line 42

Quoted 7 lines
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +3 -1
@@ -37,7 +37,9 @@ Optional properties:
     - pcm-frame-type: short, long
     - pcm-sync-mode: slave, master
     - pcm-clock-mode: slave, master
-
+ - interrupts: must be one, used to wakeup the host processor if
+   gpiod_to_irq function not supported
+ - interrupt-names: must be "host-wakeup"

Looks like you forgot to address Rob's comment. If I understood him correctly you either need to stick with "host-wakeup-gpios" (and fix your platform) or deprecate it in favour of "interrupts":

	https://lkml.kernel.org/r/20191218203818.GA8009@bogus

Johan

#3 lore raw

Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties

Quoted 26 lines · Johan Hovold
Quoted 14 lines · Guillaume La Roque

add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +0 -0
index c44a30dbe43d..d33bbc998687 100644

Documentation/devicetree/bindings/net/broadcom-bluetooth.txt Optional properties: · line 42

Quoted 7 lines
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +3 -1
@@ -37,7 +37,9 @@ Optional properties:
     - pcm-frame-type: short, long
     - pcm-sync-mode: slave, master
     - pcm-clock-mode: slave, master
-
+ - interrupts: must be one, used to wakeup the host processor if
+   gpiod_to_irq function not supported
+ - interrupt-names: must be "host-wakeup"

Looks like you forgot to address Rob's comment. If I understood him correctly you either need to stick with "host-wakeup-gpios" (and fix your platform) or deprecate it in favour of "interrupts":

Quoted 1 line
	https://lkml.kernel.org/r/20191218203818.GA8009@bogus

not forgot marcel ask me a v6

for rob comment ok but it's not possible to support gpiod_to_irq on my platform.

if i deprecated it i need to update all DT with good interrupt number right?

Quoted 1 line

Johan

Regards

Guillaume

#4 lore raw

Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties

Quoted 28 lines · guillaume La Roque
Quoted 26 lines · Johan Hovold
Quoted 14 lines · Guillaume La Roque

add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +0 -0
index c44a30dbe43d..d33bbc998687 100644

Documentation/devicetree/bindings/net/broadcom-bluetooth.txt Optional properties: · line 42

Quoted 7 lines
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +3 -1
@@ -37,7 +37,9 @@ Optional properties:
     - pcm-frame-type: short, long
     - pcm-sync-mode: slave, master
     - pcm-clock-mode: slave, master
-
+ - interrupts: must be one, used to wakeup the host processor if
+   gpiod_to_irq function not supported
+ - interrupt-names: must be "host-wakeup"

Looks like you forgot to address Rob's comment. If I understood him correctly you either need to stick with "host-wakeup-gpios" (and fix your platform) or deprecate it in favour of "interrupts":

Quoted 3 lines
Quoted 1 line
	https://lkml.kernel.org/r/20191218203818.GA8009@bogus

not forgot marcel ask me a v6

Not much point in sending v6 before addressing feedback on v5. Especially as Marcel asked for a v6 with acks. ;)

Quoted 5 lines

for rob comment ok but it's not possible to support gpiod_to_irq on my platform.

if i deprecated it i need to update all DT with good interrupt number right?

Not sure. Perhaps just updating the binding is enough. Rob?

Johan

maintainer
#5 lore raw

Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties

Quoted 36 lines · Johan Hovold
Quoted 28 lines · guillaume La Roque
Quoted 26 lines · Johan Hovold
Quoted 14 lines · Guillaume La Roque

add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.

---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +0 -0
index c44a30dbe43d..d33bbc998687 100644

Documentation/devicetree/bindings/net/broadcom-bluetooth.txt Optional properties: · line 42

Quoted 7 lines
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +3 -1
@@ -37,7 +37,9 @@ Optional properties:
     - pcm-frame-type: short, long
     - pcm-sync-mode: slave, master
     - pcm-clock-mode: slave, master
-
+ - interrupts: must be one, used to wakeup the host processor if
+   gpiod_to_irq function not supported
+ - interrupt-names: must be "host-wakeup"

Looks like you forgot to address Rob's comment. If I understood him correctly you either need to stick with "host-wakeup-gpios" (and fix your platform) or deprecate it in favour of "interrupts":

Quoted 3 lines
Quoted 1 line
	https://lkml.kernel.org/r/20191218203818.GA8009@bogus

not forgot marcel ask me a v6

Not much point in sending v6 before addressing feedback on v5. Especially as Marcel asked for a v6 with acks. ;)

Quoted 7 lines
Quoted 5 lines

for rob comment ok but it's not possible to support gpiod_to_irq on my platform.

if i deprecated it i need to update all DT with good interrupt number right?

Not sure. Perhaps just updating the binding is enough. Rob?

Correct. Just need to reflect in the binding which way is preferred. If it's a case of update all the dts files, then we often just don't document the old way.

Rob

#6 lore raw

PATCH v6 2/2 bluetooth: hci_bcm: enable IRQ capability from devicetree

In reply to Guillaume La Roque

Add support for getting IRQ directly from DT instead of relying on converting a GPIO to IRQ. This is needed for platforms with GPIO controllers that that do not support gpiod_to_irq().

---
 drivers/bluetooth/hci_bcm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/bluetooth/hci_bcm.c +3 -0
index 769bb4404bd1..b236cb11c0dc 100644
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/acpi.h>
 #include <linux/of.h>
+#include <linux/of_irq.h>
 #include <linux/property.h>
 #include <linux/platform_data/x86/apple.h>
 #include <linux/platform_device.h>
@@ -1151,6 +1152,8 @@ static int bcm_of_probe(struct bcm_device *bdev)
 	device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed);
 	device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params",
 				      bdev->pcm_int_params, 5);
+	bdev->irq = of_irq_get_byname(bdev->dev->of_node, "host-wakeup");
+
 	return 0;
 }
 
Signature · 1 line
2.17.1