2020-01-09 11:44:06

by Guillaume LA ROQUE

[permalink] [raw]
Subject: [PATCH v6 0/2] 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(-)

--
2.17.1


2020-01-09 11:44:21

by Guillaume LA ROQUE

[permalink] [raw]
Subject: [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.

Signed-off-by: Guillaume La Roque <[email protected]>
---
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

2020-01-09 12:34:50

by Johan Hovold

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

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 <[email protected]>
> ---
> 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

2020-01-09 13:31:11

by Guillaume LA ROQUE

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


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 <[email protected]>
>> ---
>> 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

2020-01-09 13:39:46

by Johan Hovold

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

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 <[email protected]>
> >> ---
> >> 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

2020-01-13 22:38:27

by Rob Herring (Arm)

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

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 <[email protected]>
> > >> ---
> > >> 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