diff mbox series

[v2,1/5] dt-bindings: input: Add common input binding in json-schema

Message ID 1569940180-11417-2-git-send-email-michal.vokac@ysoft.com (mailing list archive)
State Superseded
Headers show
Series Add polling mode to the MPR121 touchkey | expand

Commit Message

Michal Vokáč Oct. 1, 2019, 2:29 p.m. UTC
Create schema for the common input properties.

Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
Changes since v1:
 - New patch in the series.

Rob, you suggested to extract the common properties from
fsl,mpr121-touchkey.yaml into this file. In the meantime I realized that
the linux,keycodes property is already documented in keys.txt.

What do you suggest to do? Some possible options:
 - Just remove the linux,keycodes propery from keys.txt.
 - Merge this input.yaml with all content of keys.txt. How to name the result?
 - Something else?

 Documentation/devicetree/bindings/input/input.yaml | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/input.yaml

Comments

Rob Herring Oct. 1, 2019, 3:03 p.m. UTC | #1
On Tue, Oct 1, 2019 at 9:29 AM Michal Vokáč <michal.vokac@ysoft.com> wrote:
>
> Create schema for the common input properties.
>
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---
> Changes since v1:
>  - New patch in the series.
>
> Rob, you suggested to extract the common properties from
> fsl,mpr121-touchkey.yaml into this file. In the meantime I realized that
> the linux,keycodes property is already documented in keys.txt.
>
> What do you suggest to do? Some possible options:
>  - Just remove the linux,keycodes propery from keys.txt.
>  - Merge this input.yaml with all content of keys.txt. How to name the result?

Yes. input.yaml is fine. Looks like there's only 3 references to
keys.txt to update.

>  - Something else?
>
>  Documentation/devicetree/bindings/input/input.yaml | 25 ++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/input.yaml
>
> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
> new file mode 100644
> index 000000000000..494e7d031ea3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/input.yaml
> @@ -0,0 +1,25 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/input.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common input schema binding
> +
> +maintainers:
> +  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
> +
> +properties:
> +  linux,keycodes:
> +    description:
> +      Specifies an array of numeric keycode values to be used for reporting
> +      button presses. The array can contain up to 12 entries.

12 is specific to your device.

> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32-array
> +      - items:
> +          minimum: 0
> +          maximum: 0xff
> +
> +  autorepeat:
> +    description: Enable autorepeat when key is pressed and held down.
> +    type: boolean
> --
> 2.1.4
>
Michal Vokáč Oct. 2, 2019, 6:17 a.m. UTC | #2
On 01. 10. 19 17:03, Rob Herring wrote:
> On Tue, Oct 1, 2019 at 9:29 AM Michal Vokáč <michal.vokac@ysoft.com> wrote:
>>
>> Create schema for the common input properties.
>>
>> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
>> ---
>> Changes since v1:
>>   - New patch in the series.
>>
>> Rob, you suggested to extract the common properties from
>> fsl,mpr121-touchkey.yaml into this file. In the meantime I realized that
>> the linux,keycodes property is already documented in keys.txt.
>>
>> What do you suggest to do? Some possible options:
>>   - Just remove the linux,keycodes propery from keys.txt.
>>   - Merge this input.yaml with all content of keys.txt. How to name the result?
> 
> Yes. input.yaml is fine. Looks like there's only 3 references to
> keys.txt to update.

OK.
Thanks for mentioning the references, I would surely forget to update those.

>>   - Something else?
>>
>>   Documentation/devicetree/bindings/input/input.yaml | 25 ++++++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/input/input.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
>> new file mode 100644
>> index 000000000000..494e7d031ea3
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/input/input.yaml
>> @@ -0,0 +1,25 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/input/input.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Common input schema binding
>> +
>> +maintainers:
>> +  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> +
>> +properties:
>> +  linux,keycodes:
>> +    description:
>> +      Specifies an array of numeric keycode values to be used for reporting
>> +      button presses. The array can contain up to 12 entries.
> 
> 12 is specific to your device.

Sure, I will remove this.
I also had question in patch 2/5 regarding the additional minItems and
maxItems constrains. I tried various methods to add the constrains but
all fail to pass the validation with the same error message.

Thanks a lot,
Michal

>> +    allOf:
>> +      - $ref: /schemas/types.yaml#/definitions/uint32-array
>> +      - items:
>> +          minimum: 0
>> +          maximum: 0xff
>> +
>> +  autorepeat:
>> +    description: Enable autorepeat when key is pressed and held down.
>> +    type: boolean
>> --
>> 2.1.4
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
new file mode 100644
index 000000000000..494e7d031ea3
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -0,0 +1,25 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/input.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common input schema binding
+
+maintainers:
+  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+properties:
+  linux,keycodes:
+    description:
+      Specifies an array of numeric keycode values to be used for reporting
+      button presses. The array can contain up to 12 entries.
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32-array
+      - items:
+          minimum: 0
+          maximum: 0xff
+
+  autorepeat:
+    description: Enable autorepeat when key is pressed and held down.
+    type: boolean