linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Add polling mode to the MPR121 touchkey
@ 2019-10-03  6:12 Michal Vokáč
  2019-10-03  6:12 ` [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

This series is another attempt to use the MPR121 touch sensor
controller in polling mode. This version uses the brand new
input-poller API.

First of all, create a common input binding schema that assosiates some
existing input device properties.
In second step, convert the existing MPR121 freeform text binding into
a json-schema. Then the binding is enhanced with the poll-interval
property. The ability to work in the pollig mode is then added to the
mpr121_touchkey driver and enabled on a imx6dl-yapp4-hydra platform that
uses this controller.

Michal Vokáč (5):
  dt-bindings: input: Add common input binding in json-schema
  dt-bindings: input: Convert mpr121 binding to json-schema
  dt-bindings: input: Add poll-interval property
  Input: mpr121: Add polling mode
  ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra

 .../bindings/input/fsl,mpr121-touchkey.yaml        | 89 ++++++++++++++++++++++
 Documentation/devicetree/bindings/input/input.yaml | 36 +++++++++
 Documentation/devicetree/bindings/input/keys.txt   |  8 --
 .../devicetree/bindings/input/mpr121-touchkey.txt  | 30 --------
 .../devicetree/bindings/input/mtk-pmic-keys.txt    |  4 +-
 .../devicetree/bindings/input/st,stpmic1-onkey.txt |  2 +-
 arch/arm/boot/dts/imx6dl-yapp4-common.dtsi         | 13 ++++
 arch/arm/boot/dts/imx6dl-yapp4-hydra.dts           |  4 +
 drivers/input/keyboard/mpr121_touchkey.c           | 69 ++++++++++++-----
 9 files changed, 196 insertions(+), 59 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
 create mode 100644 Documentation/devicetree/bindings/input/input.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/keys.txt
 delete mode 100644 Documentation/devicetree/bindings/input/mpr121-touchkey.txt

-- 
2.1.4


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema
  2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
@ 2019-10-03  6:12 ` Michal Vokáč
  2019-10-10 19:35   ` Rob Herring
  2019-10-03  6:12 ` [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

Create schema for the common input properties and merge all properties
from the Documentation/devicetree/bindings/input/keys.txt binding into
this common schema.

Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
Changes since v2:
 - Merge content of keys.txt binding inti this schema.

Changes since v1:
 - New patch in the series.

 Documentation/devicetree/bindings/input/input.yaml | 32 ++++++++++++++++++++++
 Documentation/devicetree/bindings/input/keys.txt   |  8 ------
 .../devicetree/bindings/input/mtk-pmic-keys.txt    |  4 +--
 .../devicetree/bindings/input/st,stpmic1-onkey.txt |  2 +-
 4 files changed, 35 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/input.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/keys.txt

diff --git a/Documentation/devicetree/bindings/input/input.yaml b/Documentation/devicetree/bindings/input/input.yaml
new file mode 100644
index 000000000000..ca8fe84a2e62
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/input.yaml
@@ -0,0 +1,32 @@
+# 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:
+  autorepeat:
+    description: Enable autorepeat when key is pressed and held down.
+    type: boolean
+
+  linux,keycodes:
+    description:
+      Specifies an array of numeric keycode values to be used for reporting
+      button presses.
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32-array
+      - items:
+          minimum: 0
+          maximum: 0xff
+
+  power-off-time-sec:
+    description:
+      Duration in seconds which the key should be kept pressed for device to
+      power off automatically. Device with key pressed shutdown feature can
+      specify this property.
+    $ref: /schemas/types.yaml#/definitions/uint32
diff --git a/Documentation/devicetree/bindings/input/keys.txt b/Documentation/devicetree/bindings/input/keys.txt
deleted file mode 100644
index f5a5ddde53f1..000000000000
--- a/Documentation/devicetree/bindings/input/keys.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-General Keys Properties:
-
-Optional properties for Keys:
-- power-off-time-sec: Duration in seconds which the key should be kept
-	pressed for device to power off automatically. Device with key pressed
-	shutdown feature can specify this property.
-- linux,keycodes: Specifies the numeric keycode values to be used for
-	reporting key presses.
diff --git a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
index 2888d07c2ef0..535d92885372 100644
--- a/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
+++ b/Documentation/devicetree/bindings/input/mtk-pmic-keys.txt
@@ -10,13 +10,13 @@ Documentation/devicetree/bindings/mfd/mt6397.txt
 
 Required properties:
 - compatible: "mediatek,mt6397-keys" or "mediatek,mt6323-keys"
-- linux,keycodes: See Documentation/devicetree/bindings/input/keys.txt
+- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml
 
 Optional Properties:
 - wakeup-source: See Documentation/devicetree/bindings/power/wakeup-source.txt
 - mediatek,long-press-mode: Long press key shutdown setting, 1 for
 	pwrkey only, 2 for pwrkey/homekey together, others for disabled.
-- power-off-time-sec: See Documentation/devicetree/bindings/input/keys.txt
+- power-off-time-sec: See Documentation/devicetree/bindings/input/input.yaml
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt b/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
index 4494613ae7ad..eb8e83736c02 100644
--- a/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
+++ b/Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
@@ -15,7 +15,7 @@ Optional properties:
 - st,onkey-pu-inactive: onkey pull up is not active
 - power-off-time-sec: Duration in seconds which the key should be kept
         pressed for device to power off automatically (from 1 to 16 seconds).
-        see See Documentation/devicetree/bindings/input/keys.txt
+        see See Documentation/devicetree/bindings/input/input.yaml
 
 Example:
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema
  2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
  2019-10-03  6:12 ` [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
@ 2019-10-03  6:12 ` Michal Vokáč
  2019-10-04 13:58   ` Michal Vokáč
  2019-10-10 19:36   ` Rob Herring
  2019-10-03  6:12 ` [PATCH v3 3/5] dt-bindings: input: Add poll-interval property Michal Vokáč
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

Convert the mpr121 binding to DT schema format using json-schema.

Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
Changes since v2:
 - None

Changes since v1:
 - Extract the common input properties into the input.yaml schema.
 - Fix the wakeup-source description.
 - Fix the example to pass validation. Put the mpr121 device sub-node
   into a i2c {} node.

The linux,keycodes property is not valid as it is. If I put the minItems
and maxItems into the common schema, it is valid and the min/max length
check works fine. Rob, could you advice how to fix this please?

The error is not very specific..

$ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
/home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml: ignoring, error in schema 'linux,ke
warning: no schema found in file: /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
/home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/Makefile:33: recipe for target 'Documentation/devicetree/bindings/p
make[3]: *** [Documentation/devicetree/bindings/processed-schema.yaml] Error 255
/home/vokac/development/sources/linux-fslc/Makefile:1264: recipe for target 'dt_binding_check' failed

 .../bindings/input/fsl,mpr121-touchkey.yaml        | 66 ++++++++++++++++++++++
 .../devicetree/bindings/input/mpr121-touchkey.txt  | 30 ----------
 2 files changed, 66 insertions(+), 30 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/mpr121-touchkey.txt

diff --git a/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
new file mode 100644
index 000000000000..c6fbcdf78556
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
@@ -0,0 +1,66 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/fsl,mpr121-touchkey.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MPR121 capacitive touch sensor controller
+
+maintainers:
+  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
+
+description: |
+  The MPR121 supports up to 12 completely independent electrodes/capacitance
+  sensing inputs in which 8 are multifunctional for LED driving and GPIO.
+  https://www.nxp.com/docs/en/data-sheet/MPR121.pdf
+
+allOf:
+  - $ref: input.yaml#
+
+properties:
+  compatible:
+    const: fsl,mpr121-touchkey
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  vdd-supply:
+    maxItems: 1
+
+  linux,keycodes:
+    minItems: 1
+    maxItems: 12
+
+  wakeup-source:
+    description: Use any event on keypad as wakeup event.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - vdd-supply
+  - linux,keycodes
+
+examples:
+  - |
+    #include "dt-bindings/input/input.h"
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mpr121@5a {
+            compatible = "fsl,mpr121-touchkey";
+            reg = <0x5a>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <28 2>;
+            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/mpr121-touchkey.txt b/Documentation/devicetree/bindings/input/mpr121-touchkey.txt
deleted file mode 100644
index b7c61ee5841b..000000000000
--- a/Documentation/devicetree/bindings/input/mpr121-touchkey.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-* Freescale MPR121 Controllor
-
-Required Properties:
-- compatible:		Should be "fsl,mpr121-touchkey"
-- reg:			The I2C slave address of the device.
-- interrupts:		The interrupt number to the cpu.
-- vdd-supply:		Phandle to the Vdd power supply.
-- linux,keycodes:	Specifies an array of numeric keycode values to
-			be used for reporting button presses. The array can
-			contain up to 12 entries.
-
-Optional Properties:
-- wakeup-source:	Use any event on keypad as wakeup event.
-- autorepeat:		Enable autorepeat feature.
-
-Example:
-
-#include "dt-bindings/input/input.h"
-
-	touchkey: mpr121@5a {
-		compatible = "fsl,mpr121-touchkey";
-		reg = <0x5a>;
-		interrupt-parent = <&gpio1>;
-		interrupts = <28 2>;
-		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


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
  2019-10-03  6:12 ` [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
  2019-10-03  6:12 ` [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
@ 2019-10-03  6:12 ` Michal Vokáč
  2019-10-10 19:40   ` Rob Herring
  2019-10-03  6:12 ` [PATCH v3 4/5] Input: mpr121: Add polling mode Michal Vokáč
  2019-10-03  6:12 ` [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra Michal Vokáč
  4 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

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 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:
+  - 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


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3 4/5] Input: mpr121: Add polling mode
  2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
                   ` (2 preceding siblings ...)
  2019-10-03  6:12 ` [PATCH v3 3/5] dt-bindings: input: Add poll-interval property Michal Vokáč
@ 2019-10-03  6:12 ` Michal Vokáč
  2019-10-16  0:24   ` Dmitry Torokhov
  2019-10-03  6:12 ` [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra Michal Vokáč
  4 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

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>
---
Changes since v2:
 - None

Changes since v1:
 - Use poll-interval property name instead of linux,poll-interval.

 drivers/input/keyboard/mpr121_touchkey.c | 69 +++++++++++++++++++++++---------
 1 file changed, 51 insertions(+), 18 deletions(-)

diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index ee80de44ce3f..40d6e5087cde 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -54,6 +54,9 @@
 /* MPR121 has 12 keys */
 #define MPR121_MAX_KEY_COUNT		12
 
+#define MPR121_MIN_POLL_INTERVAL	10
+#define MPR121_MAX_POLL_INTERVAL	200
+
 struct mpr121_touchkey {
 	struct i2c_client	*client;
 	struct input_dev	*input_dev;
@@ -115,11 +118,11 @@ static struct regulator *mpr121_vdd_supply_init(struct device *dev)
 	return vdd_supply;
 }
 
-static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
+static void mpr_touchkey_report(struct input_dev *dev)
 {
-	struct mpr121_touchkey *mpr121 = dev_id;
-	struct i2c_client *client = mpr121->client;
+	struct mpr121_touchkey *mpr121 = input_get_drvdata(dev);
 	struct input_dev *input = mpr121->input_dev;
+	struct i2c_client *client = mpr121->client;
 	unsigned long bit_changed;
 	unsigned int key_num;
 	int reg;
@@ -127,14 +130,14 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
 	reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR);
 	if (reg < 0) {
 		dev_err(&client->dev, "i2c read error [%d]\n", reg);
-		goto out;
+		return;
 	}
 
 	reg <<= 8;
 	reg |= i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_0_ADDR);
 	if (reg < 0) {
 		dev_err(&client->dev, "i2c read error [%d]\n", reg);
-		goto out;
+		return;
 	}
 
 	reg &= TOUCH_STATUS_MASK;
@@ -155,8 +158,14 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
 
 	}
 	input_sync(input);
+}
+
+static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
+{
+	struct mpr121_touchkey *mpr121 = dev_id;
+
+	mpr_touchkey_report(mpr121->input_dev);
 
-out:
 	return IRQ_HANDLED;
 }
 
