diff options
author | Michal Vokáč <michal.vokac@ysoft.com> | 2019-10-16 03:17:29 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-10-16 03:43:54 +0300 |
commit | ee358cb45984f4569098d3a97edfd0067576ad2f (patch) | |
tree | 2895abad910e4b8b3386bb59812b8e89dcd88167 /Documentation/devicetree/bindings | |
parent | def10ec7992f037140f3bd9542d1242cfd2027d4 (diff) | |
download | linux-ee358cb45984f4569098d3a97edfd0067576ad2f.tar.xz |
Input: mpr121 - add polling mode
In case the interrupt line is not available, polling can be used
to read out the state of the keys. Period of the polling needs to
be configured by the poll-interval DT property.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'Documentation/devicetree/bindings')
-rw-r--r-- | Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml | 25 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/input/input.yaml | 4 |
2 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml index c6fbcdf78556..5b37be0be4e9 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# +anyOf: + - 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 |