2022-07-05 13:21:17

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

Hi Rob,

Can you apply these directly? You already reviewed them, but I dropped
the tag so you will see them in Patchwork. It seems these won't go in
through input [1].

[1] https://lore.kernel.org/all/[email protected]/

Best regards,
Krzysztof


Krzysztof Kozlowski (3):
dt-bindings: input: gpio-keys: enforce node names to match all
properties
dt-bindings: input: gpio-keys: reference input.yaml and document
properties
dt-bindings: input: gpio-keys: accept also interrupt-extended

.../devicetree/bindings/input/gpio-keys.yaml | 159 +++++++++---------
1 file changed, 82 insertions(+), 77 deletions(-)

--
2.34.1


2022-07-05 13:24:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties

The gpio-keys DT schema matches all properties with a wide pattern and
applies specific schema to children. This has drawback - all regular
properties are also matched and are silently ignored, even if they are
not described in schema. Basically this allows any non-object property
to be present.

Enforce specific naming pattern for children (keys) to narrow the
pattern thus do not match other properties. This will require all
children to be properly prefixed or suffixed (button, event, switch or
key).

Removal of "if:" within patternProperties causes drop of one indentation
level, but there are no other changes in the affected block.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/input/gpio-keys.yaml | 157 +++++++++---------
1 file changed, 77 insertions(+), 80 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index 645dfa1e0d07..27bb5c6ab8d9 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -16,86 +16,83 @@ properties:
- gpio-keys-polled

patternProperties:
- ".*":
- if:
- type: object
- then:
- $ref: input.yaml#
-
- properties:
- gpios:
- maxItems: 1
-
- interrupts:
- maxItems: 1
-
- label:
- description: Descriptive name of the key.
-
- linux,code:
- description: Key / Axis code to emit.
-
- linux,input-type:
- default: 1 # EV_KEY
-
- linux,input-value:
- description: |
- If linux,input-type is EV_ABS or EV_REL then this
- value is sent for events this button generates when pressed.
- EV_ABS/EV_REL axis will generate an event with a value of 0
- when all buttons with linux,input-type == type and
- linux,code == axis are released. This value is interpreted
- as a signed 32 bit value, e.g. to make a button generate a
- value of -1 use:
-
- linux,input-value = <0xffffffff>; /* -1 */
-
- $ref: /schemas/types.yaml#/definitions/uint32
-
- debounce-interval:
- description:
- Debouncing interval time in milliseconds. If not specified defaults to 5.
- $ref: /schemas/types.yaml#/definitions/uint32
-
- default: 5
-
- wakeup-source:
- description: Button can wake-up the system.
-
- wakeup-event-action:
- description: |
- Specifies whether the key should wake the system when asserted, when
- deasserted, or both. This property is only valid for keys that wake up the
- system (e.g., when the "wakeup-source" property is also provided).
-
- Supported values are defined in linux-event-codes.h:
-
- EV_ACT_ANY - both asserted and deasserted
- EV_ACT_ASSERTED - asserted
- EV_ACT_DEASSERTED - deasserted
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2]
-
- linux,can-disable:
- description:
- Indicates that button is connected to dedicated (not shared) interrupt
- which can be disabled to suppress events from the button.
- type: boolean
-
- required:
- - linux,code
-
- anyOf:
- - required:
- - interrupts
- - required:
- - gpios
-
- dependencies:
- wakeup-event-action: [ wakeup-source ]
- linux,input-value: [ gpios ]
-
- unevaluatedProperties: false
+ "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
+ $ref: input.yaml#
+
+ properties:
+ gpios:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ label:
+ description: Descriptive name of the key.
+
+ linux,code:
+ description: Key / Axis code to emit.
+
+ linux,input-type:
+ default: 1 # EV_KEY
+
+ linux,input-value:
+ description: |
+ If linux,input-type is EV_ABS or EV_REL then this
+ value is sent for events this button generates when pressed.
+ EV_ABS/EV_REL axis will generate an event with a value of 0
+ when all buttons with linux,input-type == type and
+ linux,code == axis are released. This value is interpreted
+ as a signed 32 bit value, e.g. to make a button generate a
+ value of -1 use:
+
+ linux,input-value = <0xffffffff>; /* -1 */
+
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ debounce-interval:
+ description:
+ Debouncing interval time in milliseconds. If not specified defaults to 5.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ default: 5
+
+ wakeup-source:
+ description: Button can wake-up the system.
+
+ wakeup-event-action:
+ description: |
+ Specifies whether the key should wake the system when asserted, when
+ deasserted, or both. This property is only valid for keys that wake up the
+ system (e.g., when the "wakeup-source" property is also provided).
+
+ Supported values are defined in linux-event-codes.h:
+
+ EV_ACT_ANY - both asserted and deasserted
+ EV_ACT_ASSERTED - asserted
+ EV_ACT_DEASSERTED - deasserted
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1, 2]
+
+ linux,can-disable:
+ description:
+ Indicates that button is connected to dedicated (not shared) interrupt
+ which can be disabled to suppress events from the button.
+ type: boolean
+
+ required:
+ - linux,code
+
+ anyOf:
+ - required:
+ - interrupts
+ - required:
+ - gpios
+
+ dependencies:
+ wakeup-event-action: [ wakeup-source ]
+ linux,input-value: [ gpios ]
+
+ unevaluatedProperties: false

