Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
flat view
From: Rob Herring <robh@kernel.org>
Date: 2019-10-10 19:40:40
On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
quoted hunk ↗ jump to hunk
Add an option to periodicaly poll the device to get state of the inputs as the interrupt line may not be used on some platforms. Signed-off-by: Michal Vokáč <redacted> --- Changes since v2: - None Changes since v1: - Use poll-interval instead of linux,poll-interval. - Place the poll-interval binding into the common schema. - Properly describe that either interrupts or poll-interval property is required. - Fix the example to pass validation. .../bindings/input/fsl,mpr121-touchkey.yaml | 25 +++++++++++++++++++++- Documentation/devicetree/bindings/input/input.yaml | 4 ++++ 2 files changed, 28 insertions(+), 1 deletion(-)diff --git a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml index c6fbcdf78556..035b2fee4491 100644 --- a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml +++ b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml@@ -17,6 +17,10 @@ description: | allOf: - $ref: input.yaml# +oneOf:
It should be valid to have both properties present, right? The h/w description can't know what the OS supports. In that case, we should use 'anyOf' here instead. With that, Reviewed-by: Rob Herring <robh@kernel.org>
quoted hunk ↗ jump to hunk
+ - required: [ interrupts ] + - required: [ poll-interval ] + properties: compatible: const: fsl,mpr121-touchkey@@ -41,12 +45,12 @@ properties: required: - compatible - reg - - interrupts - vdd-supply - linux,keycodes examples: - | + // Example with interrupts #include "dt-bindings/input/input.h" i2c { #address-cells = <1>;@@ -64,3 +68,22 @@ examples: <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>; }; }; + + - | + // Example with polling + #include "dt-bindings/input/input.h" + i2c { + #address-cells = <1>; + #size-cells = <0>; + + mpr121@5a { + compatible = "fsl,mpr121-touchkey"; + reg = <0x5a>; + poll-interval = <20>; + autorepeat; + vdd-supply = <&ldo4_reg>; + linux,keycodes = <KEY_0>, <KEY_1>, <KEY_2>, <KEY_3>, + <KEY_4>, <KEY_5>, <KEY_6>, <KEY_7>, + <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>; + }; + };diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml index ca8fe84a2e62..6d519046b3af 100644 --- a/Documentation/devicetree/bindings/input/input.yaml +++ b/Documentation/devicetree/bindings/input/input.yaml@@ -24,6 +24,10 @@ properties: minimum: 0 maximum: 0xff + poll-interval: + description: Poll interval time in milliseconds. + $ref: /schemas/types.yaml#/definitions/uint32 + power-off-time-sec: description: Duration in seconds which the key should be kept pressed for device to-- 2.1.4