All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/2] add support of interrupt for host wakeup from devicetree in BCM HCI driver
@ 2020-01-09 10:42 Guillaume La Roque
  2020-01-09 10:42 ` [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties Guillaume La Roque
  2020-01-09 10:42 ` [PATCH v6 2/2] bluetooth: hci_bcm: enable IRQ capability from devicetree Guillaume La Roque
  0 siblings, 2 replies; 7+ messages in thread
From: Guillaume La Roque @ 2020-01-09 10:42 UTC (permalink / raw)
  To: marcel, johan.hedberg, devicetree, linux-bluetooth
  Cc: johan, nsaenzjulienne, linux-kernel, khilman

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/20191213105521.4290-1-glaroque@baylibre.com/

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(-)

-- 
2.17.1


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

* [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties
  2020-01-09 10:42 [PATCH v6 0/2] add support of interrupt for host wakeup from devicetree in BCM HCI driver Guillaume La Roque
@ 2020-01-09 10:42 ` Guillaume La Roque
  2020-01-09 10:53   ` Johan Hovold
  2020-01-09 10:42 ` [PATCH v6 2/2] bluetooth: hci_bcm: enable IRQ capability from devicetree Guillaume La Roque
  1 sibling, 1 reply; 7+ messages in thread
From: Guillaume La Roque @ 2020-01-09 10:42 UTC (permalink / raw)
  To: marcel, johan.hedberg, devicetree, linux-bluetooth
  Cc: johan, nsaenzjulienne, linux-kernel, khilman

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 <glaroque@baylibre.com>
---
 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
index c44a30dbe43d..d33bbc998687 100644
--- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
+++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
@@ -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:
 
-- 
2.17.1


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

* [PATCH v6 2/2] bluetooth: hci_bcm: enable IRQ capability from devicetree
  2020-01-09 10:42 [PATCH v6 0/2] add support of interrupt for host wakeup from devicetree in BCM HCI driver Guillaume La Roque
  2020-01-09 10:42 ` [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties Guillaume La Roque
@ 2020-01-09 10:42 ` Guillaume La Roque
  1 sibling, 0 replies; 7+ messages in thread
From: Guillaume La Roque @ 2020-01-09 10:42 UTC (permalink / raw)
  To: marcel, johan.hedberg, devicetree, linux-bluetooth
  Cc: johan, nsaenzjulienne, linux-kernel, khilman

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

Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
 drivers/bluetooth/hci_bcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 769bb4404bd1..b236cb11c0dc 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -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;
 }
 
-- 
2.17.1


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

* Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties
  2020-01-09 10:42 ` [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties Guillaume La Roque
@ 2020-01-09 10:53   ` Johan Hovold
  2020-01-09 13:13     ` guillaume La Roque
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2020-01-09 10:53 UTC (permalink / raw)
  To: Guillaume La Roque, Rob Herring
  Cc: marcel, johan.hedberg, devicetree, linux-bluetooth, johan,
	nsaenzjulienne, linux-kernel, khilman

On Thu, Jan 09, 2020 at 11:42:56AM +0100, Guillaume La Roque wrote:
> 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 <glaroque@baylibre.com>
> ---
>  Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> index c44a30dbe43d..d33bbc998687 100644
> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> @@ -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

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

* Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties
  2020-01-09 10:53   ` Johan Hovold
@ 2020-01-09 13:13     ` guillaume La Roque
  2020-01-09 13:29       ` Johan Hovold
  0 siblings, 1 reply; 7+ messages in thread
From: guillaume La Roque @ 2020-01-09 13:13 UTC (permalink / raw)
  To: Johan Hovold, Rob Herring
  Cc: marcel, johan.hedberg, devicetree, linux-bluetooth,
	nsaenzjulienne, linux-kernel, khilman


On 1/9/20 11:53 AM, Johan Hovold wrote:
> On Thu, Jan 09, 2020 at 11:42:56AM +0100, Guillaume La Roque wrote:
>> 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 <glaroque@baylibre.com>
>> ---
>>  Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
>> index c44a30dbe43d..d33bbc998687 100644
>> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
>> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
>> @@ -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

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?



> Johan

Regards

Guillaume


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

* Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties
  2020-01-09 13:13     ` guillaume La Roque
@ 2020-01-09 13:29       ` Johan Hovold
  2020-01-13 22:37         ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2020-01-09 13:29 UTC (permalink / raw)
  To: guillaume La Roque
  Cc: Johan Hovold, Rob Herring, marcel, johan.hedberg, devicetree,
	linux-bluetooth, nsaenzjulienne, linux-kernel, khilman

On Thu, Jan 09, 2020 at 02:13:23PM +0100, guillaume La Roque wrote:
> 
> On 1/9/20 11:53 AM, Johan Hovold wrote:
> > On Thu, Jan 09, 2020 at 11:42:56AM +0100, Guillaume La Roque wrote:
> >> 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 <glaroque@baylibre.com>
> >> ---
> >>  Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> >> index c44a30dbe43d..d33bbc998687 100644
> >> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> >> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> >> @@ -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
> 
> 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. ;)

> 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

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

* Re: [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties
  2020-01-09 13:29       ` Johan Hovold
@ 2020-01-13 22:37         ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2020-01-13 22:37 UTC (permalink / raw)
  To: Johan Hovold
  Cc: guillaume La Roque, marcel, johan.hedberg, devicetree,
	linux-bluetooth, nsaenzjulienne, linux-kernel, khilman

On Thu, Jan 09, 2020 at 02:29:17PM +0100, Johan Hovold wrote:
> On Thu, Jan 09, 2020 at 02:13:23PM +0100, guillaume La Roque wrote:
> > 
> > On 1/9/20 11:53 AM, Johan Hovold wrote:
> > > On Thu, Jan 09, 2020 at 11:42:56AM +0100, Guillaume La Roque wrote:
> > >> 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 <glaroque@baylibre.com>
> > >> ---
> > >>  Documentation/devicetree/bindings/net/broadcom-bluetooth.txt | 4 +++-
> > >>  1 file changed, 3 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> > >> index c44a30dbe43d..d33bbc998687 100644
> > >> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> > >> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt
> > >> @@ -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
> > 
> > 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. ;)
> 
> > 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

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

end of thread, other threads:[~2020-01-13 22:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 10:42 [PATCH v6 0/2] add support of interrupt for host wakeup from devicetree in BCM HCI driver Guillaume La Roque
2020-01-09 10:42 ` [PATCH v6 1/2] dt-bindings: net: bluetooth: add interrupts properties Guillaume La Roque
2020-01-09 10:53   ` Johan Hovold
2020-01-09 13:13     ` guillaume La Roque
2020-01-09 13:29       ` Johan Hovold
2020-01-13 22:37         ` Rob Herring
2020-01-09 10:42 ` [PATCH v6 2/2] bluetooth: hci_bcm: enable IRQ capability from devicetree Guillaume La Roque

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.