Skip to contentSkip to conversation

dt-bindings: Input: tm2-touchkey - convert to yaml

PATCH Applied Stephan Gerhold 4 participants 13 messages Dec 3, 2020 – Dec 10, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dt-bindings: Input: tm2-touchkey - convert to yaml

Convert the device tree bindings for tm2-touchkey to the YAML format.

While we're at it, clarify the descriptions a bit to make it clear that this driver can be used for many different MCUs that all implement a similar I2C protocol. Depending on the MCU the voltage requirements may be different, on some devices the controller uses 2.2V, 2.8V or even 3.3V for vcc-supply instead of 1.8V.

---
 .../bindings/input/cypress,tm2-touchkey.txt   | 33 ---------
 .../bindings/input/cypress,tm2-touchkey.yaml  | 68 +++++++++++++++++++
 2 files changed, 68 insertions(+), 33 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
 create mode 100644 Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt deleted +0 -33
deleted file mode 100644
index 921172f689b8..000000000000
@@ -1,33 +0,0 @@
-Samsung tm2-touchkey
-
-Required properties:
-- compatible:
-    * "cypress,tm2-touchkey" - for the touchkey found on the tm2 board
-    * "cypress,midas-touchkey" - for the touchkey found on midas boards
-    * "cypress,aries-touchkey" - for the touchkey found on aries boards
-    * "coreriver,tc360-touchkey" - for the Coreriver TouchCore 360 touchkey
-- reg: I2C address of the chip.
-- interrupts: interrupt to which the chip is connected (see interrupt
-	binding[0]).
-- vcc-supply : internal regulator output. 1.8V
-- vdd-supply : power supply for IC 3.3V
-
-Optional properties:
-- linux,keycodes: array of keycodes (max 4), default KEY_PHONE and KEY_BACK
-
-[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-
-Example:
-	&i2c0 {
-		/* ... */
-
-		touchkey@20 {
-			compatible = "cypress,tm2-touchkey";
-			reg = <0x20>;
-			interrupt-parent = <&gpa3>;
-			interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
-			vcc-supply=<&ldo32_reg>;
-			vdd-supply=<&ldo33_reg>;
-			linux,keycodes = <KEY_PHONE KEY_BACK>;
-		};
-	};
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
2.29.2
#1 lore raw

PATCH 2/3 dt-bindings: Input: tm2-touchkey - document vddio-supply

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Document support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

---
 .../devicetree/bindings/input/cypress,tm2-touchkey.yaml      | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml +5 -0
index 90d4def83182..52dca8b64081 100644
@@ -37,6 +37,11 @@ properties:
   vcc-supply:
     description: Optional regulator for MCU, 1.8V-3.3V (depending on MCU).
 
+  vddio-supply:
+    description: |
+      Optional regulator that provides digital I/O voltage,
+      e.g. for pulling up the interrupt line or the I2C pins.
+
   linux,keycodes:
     minItems: 1
     maxItems: 4
Signature · 1 line
2.29.2
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] dt-bindings: Input: tm2-touchkey - document vddio-supply

Quoted 10 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Document support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml properties: · line 43

Quoted 4 lines
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml +4 -0
+  vddio-supply:
+    description: |
+      Optional regulator that provides digital I/O voltage,
+      e.g. for pulling up the interrupt line or the I2C pins.

I think the funny pipe | us only needed when you want something to be fixed-width like ASCII art or ASCII tables. But no big deal I suppose.

Yours,
Linus Walleij

#3 lore raw

Re: [PATCH 2/3] dt-bindings: Input: tm2-touchkey - document vddio-supply

Quoted 15 lines · Linus Walleij
Quoted 10 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Document support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

Quoted 8 lines

Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml properties: · line 43

Quoted 4 lines
Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml +4 -0
+  vddio-supply:
+    description: |
+      Optional regulator that provides digital I/O voltage,
+      e.g. for pulling up the interrupt line or the I2C pins.

I think the funny pipe | us only needed when you want something to be fixed-width like ASCII art or ASCII tables. But no big deal I suppose.

Actually, the pipe | effectively means that new lines \n will be preserved in the parsed output, i.e.

something:
Hello
World

means "Hello World", while

something: |
Hello
World

means "Hello\nWorld\n".

In practice I guess it doesn't make much of a difference for these descriptions. It also doesn't seem to be used very consistently in existing device tree bindings, so I think it's fine as-is.

Thanks,
Stephan

#4 lore raw

Re: [PATCH 2/3] dt-bindings: Input: tm2-touchkey - document vddio-supply

Quoted 7 lines · Stephan Gerhold

