add support of interrupt for host wakeup from devicetree in BCM HCI driver
Subsystems (3)
v7 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 v6:
- depracate host-wakeup-gpios
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
.../devicetree/bindings/net/broadcom-bluetooth.txt | 7 +++++-- drivers/bluetooth/hci_bcm.c | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
PATCH v7 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.
--- .../devicetree/bindings/net/broadcom-bluetooth.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt +5 -2
@@ -23,7 +23,9 @@ Optional properties: - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt - shutdown-gpios: GPIO specifier, used to enable the BT module - device-wakeup-gpios: GPIO specifier, used to wakeup the controller - - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor + - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor. + deprecated, replaced by interrupts and + "host-wakeup" interrupt-names - clocks: 1 or 2 clocks as defined in clock-names below, in that order - clock-names: names for clock inputs, matching the clocks given - "extclk": deprecated, replaced by "txco"
@@ -37,7 +39,8 @@ 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 + - interrupt-names: must be "host-wakeup" Example:
Signature · 1 line
2.17.1
Re: [PATCH v7 1/2] dt-bindings: net: bluetooth: add interrupts properties
Quoted 9 lines · Guillaume La Roque
add interrupts and interrupt-names as optional properties to support host-wakeup by interrupt properties instead of host-wakeup-gpios.
Signed-off-by Guillaume La Roque <[email protected]>--- .../devicetree/bindings/net/broadcom-bluetooth.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
PATCH v7 2/2 bluetooth: hci_bcm: enable IRQ capability from devicetree
In reply to Guillaume La RoqueAdd 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
@@ -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
Marcel Holtmann
maintainerHi Guillaume,
Quoted 28 lines
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_irqfunction. so to have possibility to use interrupt mode we need to add interrupts field in devicetree and support it in driver.change sinve v6:
- depracate host-wakeup-gpioschange sinve v5:
- add tagschange sinve v4 [1]:
- add patch to update Documentation
- useof_irq_get_bynameto be more clear and move call inbcm_of_probe
- update commit messagechange since v3:
- move onof_irqinstead ofplatform_get_irqchange since v2:
- fix commit messagechange since v1:
- rebase patch[1] https://lore.kernel.org/linux-bluetooth/[email protected]/
Quoted 7 lines
Guillaume La Roque (2):
dt-bindings: net: bluetooth: add interrupts properties
bluetooth:hci_bcm: enable IRQ capability from devicetree
.../devicetree/bindings/net/broadcom-bluetooth.txt| 7 +++++--drivers/bluetooth/hci_bcm.c| 3 +++2 files changed, 8 insertions(+), 2 deletions(-)
both patches have been applied to bluetooth-next tree.
Regards
Marcel