if:
properties:
--
2.34.1

2022-07-05 19:23:18

by Rob Herring

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
<[email protected]> wrote:
>
> Hi Rob,
>
> Can you apply these directly? You already reviewed them, but I dropped
> the tag so you will see them in Patchwork. It seems these won't go in
> through input [1].
>
> [1] https://lore.kernel.org/all/[email protected]/

Will give Dmitry a few more days first before I take both series.

Rob

2022-07-06 06:41:35

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

On 05/07/2022 21:11, Rob Herring wrote:
> On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
> <[email protected]> wrote:
>>
>> Hi Rob,
>>
>> Can you apply these directly? You already reviewed them, but I dropped
>> the tag so you will see them in Patchwork. It seems these won't go in
>> through input [1].
>>
>> [1] https://lore.kernel.org/all/[email protected]/
>
> Will give Dmitry a few more days first before I take both series.

Then let's keep your Rb for entire patchset:

Reviewed-by: Rob Herring <[email protected]>


Best regards,
Krzysztof

2022-07-08 21:30:55

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

Hi,

On Wed, Jul 06, 2022 at 08:30:54AM +0200, Krzysztof Kozlowski wrote:
> On 05/07/2022 21:11, Rob Herring wrote:
> > On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
> > <[email protected]> wrote:
> >>
> >> Hi Rob,
> >>
> >> Can you apply these directly? You already reviewed them, but I dropped
> >> the tag so you will see them in Patchwork. It seems these won't go in
> >> through input [1].
> >>
> >> [1] https://lore.kernel.org/all/[email protected]/
> >
> > Will give Dmitry a few more days first before I take both series.
>
> Then let's keep your Rb for entire patchset:
>
> Reviewed-by: Rob Herring <[email protected]>

I am sorry but what series/branch this series is based on? I tried
applying but there are conflicts. The latest I have that is touching
gpio-keys.yaml is:

4fda8a2df83a dt-bindings: input: use generic node names

Thanks.

--
Dmitry

2022-07-08 22:07:12

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

On Fri, Jul 08, 2022 at 01:35:43PM -0700, Dmitry Torokhov wrote:
> Hi,
>
> On Wed, Jul 06, 2022 at 08:30:54AM +0200, Krzysztof Kozlowski wrote:
> > On 05/07/2022 21:11, Rob Herring wrote:
> > > On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
> > > <[email protected]> wrote:
> > >>
> > >> Hi Rob,
> > >>
> > >> Can you apply these directly? You already reviewed them, but I dropped
> > >> the tag so you will see them in Patchwork. It seems these won't go in
> > >> through input [1].
> > >>
> > >> [1] https://lore.kernel.org/all/[email protected]/
> > >
> > > Will give Dmitry a few more days first before I take both series.
> >
> > Then let's keep your Rb for entire patchset:
> >
> > Reviewed-by: Rob Herring <[email protected]>
>
> I am sorry but what series/branch this series is based on? I tried
> applying but there are conflicts. The latest I have that is touching
> gpio-keys.yaml is:
>
> 4fda8a2df83a dt-bindings: input: use generic node names

This one from me:

https://lore.kernel.org/all/[email protected]/

2022-07-08 23:01:37

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

On Fri, Jul 08, 2022 at 04:05:07PM -0600, Rob Herring wrote:
> On Fri, Jul 08, 2022 at 01:35:43PM -0700, Dmitry Torokhov wrote:
> > Hi,
> >
> > On Wed, Jul 06, 2022 at 08:30:54AM +0200, Krzysztof Kozlowski wrote:
> > > On 05/07/2022 21:11, Rob Herring wrote:
> > > > On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
> > > > <[email protected]> wrote:
> > > >>
> > > >> Hi Rob,
> > > >>
> > > >> Can you apply these directly? You already reviewed them, but I dropped
> > > >> the tag so you will see them in Patchwork. It seems these won't go in
> > > >> through input [1].
> > > >>
> > > >> [1] https://lore.kernel.org/all/[email protected]/
> > > >
> > > > Will give Dmitry a few more days first before I take both series.
> > >
> > > Then let's keep your Rb for entire patchset:
> > >
> > > Reviewed-by: Rob Herring <[email protected]>
> >
> > I am sorry but what series/branch this series is based on? I tried
> > applying but there are conflicts. The latest I have that is touching
> > gpio-keys.yaml is:
> >
> > 4fda8a2df83a dt-bindings: input: use generic node names
>
> This one from me:
>
> https://lore.kernel.org/all/[email protected]/

Ah, I see, thank you. Applied the lot.


--
Dmitry

2022-07-12 07:41:00

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree

On 09/07/2022 00:23, Dmitry Torokhov wrote:
>>> I am sorry but what series/branch this series is based on? I tried
>>> applying but there are conflicts. The latest I have that is touching
>>> gpio-keys.yaml is:
>>>
>>> 4fda8a2df83a dt-bindings: input: use generic node names
>>
>> This one from me:
>>
>> https://lore.kernel.org/all/[email protected]/
>
> Ah, I see, thank you. Applied the lot.

Great! Thank you.

Best regards,
Krzysztof