Actually, the pipe | effectively means that new lines \n will be preserved in the parsed output, i.e.

something:
Hello
World

Quoted 7 lines

means "Hello World", while

something: |
Hello
World

means "Hello\nWorld\n".

Oh that's nice, I learned something new today :D

Combined with fixed-width font it will indeed preserve ASCII gfx too. But I don't know of a way to guarantee fixed-width :/

https://yaml-multiline.info/ explained even more. Nice!

Yours,
Linus Walleij

maintainer Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] dt-bindings: Input: tm2-touchkey - document vddio-supply

In reply to Stephan Gerhold
Quoted 5 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Quoted 9 lines

Document support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

---
 .../devicetree/bindings/input/cypress,tm2-touchkey.yaml      | 5 +++++
 1 file changed, 5 insertions(+)
maintainer Applied
#6 lore raw

Re: [PATCH 2/3] dt-bindings: Input: tm2-touchkey - document vddio-supply

In reply to Stephan Gerhold
Quoted 10 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Document support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

Applied, thank you.

Signature · 1 line
Dmitry
#7 lore raw

PATCH 3/3 Input: tm2-touchkey - add vddio regulator

In reply to Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Implement support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

---
 drivers/input/keyboard/tm2-touchkey.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/keyboard/tm2-touchkey.c +2 -1
index fb078e049413..6218b1c682ef 100644
@@ -48,7 +48,7 @@ struct tm2_touchkey_data {
 	struct input_dev *input_dev;
 	struct led_classdev led_dev;
 	struct regulator *vdd;
-	struct regulator_bulk_data regulators[2];
+	struct regulator_bulk_data regulators[3];
 	const struct touchkey_variant *variant;
 	u32 keycodes[4];
 	int num_keycodes;
@@ -204,6 +204,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
 
 	touchkey->regulators[0].supply = "vcc";
 	touchkey->regulators[1].supply = "vdd";
+	touchkey->regulators[2].supply = "vddio";
 	error = devm_regulator_bulk_get(&client->dev,
 					ARRAY_SIZE(touchkey->regulators),
 					touchkey->regulators);
Signature · 1 line
2.29.2
Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] Input: tm2-touchkey - add vddio regulator

Quoted 10 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Implement support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

Yours,
Linus Walleij

maintainer Applied
#9 lore raw

Re: [PATCH 3/3] Input: tm2-touchkey - add vddio regulator

In reply to Stephan Gerhold
Quoted 10 lines · Stephan Gerhold

The Samsung touchkey controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail.

Implement support for a "vddio-supply" that is enabled by the tm2-touchkey driver so that the regulator gets enabled when needed.

Applied, thank you.

Signature · 1 line
Dmitry
Reviewed-by on v1 1/3
#10 lore raw
In reply to Stephan Gerhold
Quoted 10 lines · Stephan Gerhold

Convert the device tree bindings for tm2-touchkey to the YAML format.

While we're at it, clarify the descriptions a bit to make it clear that this driver can be used for many different MCUs that all implement a similar I2C protocol. Depending on the MCU the voltage requirements may be different, on some devices the controller uses 2.2V, 2.8V or even 3.3V for vcc-supply instead of 1.8V.

LGTM

Yours,
Linus Walleij

maintainer Reviewed-by on v1 1/3
#11 lore raw
In reply to Stephan Gerhold
Quoted 8 lines · Stephan Gerhold

Convert the device tree bindings for tm2-touchkey to the YAML format.

While we're at it, clarify the descriptions a bit to make it clear that this driver can be used for many different MCUs that all implement a similar I2C protocol. Depending on the MCU the voltage requirements may be different, on some devices the controller uses 2.2V, 2.8V or even 3.3V for vcc-supply instead of 1.8V.

Quoted 9 lines
---
 .../bindings/input/cypress,tm2-touchkey.txt   | 33 ---------
 .../bindings/input/cypress,tm2-touchkey.yaml  | 68 +++++++++++++++++++
 2 files changed, 68 insertions(+), 33 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/cypress,tm2-touchkey.txt
 create mode 100644 Documentation/devicetree/bindings/input/cypress,tm2-touchkey.yaml
maintainer Applied
#12 lore raw
In reply to Stephan Gerhold
Quoted 10 lines · Stephan Gerhold

Convert the device tree bindings for tm2-touchkey to the YAML format.

While we're at it, clarify the descriptions a bit to make it clear that this driver can be used for many different MCUs that all implement a similar I2C protocol. Depending on the MCU the voltage requirements may be different, on some devices the controller uses 2.2V, 2.8V or even 3.3V for vcc-supply instead of 1.8V.

Applied, thank you.

Signature · 1 line
Dmitry