@@ -229,14 +238,10 @@ static int mpr_touchkey_probe(struct i2c_client *client,
 	int vdd_uv;
 	struct mpr121_touchkey *mpr121;
 	struct input_dev *input_dev;
+	u32 poll_interval = 0;
 	int error;
 	int i;
 
-	if (!client->irq) {
-		dev_err(dev, "irq number should not be zero\n");
-		return -EINVAL;
-	}
-
 	vdd_supply = mpr121_vdd_supply_init(dev);
 	if (IS_ERR(vdd_supply))
 		return PTR_ERR(vdd_supply);
@@ -274,6 +279,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
 	if (device_property_read_bool(dev, "autorepeat"))
 		__set_bit(EV_REP, input_dev->evbit);
 	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
+	input_set_drvdata(input_dev, mpr121);
 
 	input_dev->keycode = mpr121->keycodes;
 	input_dev->keycodesize = sizeof(mpr121->keycodes[0]);
@@ -288,13 +294,40 @@ static int mpr_touchkey_probe(struct i2c_client *client,
 		return error;
 	}
 
-	error = devm_request_threaded_irq(dev, client->irq, NULL,
-					  mpr_touchkey_interrupt,
-					  IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-					  dev->driver->name, mpr121);
-	if (error) {
-		dev_err(dev, "Failed to register interrupt\n");
-		return error;
+	device_property_read_u32(dev, "poll-interval", &poll_interval);
+
+	if (client->irq) {
+		error = devm_request_threaded_irq(dev, client->irq, NULL,
+						  mpr_touchkey_interrupt,
+						  IRQF_TRIGGER_FALLING |
+						  IRQF_ONESHOT,
+						  dev->driver->name, mpr121);
+		if (error) {
+			dev_err(dev, "Failed to register interrupt\n");
+			return error;
+		}
+	} else if (poll_interval) {
+		if (poll_interval < MPR121_MIN_POLL_INTERVAL)
+			return -EINVAL;
+
+		if (poll_interval > MPR121_MAX_POLL_INTERVAL)
+			return -EINVAL;
+
+		error = input_setup_polling(input_dev, mpr_touchkey_report);
+		if (error) {
+			dev_err(dev, "Failed to setup polling\n");
+			return error;
+		}
+
+		input_set_poll_interval(input_dev, poll_interval);
+		input_set_min_poll_interval(input_dev,
+					    MPR121_MIN_POLL_INTERVAL);
+		input_set_max_poll_interval(input_dev,
+					    MPR121_MAX_POLL_INTERVAL);
+	} else {
+		dev_err(dev,
+			"invalid IRQ number and polling not configured\n");
+		return -EINVAL;
 	}
 
 	error = input_register_device(input_dev);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra
  2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
                   ` (3 preceding siblings ...)
  2019-10-03  6:12 ` [PATCH v3 4/5] Input: mpr121: Add polling mode Michal Vokáč
@ 2019-10-03  6:12 ` Michal Vokáč
  2019-10-16  6:07   ` Michal Vokáč
  4 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-03  6:12 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree,
	Michal Vokáč

Add the touch keyboard present on Hydra board. The controller
is connected only using I2C lines. The interrupt line is not
available hence we use the polling mode.

Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
Changes since v2:
 - None

Changes since v1:
 - Use poll-interval property name instead of linux,poll-interval.

 arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 13 +++++++++++++
 arch/arm/boot/dts/imx6dl-yapp4-hydra.dts   |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
index e8d800fec637..6507bfc0141a 100644
--- a/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
+++ b/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pwm/pwm.h>
 
 / {
@@ -330,6 +331,18 @@
 		vcc-supply = <&sw2_reg>;
 		status = "disabled";
 	};
+
+	touchkeys: keys@5a {
+		compatible = "fsl,mpr121-touchkey";
+		reg = <0x5a>;
+		vdd-supply = <&sw2_reg>;
+		autorepeat;
+		linux,keycodes = <KEY_1>, <KEY_2>, <KEY_3>, <KEY_4>, <KEY_5>,
+				<KEY_6>, <KEY_7>, <KEY_8>, <KEY_9>,
+				<KEY_BACKSPACE>, <KEY_0>, <KEY_ENTER>;
+		poll-interval = <50>;
+		status = "disabled";
+	};
 };
 
 &iomuxc {
diff --git a/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts b/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
index f97927064750..84c275bfdd38 100644
--- a/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
+++ b/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
@@ -45,6 +45,10 @@
 	status = "okay";
 };
 
+&touchkeys {
+	status = "okay";
+};
+
 &usdhc3 {
 	status = "okay";
 };
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema
  2019-10-03  6:12 ` [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
@ 2019-10-04 13:58   ` Michal Vokáč
  2019-10-10 19:36   ` Rob Herring
  1 sibling, 0 replies; 19+ messages in thread
From: Michal Vokáč @ 2019-10-04 13:58 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree

On 03. 10. 19 8:12, Michal Vokáč wrote:
> Convert the mpr121 binding to DT schema format using json-schema.
> 
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---
> Changes since v2:
>   - None
> 
> Changes since v1:
>   - Extract the common input properties into the input.yaml schema.
>   - Fix the wakeup-source description.
>   - Fix the example to pass validation. Put the mpr121 device sub-node
>     into a i2c {} node.
> 
> The linux,keycodes property is not valid as it is. If I put the minItems
> and maxItems into the common schema, it is valid and the min/max length
> check works fine. Rob, could you advice how to fix this please?

This error is no longer present - it is fixed in the latest version of
meta-schema. Thank you, Rob!

> The error is not very specific..
> 
> $ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
>    SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
> /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml: ignoring, error in schema 'linux,ke
> warning: no schema found in file: /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
> /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/Makefile:33: recipe for target 'Documentation/devicetree/bindings/p
> make[3]: *** [Documentation/devicetree/bindings/processed-schema.yaml] Error 255
> /home/vokac/development/sources/linux-fslc/Makefile:1264: recipe for target 'dt_binding_check' failed


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema
  2019-10-03  6:12 ` [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
@ 2019-10-10 19:35   ` Rob Herring
  2019-10-16  0:23     ` Dmitry Torokhov
  0 siblings, 1 reply; 19+ messages in thread
From: Rob Herring @ 2019-10-10 19:35 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Dmitry Torokhov, Shawn Guo, Fabio Estevam, linux-input,
	devicetree, Michal Vokáč

On Thu,  3 Oct 2019 08:12:52 +0200, =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= wrote:
> Create schema for the common input properties and merge all properties
> from the Documentation/devicetree/bindings/input/keys.txt binding into
> this common schema.
> 
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---
> Changes since v2:
>  - Merge content of keys.txt binding inti this schema.
> 
> Changes since v1:
>  - New patch in the series.
> 
>  Documentation/devicetree/bindings/input/input.yaml | 32 ++++++++++++++++++++++
>  Documentation/devicetree/bindings/input/keys.txt   |  8 ------
>  .../devicetree/bindings/input/mtk-pmic-keys.txt    |  4 +--
>  .../devicetree/bindings/input/st,stpmic1-onkey.txt |  2 +-
>  4 files changed, 35 insertions(+), 11 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/input.yaml
>  delete mode 100644 Documentation/devicetree/bindings/input/keys.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema
  2019-10-03  6:12 ` [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
  2019-10-04 13:58   ` Michal Vokáč
@ 2019-10-10 19:36   ` Rob Herring
  2019-10-16  0:24     ` Dmitry Torokhov
  1 sibling, 1 reply; 19+ messages in thread
From: Rob Herring @ 2019-10-10 19:36 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Dmitry Torokhov, Shawn Guo, Fabio Estevam, linux-input,
	devicetree, Michal Vokáč

On Thu,  3 Oct 2019 08:12:53 +0200, =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= wrote:
> Convert the mpr121 binding to DT schema format using json-schema.
> 
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---
> Changes since v2:
>  - None
> 
> Changes since v1:
>  - Extract the common input properties into the input.yaml schema.
>  - Fix the wakeup-source description.
>  - Fix the example to pass validation. Put the mpr121 device sub-node
>    into a i2c {} node.
> 
> The linux,keycodes property is not valid as it is. If I put the minItems
> and maxItems into the common schema, it is valid and the min/max length
> check works fine. Rob, could you advice how to fix this please?
> 
> The error is not very specific..
> 
> $ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
>   SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
> /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml: ignoring, error in schema 'linux,ke
> warning: no schema found in file: /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
> /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/Makefile:33: recipe for target 'Documentation/devicetree/bindings/p
> make[3]: *** [Documentation/devicetree/bindings/processed-schema.yaml] Error 255
> /home/vokac/development/sources/linux-fslc/Makefile:1264: recipe for target 'dt_binding_check' failed
> 
>  .../bindings/input/fsl,mpr121-touchkey.yaml        | 66 ++++++++++++++++++++++
>  .../devicetree/bindings/input/mpr121-touchkey.txt  | 30 ----------
>  2 files changed, 66 insertions(+), 30 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
>  delete mode 100644 Documentation/devicetree/bindings/input/mpr121-touchkey.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-03  6:12 ` [PATCH v3 3/5] dt-bindings: input: Add poll-interval property Michal Vokáč
@ 2019-10-10 19:40   ` Rob Herring
  2019-10-10 20:01     ` Dmitry Torokhov
  0 siblings, 1 reply; 19+ messages in thread
From: Rob Herring @ 2019-10-10 19:40 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Dmitry Torokhov, Shawn Guo, Fabio Estevam, linux-input, devicetree

On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
> 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 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>

> +  - 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
> 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-10 19:40   ` Rob Herring
@ 2019-10-10 20:01     ` Dmitry Torokhov
  2019-10-11  8:03       ` Michal Vokáč
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry Torokhov @ 2019-10-10 20:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Michal Vokáč,
	Shawn Guo, Fabio Estevam, linux-input, devicetree

On Thu, Oct 10, 2019 at 02:40:36PM -0500, Rob Herring wrote:
> On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
> > 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 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 poll does not really sense and does not have any effect when
interrupt is supplied.

> The h/w description can't know what the OS supports.

It also has no idea what OS does at all and whether it even pays
attention to any of these properties. We are just trying to say here "I
do not have an interrupt wired, so for this device's primary use case
(that is coupled with a certain $PRIMARY OS) we need to poll the
controller ever so often to handle our use case".

> In that case, we should use 'anyOf' here instead.
> 
> With that,
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> > +  - 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
> > 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-10 20:01     ` Dmitry Torokhov
@ 2019-10-11  8:03       ` Michal Vokáč
  2019-10-16  0:23         ` Dmitry Torokhov
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-11  8:03 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree

On 10. 10. 19 22:01, Dmitry Torokhov wrote:
> On Thu, Oct 10, 2019 at 02:40:36PM -0500, Rob Herring wrote:
>> On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
>>> 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 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 poll does not really sense and does not have any effect when
> interrupt is supplied.

 From technical point of view, yes it is possible to have both
properties. But I agree that it does not really make sense to
use both at the same time.

>> The h/w description can't know what the OS supports.
> 
> It also has no idea what OS does at all and whether it even pays
> attention to any of these properties. We are just trying to say here "I
> do not have an interrupt wired, so for this device's primary use case
> (that is coupled with a certain $PRIMARY OS) we need to poll the
> controller ever so often to handle our use case".

If I understand correctly the relationship between Linux and DT
binding, in Linux we are free to implement just part of all the
possible configuration options described by the binding.

In this case if somebody would enable both interrupt and polling,
we will happily use the interrupt mode only. Maybe it would be nice
to at least print a message that the poll-intervall is ignored?

>> In that case, we should use 'anyOf' here instead.

What I am afraid of is that some DT writers may really use both
properties and expect that Linux will actually do something useful
in this case. Anyway, I am OK with that.

Michal

>> With that,
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>>
>>> +  - 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
>>>
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-11  8:03       ` Michal Vokáč
@ 2019-10-16  0:23         ` Dmitry Torokhov
  2019-10-16  5:52           ` Michal Vokáč
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry Torokhov @ 2019-10-16  0:23 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Rob Herring, Shawn Guo, Fabio Estevam, linux-input, devicetree

On Fri, Oct 11, 2019 at 10:03:25AM +0200, Michal Vokáč wrote:
> On 10. 10. 19 22:01, Dmitry Torokhov wrote:
> > On Thu, Oct 10, 2019 at 02:40:36PM -0500, Rob Herring wrote:
> > > On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
> > > > 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 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 poll does not really sense and does not have any effect when
> > interrupt is supplied.
> 
> From technical point of view, yes it is possible to have both
> properties. But I agree that it does not really make sense to
> use both at the same time.
> 
> > > The h/w description can't know what the OS supports.
> > 
> > It also has no idea what OS does at all and whether it even pays
> > attention to any of these properties. We are just trying to say here "I
> > do not have an interrupt wired, so for this device's primary use case
> > (that is coupled with a certain $PRIMARY OS) we need to poll the
> > controller ever so often to handle our use case".
> 
> If I understand correctly the relationship between Linux and DT
> binding, in Linux we are free to implement just part of all the
> possible configuration options described by the binding.
> 
> In this case if somebody would enable both interrupt and polling,
> we will happily use the interrupt mode only. Maybe it would be nice
> to at least print a message that the poll-intervall is ignored?
> 
> > > In that case, we should use 'anyOf' here instead.
> 
> What I am afraid of is that some DT writers may really use both
> properties and expect that Linux will actually do something useful
> in this case. Anyway, I am OK with that.

OK, I changed it to "anyOf", folded into driver change and applied.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema
  2019-10-10 19:35   ` Rob Herring
@ 2019-10-16  0:23     ` Dmitry Torokhov
  0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Torokhov @ 2019-10-16  0:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: Michal Vokáč,
	Shawn Guo, Fabio Estevam, linux-input, devicetree

On Thu, Oct 10, 2019 at 02:35:37PM -0500, Rob Herring wrote:
> On Thu,  3 Oct 2019 08:12:52 +0200, =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= wrote:
> > Create schema for the common input properties and merge all properties
> > from the Documentation/devicetree/bindings/input/keys.txt binding into
> > this common schema.
> > 
> > Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> > ---
> > Changes since v2:
> >  - Merge content of keys.txt binding inti this schema.
> > 
> > Changes since v1:
> >  - New patch in the series.
> > 
> >  Documentation/devicetree/bindings/input/input.yaml | 32 ++++++++++++++++++++++
> >  Documentation/devicetree/bindings/input/keys.txt   |  8 ------
> >  .../devicetree/bindings/input/mtk-pmic-keys.txt    |  4 +--
> >  .../devicetree/bindings/input/st,stpmic1-onkey.txt |  2 +-
> >  4 files changed, 35 insertions(+), 11 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/input/input.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/input/keys.txt
> > 
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema
  2019-10-10 19:36   ` Rob Herring
@ 2019-10-16  0:24     ` Dmitry Torokhov
  0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Torokhov @ 2019-10-16  0:24 UTC (permalink / raw)
  To: Rob Herring
  Cc: Michal Vokáč,
	Shawn Guo, Fabio Estevam, linux-input, devicetree

On Thu, Oct 10, 2019 at 02:36:51PM -0500, Rob Herring wrote:
> On Thu,  3 Oct 2019 08:12:53 +0200, =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= wrote:
> > Convert the mpr121 binding to DT schema format using json-schema.
> > 
> > Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> > ---
> > Changes since v2:
> >  - None
> > 
> > Changes since v1:
> >  - Extract the common input properties into the input.yaml schema.
> >  - Fix the wakeup-source description.
> >  - Fix the example to pass validation. Put the mpr121 device sub-node
> >    into a i2c {} node.
> > 
> > The linux,keycodes property is not valid as it is. If I put the minItems
> > and maxItems into the common schema, it is valid and the min/max length
> > check works fine. Rob, could you advice how to fix this please?
> > 
> > The error is not very specific..
> > 
> > $ make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
> >   SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
> > /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml: ignoring, error in schema 'linux,ke
> > warning: no schema found in file: /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
> > /home/vokac/development/sources/linux-fslc/Documentation/devicetree/bindings/Makefile:33: recipe for target 'Documentation/devicetree/bindings/p
> > make[3]: *** [Documentation/devicetree/bindings/processed-schema.yaml] Error 255
> > /home/vokac/development/sources/linux-fslc/Makefile:1264: recipe for target 'dt_binding_check' failed
> > 
> >  .../bindings/input/fsl,mpr121-touchkey.yaml        | 66 ++++++++++++++++++++++
> >  .../devicetree/bindings/input/mpr121-touchkey.txt  | 30 ----------
> >  2 files changed, 66 insertions(+), 30 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/input/fsl,mpr121-touchkey.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/input/mpr121-touchkey.txt
> > 
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 4/5] Input: mpr121: Add polling mode
  2019-10-03  6:12 ` [PATCH v3 4/5] Input: mpr121: Add polling mode Michal Vokáč
@ 2019-10-16  0:24   ` Dmitry Torokhov
  0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Torokhov @ 2019-10-16  0:24 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Rob Herring, Shawn Guo, Fabio Estevam, linux-input, devicetree

On Thu, Oct 03, 2019 at 08:12:55AM +0200, Michal Vokáč wrote:
> 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>

Applied, thank you.

> ---
> Changes since v2:
>  - None
> 
> Changes since v1:
>  - Use poll-interval property name instead of linux,poll-interval.
> 
>  drivers/input/keyboard/mpr121_touchkey.c | 69 +++++++++++++++++++++++---------
>  1 file changed, 51 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
> index ee80de44ce3f..40d6e5087cde 100644
> --- a/drivers/input/keyboard/mpr121_touchkey.c
> +++ b/drivers/input/keyboard/mpr121_touchkey.c
> @@ -54,6 +54,9 @@
>  /* MPR121 has 12 keys */
>  #define MPR121_MAX_KEY_COUNT		12
>  
> +#define MPR121_MIN_POLL_INTERVAL	10
> +#define MPR121_MAX_POLL_INTERVAL	200
> +
>  struct mpr121_touchkey {
>  	struct i2c_client	*client;
>  	struct input_dev	*input_dev;
> @@ -115,11 +118,11 @@ static struct regulator *mpr121_vdd_supply_init(struct device *dev)
>  	return vdd_supply;
>  }
>  
> -static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
> +static void mpr_touchkey_report(struct input_dev *dev)
>  {
> -	struct mpr121_touchkey *mpr121 = dev_id;
> -	struct i2c_client *client = mpr121->client;
> +	struct mpr121_touchkey *mpr121 = input_get_drvdata(dev);
>  	struct input_dev *input = mpr121->input_dev;
> +	struct i2c_client *client = mpr121->client;
>  	unsigned long bit_changed;
>  	unsigned int key_num;
>  	int reg;
> @@ -127,14 +130,14 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
>  	reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR);
>  	if (reg < 0) {
>  		dev_err(&client->dev, "i2c read error [%d]\n", reg);
> -		goto out;
> +		return;
>  	}
>  
>  	reg <<= 8;
>  	reg |= i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_0_ADDR);
>  	if (reg < 0) {
>  		dev_err(&client->dev, "i2c read error [%d]\n", reg);
> -		goto out;
> +		return;
>  	}
>  
>  	reg &= TOUCH_STATUS_MASK;
> @@ -155,8 +158,14 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
>  
>  	}
>  	input_sync(input);
> +}
> +
> +static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
> +{
> +	struct mpr121_touchkey *mpr121 = dev_id;
> +
> +	mpr_touchkey_report(mpr121->input_dev);
>  
> -out:
>  	return IRQ_HANDLED;
>  }
>  
> @@ -229,14 +238,10 @@ static int mpr_touchkey_probe(struct i2c_client *client,
>  	int vdd_uv;
>  	struct mpr121_touchkey *mpr121;
>  	struct input_dev *input_dev;
> +	u32 poll_interval = 0;
>  	int error;
>  	int i;
>  
> -	if (!client->irq) {
> -		dev_err(dev, "irq number should not be zero\n");
> -		return -EINVAL;
> -	}
> -
>  	vdd_supply = mpr121_vdd_supply_init(dev);
>  	if (IS_ERR(vdd_supply))
>  		return PTR_ERR(vdd_supply);
> @@ -274,6 +279,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
>  	if (device_property_read_bool(dev, "autorepeat"))
>  		__set_bit(EV_REP, input_dev->evbit);
>  	input_set_capability(input_dev, EV_MSC, MSC_SCAN);
> +	input_set_drvdata(input_dev, mpr121);
>  
>  	input_dev->keycode = mpr121->keycodes;
>  	input_dev->keycodesize = sizeof(mpr121->keycodes[0]);
> @@ -288,13 +294,40 @@ static int mpr_touchkey_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> -	error = devm_request_threaded_irq(dev, client->irq, NULL,
> -					  mpr_touchkey_interrupt,
> -					  IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> -					  dev->driver->name, mpr121);
> -	if (error) {
> -		dev_err(dev, "Failed to register interrupt\n");
> -		return error;
> +	device_property_read_u32(dev, "poll-interval", &poll_interval);
> +
> +	if (client->irq) {
> +		error = devm_request_threaded_irq(dev, client->irq, NULL,
> +						  mpr_touchkey_interrupt,
> +						  IRQF_TRIGGER_FALLING |
> +						  IRQF_ONESHOT,
> +						  dev->driver->name, mpr121);
> +		if (error) {
> +			dev_err(dev, "Failed to register interrupt\n");
> +			return error;
> +		}
> +	} else if (poll_interval) {
> +		if (poll_interval < MPR121_MIN_POLL_INTERVAL)
> +			return -EINVAL;
> +
> +		if (poll_interval > MPR121_MAX_POLL_INTERVAL)
> +			return -EINVAL;
> +
> +		error = input_setup_polling(input_dev, mpr_touchkey_report);
> +		if (error) {
> +			dev_err(dev, "Failed to setup polling\n");
> +			return error;
> +		}
> +
> +		input_set_poll_interval(input_dev, poll_interval);
> +		input_set_min_poll_interval(input_dev,
> +					    MPR121_MIN_POLL_INTERVAL);
> +		input_set_max_poll_interval(input_dev,
> +					    MPR121_MAX_POLL_INTERVAL);
> +	} else {
> +		dev_err(dev,
> +			"invalid IRQ number and polling not configured\n");
> +		return -EINVAL;
>  	}
>  
>  	error = input_register_device(input_dev);
> -- 
> 2.1.4
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 3/5] dt-bindings: input: Add poll-interval property
  2019-10-16  0:23         ` Dmitry Torokhov
@ 2019-10-16  5:52           ` Michal Vokáč
  0 siblings, 0 replies; 19+ messages in thread
From: Michal Vokáč @ 2019-10-16  5:52 UTC (permalink / raw)
  To: Dmitry Torokhov, Rob Herring
  Cc: Shawn Guo, Fabio Estevam, linux-input, devicetree

On 16. 10. 19 2:23, Dmitry Torokhov wrote:
> On Fri, Oct 11, 2019 at 10:03:25AM +0200, Michal Vokáč wrote:
>> On 10. 10. 19 22:01, Dmitry Torokhov wrote:
>>> On Thu, Oct 10, 2019 at 02:40:36PM -0500, Rob Herring wrote:
>>>> On Thu, Oct 03, 2019 at 08:12:54AM +0200, Michal Vokáč wrote:
>>>>> 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 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 poll does not really sense and does not have any effect when
>>> interrupt is supplied.
>>
>>  From technical point of view, yes it is possible to have both
>> properties. But I agree that it does not really make sense to
>> use both at the same time.
>>
>>>> The h/w description can't know what the OS supports.
>>>
>>> It also has no idea what OS does at all and whether it even pays
>>> attention to any of these properties. We are just trying to say here "I
>>> do not have an interrupt wired, so for this device's primary use case
>>> (that is coupled with a certain $PRIMARY OS) we need to poll the
>>> controller ever so often to handle our use case".
>>
>> If I understand correctly the relationship between Linux and DT
>> binding, in Linux we are free to implement just part of all the
>> possible configuration options described by the binding.
>>
>> In this case if somebody would enable both interrupt and polling,
>> we will happily use the interrupt mode only. Maybe it would be nice
>> to at least print a message that the poll-intervall is ignored?
>>
>>>> In that case, we should use 'anyOf' here instead.
>>
>> What I am afraid of is that some DT writers may really use both
>> properties and expect that Linux will actually do something useful
>> in this case. Anyway, I am OK with that.
> 
> OK, I changed it to "anyOf", folded into driver change and applied.

AFAIK this is discouraged and DT binding changes and driver changes
should ideally be kept as separate patches. Separating the binding
from driver changes makes is easier for other projects to reuse
the binding.

The other thing is, Rob reviewed just the binding part, not the driver
change, but now his tag covers both changes.

Michal


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra
  2019-10-03  6:12 ` [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra Michal Vokáč
@ 2019-10-16  6:07   ` Michal Vokáč
  2019-10-25  2:48     ` Shawn Guo
  0 siblings, 1 reply; 19+ messages in thread
From: Michal Vokáč @ 2019-10-16  6:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Shawn Guo
  Cc: Rob Herring, Fabio Estevam, linux-input, devicetree

On 03. 10. 19 8:12, Michal Vokáč wrote:
> Add the touch keyboard present on Hydra board. The controller
> is connected only using I2C lines. The interrupt line is not
> available hence we use the polling mode.
> 
> Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> ---

This should ideally go through the input tree with the rest of
the changes that add support for the poll-interval.

Shawn, can you ack this so Dmitry can take it, please?

Thank you,
Michal

> Changes since v2:
>   - None
> 
> Changes since v1:
>   - Use poll-interval property name instead of linux,poll-interval.
> 
>   arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 13 +++++++++++++
>   arch/arm/boot/dts/imx6dl-yapp4-hydra.dts   |  4 ++++
>   2 files changed, 17 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
> index e8d800fec637..6507bfc0141a 100644
> --- a/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
> +++ b/arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
> @@ -4,6 +4,7 @@
>   
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/input/input.h>
>   #include <dt-bindings/pwm/pwm.h>
>   
>   / {
> @@ -330,6 +331,18 @@
>   		vcc-supply = <&sw2_reg>;
>   		status = "disabled";
>   	};
> +
> +	touchkeys: keys@5a {
> +		compatible = "fsl,mpr121-touchkey";
> +		reg = <0x5a>;
> +		vdd-supply = <&sw2_reg>;
> +		autorepeat;
> +		linux,keycodes = <KEY_1>, <KEY_2>, <KEY_3>, <KEY_4>, <KEY_5>,
> +				<KEY_6>, <KEY_7>, <KEY_8>, <KEY_9>,
> +				<KEY_BACKSPACE>, <KEY_0>, <KEY_ENTER>;
> +		poll-interval = <50>;
> +		status = "disabled";
> +	};
>   };
>   
>   &iomuxc {
> diff --git a/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts b/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
> index f97927064750..84c275bfdd38 100644
> --- a/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
> +++ b/arch/arm/boot/dts/imx6dl-yapp4-hydra.dts
> @@ -45,6 +45,10 @@
>   	status = "okay";
>   };
>   
> +&touchkeys {
> +	status = "okay";
> +};
> +
>   &usdhc3 {
>   	status = "okay";
>   };
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra
  2019-10-16  6:07   ` Michal Vokáč
@ 2019-10-25  2:48     ` Shawn Guo
  0 siblings, 0 replies; 19+ messages in thread
From: Shawn Guo @ 2019-10-25  2:48 UTC (permalink / raw)
  To: Michal Vokáč
  Cc: Dmitry Torokhov, Rob Herring, Fabio Estevam, linux-input, devicetree

On Wed, Oct 16, 2019 at 08:07:22AM +0200, Michal Vokáč wrote:
> On 03. 10. 19 8:12, Michal Vokáč wrote:
> >Add the touch keyboard present on Hydra board. The controller
> >is connected only using I2C lines. The interrupt line is not
> >available hence we use the polling mode.
> >
> >Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
> >---
> 
> This should ideally go through the input tree with the rest of
> the changes that add support for the poll-interval.

Not really necessary.  The patches can reach linux-next and mainline
through different trees, as long as there is no hard dependency which
could break build or cause regression on any of the trees.

Applied to imx/dt branch.

Shawn

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2019-10-25  2:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-03  6:12 [PATCH v3 0/5] Add polling mode to the MPR121 touchkey Michal Vokáč
2019-10-03  6:12 ` [PATCH v3 1/5] dt-bindings: input: Add common input binding in json-schema Michal Vokáč
2019-10-10 19:35   ` Rob Herring
2019-10-16  0:23     ` Dmitry Torokhov
2019-10-03  6:12 ` [PATCH v3 2/5] dt-bindings: input: Convert mpr121 binding to json-schema Michal Vokáč
2019-10-04 13:58   ` Michal Vokáč
2019-10-10 19:36   ` Rob Herring
2019-10-16  0:24     ` Dmitry Torokhov
2019-10-03  6:12 ` [PATCH v3 3/5] dt-bindings: input: Add poll-interval property Michal Vokáč
2019-10-10 19:40   ` Rob Herring
2019-10-10 20:01     ` Dmitry Torokhov
2019-10-11  8:03       ` Michal Vokáč
2019-10-16  0:23         ` Dmitry Torokhov
2019-10-16  5:52           ` Michal Vokáč
2019-10-03  6:12 ` [PATCH v3 4/5] Input: mpr121: Add polling mode Michal Vokáč
2019-10-16  0:24   ` Dmitry Torokhov
2019-10-03  6:12 ` [PATCH v3 5/5] ARM: dts: imx6dl-yapp4: Enable the MPR121 touchkey controller on Hydra Michal Vokáč
2019-10-16  6:07   ` Michal Vokáč
2019-10-25  2:48     ` Shawn Guo

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).