* [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
@ 2022-07-05 12:03 Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-05 12:03 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, linux-input,
devicetree, linux-kernel
Cc: Krzysztof Kozlowski
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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties
2022-07-05 12:03 [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Krzysztof Kozlowski
@ 2022-07-05 12:03 ` Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 2/3] dt-bindings: input: gpio-keys: reference input.yaml and document properties Krzysztof Kozlowski
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-05 12:03 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, linux-input,
devicetree, linux-kernel
Cc: Krzysztof Kozlowski
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 <krzysztof.kozlowski@linaro.org>
---
.../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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RESEND PATCH v3 2/3] dt-bindings: input: gpio-keys: reference input.yaml and document properties
2022-07-05 12:03 [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties Krzysztof Kozlowski
@ 2022-07-05 12:03 ` Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 3/3] dt-bindings: input: gpio-keys: accept also interrupt-extended Krzysztof Kozlowski
2022-07-05 19:11 ` [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Rob Herring
3 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-05 12:03 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, linux-input,
devicetree, linux-kernel
Cc: Krzysztof Kozlowski
The original text bindings documented "autorepeat" and "label"
properties (in the device node, beside the nodes with keys). DTS use
also poll-interval. Reference the input.yaml to get these top-level
properties.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../devicetree/bindings/input/gpio-keys.yaml | 32 +++++++++++--------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index 27bb5c6ab8d9..e722e681d237 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -15,6 +15,13 @@ properties:
- gpio-keys
- gpio-keys-polled
+ autorepeat: true
+
+ label:
+ description: Name of entire device
+
+ poll-interval: true
+
patternProperties:
"^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
$ref: input.yaml#
@@ -94,19 +101,18 @@ patternProperties:
unevaluatedProperties: false
-if:
- properties:
- compatible:
- const: gpio-keys-polled
-then:
- properties:
- poll-interval:
- description:
- Poll interval time in milliseconds
- $ref: /schemas/types.yaml#/definitions/uint32
-
- required:
- - poll-interval
+allOf:
+ - $ref: input.yaml#
+ - if:
+ properties:
+ compatible:
+ const: gpio-keys-polled
+ then:
+ required:
+ - poll-interval
+ else:
+ properties:
+ poll-interval: false
additionalProperties: false
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [RESEND PATCH v3 3/3] dt-bindings: input: gpio-keys: accept also interrupt-extended
2022-07-05 12:03 [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 2/3] dt-bindings: input: gpio-keys: reference input.yaml and document properties Krzysztof Kozlowski
@ 2022-07-05 12:03 ` Krzysztof Kozlowski
2022-07-05 19:11 ` [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Rob Herring
3 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-05 12:03 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, linux-input,
devicetree, linux-kernel
Cc: Krzysztof Kozlowski
Each key device node might have interrupts-extended instead of
interrupts property:
fsl-ls1028a-kontron-sl28-var1.dtb: buttons0: power-button: 'anyOf' conditional failed, one must be fixed:
'interrupts' is a required property
'gpios' is a required property
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/input/gpio-keys.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
index e722e681d237..17ac9dff7972 100644
--- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
+++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
@@ -92,6 +92,8 @@ patternProperties:
anyOf:
- required:
- interrupts
+ - required:
+ - interrupts-extended
- required:
- gpios
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-05 12:03 [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Krzysztof Kozlowski
` (2 preceding siblings ...)
2022-07-05 12:03 ` [RESEND PATCH v3 3/3] dt-bindings: input: gpio-keys: accept also interrupt-extended Krzysztof Kozlowski
@ 2022-07-05 19:11 ` Rob Herring
2022-07-06 6:30 ` Krzysztof Kozlowski
3 siblings, 1 reply; 10+ messages in thread
From: Rob Herring @ 2022-07-05 19:11 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Dmitry Torokhov, Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> 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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
Will give Dmitry a few more days first before I take both series.
Rob
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-05 19:11 ` [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Rob Herring
@ 2022-07-06 6:30 ` Krzysztof Kozlowski
2022-07-08 20:35 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-06 6:30 UTC (permalink / raw)
To: Rob Herring
Cc: Dmitry Torokhov, Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
On 05/07/2022 21:11, Rob Herring wrote:
> On Tue, Jul 5, 2022 at 6:04 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> 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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
>
> 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 <robh@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-06 6:30 ` Krzysztof Kozlowski
@ 2022-07-08 20:35 ` Dmitry Torokhov
2022-07-08 22:05 ` Rob Herring
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2022-07-08 20:35 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rob Herring, Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
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
> > <krzysztof.kozlowski@linaro.org> 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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
> >
> > 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 <robh@kernel.org>
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-08 20:35 ` Dmitry Torokhov
@ 2022-07-08 22:05 ` Rob Herring
2022-07-08 22:23 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Rob Herring @ 2022-07-08 22:05 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Krzysztof Kozlowski, Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
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
> > > <krzysztof.kozlowski@linaro.org> 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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
> > >
> > > 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 <robh@kernel.org>
>
> 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/20220608211207.2058487-1-robh@kernel.org/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-08 22:05 ` Rob Herring
@ 2022-07-08 22:23 ` Dmitry Torokhov
2022-07-12 7:11 ` Krzysztof Kozlowski
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2022-07-08 22:23 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
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
> > > > <krzysztof.kozlowski@linaro.org> 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/c2c1cf0c-9462-9ba5-a297-70d13a063de1@linaro.org/
> > > >
> > > > 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 <robh@kernel.org>
> >
> > 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/20220608211207.2058487-1-robh@kernel.org/
Ah, I see, thank you. Applied the lot.
--
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree
2022-07-08 22:23 ` Dmitry Torokhov
@ 2022-07-12 7:11 ` Krzysztof Kozlowski
0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12 7:11 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring
Cc: Krzysztof Kozlowski, Linux Input, devicetree,
linux-kernel@vger.kernel.org
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/20220608211207.2058487-1-robh@kernel.org/
>
> Ah, I see, thank you. Applied the lot.
Great! Thank you.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-07-12 7:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 12:03 [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 1/3] dt-bindings: input: gpio-keys: enforce node names to match all properties Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 2/3] dt-bindings: input: gpio-keys: reference input.yaml and document properties Krzysztof Kozlowski
2022-07-05 12:03 ` [RESEND PATCH v3 3/3] dt-bindings: input: gpio-keys: accept also interrupt-extended Krzysztof Kozlowski
2022-07-05 19:11 ` [RESEND PATCH v3 0/3] dt-bindings: input: gpio-keys: apply via DT tree Rob Herring
2022-07-06 6:30 ` Krzysztof Kozlowski
2022-07-08 20:35 ` Dmitry Torokhov
2022-07-08 22:05 ` Rob Herring
2022-07-08 22:23 ` Dmitry Torokhov
2022-07-12 7:11 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).