On Mon, Sep 02, 2019 at 01:40:15PM +0200, Michal Vokáč wrote: > Add an option to periodicaly poll the device to get the buttons states > as the interrupt line may not be used on some platforms. > > Signed-off-by: Michal Vokáč <michal.vokac@xxxxxxxxx> > --- > I am not sure how to propperly handle this. > Either interrupt or linux,poll-interval is required, but not both. Add this at the top level: oneOf: - required: [ interrupts ] - required: [ linux,poll-interval ] > > .../bindings/input/fsl,mpr121-touchkey.yaml | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml > index c463c1c81755..2b3073a3c9f4 100644 > --- a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml > +++ b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml > @@ -34,6 +34,10 @@ properties: > minItems: 1 > maxItems: 12 > > + linux,poll-interval: > + description: Poll interval time in milliseconds. > + maxItems: 1 We already have 'poll-interval' in several bindings. Use that. This should have a type definition and you don't need maxItems: $ref: /schemas/types.yaml#/definitions/uint32 Really this should go in a common input schema doc. > + > wakeup-source: Use any event on keypad as wakeup event. > type: boolean > > @@ -44,12 +48,12 @@ properties: > required: > - compatible > - reg > - - interrupts > - vdd-supply > - linux,keycodes > > examples: > - | > + // Example with interrupts > #include "dt-bindings/input/input.h" > touchkey: mpr121@5a { > compatible = "fsl,mpr121-touchkey"; > @@ -62,3 +66,17 @@ examples: > <KEY_4> <KEY_5>, <KEY_6>, <KEY_7>, > <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>; > }; > + > + - | > + // Example with polling > + #include "dt-bindings/input/input.h" > + touchkey: mpr121@5a { > + compatible = "fsl,mpr121-touchkey"; > + reg = <0x5a>; > + linux,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>; > + ); > -- > 2.1.4 >