From: "Michal Vokáč" <michal.vokac@ysoft.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh+dt@kernel.org>
Cc: "Shawn Guo" <shawnguo@kernel.org>,
"Fabio Estevam" <festevam@gmail.com>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
"Michal Vokáč" <michal.vokac@ysoft.com>
Subject: [PATCH v2 3/5] dt-bindings: input: Add poll-interval property
Date: Tue, 1 Oct 2019 16:29:38 +0200 [thread overview]
Message-ID: <1569940180-11417-4-git-send-email-michal.vokac@ysoft.com> (raw)
In-Reply-To: <1569940180-11417-1-git-send-email-michal.vokac@ysoft.com>
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áč <michal.vokac@ysoft.com>
---
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:
+ - 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 494e7d031ea3..cc5f9e8a3c01 100644
--- a/Documentation/devicetree/bindings/input/input.yaml
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -23,3 +23,7 @@ properties:
autorepeat:
description: Enable autorepeat when key is pressed and held down.
type: boolean
+
+ poll-interval:
+ description: Poll interval time in milliseconds.
+ $ref: /schemas/types.yaml#/definitions/uint32
--
2.1.4
next prev parent reply other threads:[~2019-10-01 14:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 14:29 [PATCH v2 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
2019-10-01 14:29 ` [PATCH v2 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
2019-10-01 15:03 ` Rob Herring
2019-10-02 6:17 ` Michal Vokáč
2019-10-01 14:29 ` [PATCH v2 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
2019-10-03 19:09 ` Rob Herring
2019-10-04 7:40 ` Michal Vokáč
2019-10-04 13:32 ` Rob Herring
2019-10-04 13:51 ` Michal Vokáč
2019-10-01 14:29 ` Michal Vokáč [this message]
2019-10-01 14:29 ` [PATCH v2 4/5] Input: mpr121: Add polling mode Michal Vokáč
2019-10-01 14:29 ` [PATCH v2 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra Michal Vokáč
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1569940180-11417-4-git-send-email-michal.vokac@ysoft.com \
--to=michal.vokac@ysoft.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=festevam@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).