Skip to contentSkip to conversation

WIP: dt-bindings: input: microchip,cap11xx: Convert txt bindings to yaml

PATCH In review David Heidelberg 2 participants 2 messages Oct 9, 2021 – Oct 19, 2021

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

PATCH 1/1 WIP: dt-bindings: input: microchip,cap11xx: Convert txt bindings to yaml

Convert binding for the Microchip CAP11xx series HW to the YAML syntax.

---
 .../devicetree/bindings/input/cap11xx.txt     |  78 ----------
 .../bindings/input/microchip,cap11xx.yaml     | 146 ++++++++++++++++++
 2 files changed, 146 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/cap11xx.txt
 create mode 100644 Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
Documentation/devicetree/bindings/input/cap11xx.txt deleted +0 -78
deleted file mode 100644
index 8c67a0b5058d..000000000000
@@ -1,78 +0,0 @@
-Device tree bindings for Microchip CAP11xx based capacitive touch sensors
-
-The node for this device must be a child of a I2C controller node, as the
-device communication via I2C only.
-
-Required properties:
-
-	compatible:		Must contain one of:
-					"microchip,cap1106"
-					"microchip,cap1126"
-					"microchip,cap1188"
-
-	reg:			The I2C slave address of the device.
-
-	interrupts:		Property describing the interrupt line the
-				device's ALERT#/CM_IRQ# pin is connected to.
-				The device only has one interrupt source.
-
-Optional properties:
-
-	autorepeat:		Enables the Linux input system's autorepeat
-				feature on the input device.
-
-	microchip,sensor-gain:	Defines the gain of the sensor circuitry. This
-				effectively controls the sensitivity, as a
-				smaller delta capacitance is required to
-				generate the same delta count values.
-				Valid values are 1, 2, 4, and 8.
-				By default, a gain of 1 is set.
-
-	microchip,irq-active-high:	By default the interrupt pin is active low
-				open drain. This property allows using the active
-				high push-pull output.
-
-	linux,keycodes:		Specifies an array of numeric keycode values to
-				be used for the channels. If this property is
-				omitted, KEY_A, KEY_B, etc are used as
-				defaults. The array must have exactly six
-				entries.
-
-Example:
-
-i2c_controller {
-	cap1106@28 {
-		compatible = "microchip,cap1106";
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 0>;
-		reg = <0x28>;
-		autorepeat;
-		microchip,sensor-gain = <2>;
-
-		linux,keycodes = <103>,		/* KEY_UP */
-				 <106>,		/* KEY_RIGHT */
-				 <108>,		/* KEY_DOWN */
-				 <105>,		/* KEY_LEFT */
-				 <109>,		/* KEY_PAGEDOWN */
-				 <104>;		/* KEY_PAGEUP */
-
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		usr@0 {
-			label = "cap11xx:green:usr0";
-			reg = <0>;
-		};
-
-		usr@1 {
-			label = "cap11xx:green:usr1";
-			reg = <1>;
-		};
-
-		alive@2 {
-			label = "cap11xx:green:alive";
-			reg = <2>;
-			linux,default_trigger = "heartbeat";
-		};
-	};
-}
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
2.33.0
maintainer
#1 lore raw
Quoted 21 lines · David Heidelberg

Convert binding for the Microchip CAP11xx series HW to the YAML syntax.

---
 .../devicetree/bindings/input/cap11xx.txt     |  78 ----------
 .../bindings/input/microchip,cap11xx.yaml     | 146 ++++++++++++++++++
 2 files changed, 146 insertions(+), 78 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/cap11xx.txt
 create mode 100644 Documentation/devicetree/bindings/input/microchip,cap11xx.yaml
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +4 -0
new file mode 100644
index 000000000000..89079c019794
@@ -0,0 +1,146 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/input/microchip,cap11xx.yaml#"

Documentation/devicetree/bindings/input/microchip,cap11xx.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +10 -0
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Device tree bindings for Microchip CAP11xx based capacitive touch sensors
+
+description: |
+  The Microchip CAP1xxx Family of RightTouchTM multiple-channel capacitive
+  touch controllers and LED drivers. The device communication via I2C only.
+
+maintainers:
+  - Rob Herring <[email protected]>

[email protected]

But why isn't this the author of the binding or driver.

Documentation/devicetree/bindings/input/microchip,cap11xx.yaml line 27

Quoted 13 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +13 -0
+
+properties:
+  compatible:
+    enum:
+      - microchip,cap1106
+      - microchip,cap1126
+      - microchip,cap1188
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1

blank line

Quoted 35 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +35 -0
+  '#size-cells':
+    const: 0
+
+  interrupts:
+    maxItems: 1
+    description: |
+      Property describing the interrupt line the
+      device's ALERT#/CM_IRQ# pin is connected to.
+      The device only has one interrupt source.
+
+  autorepeat:
+    description: |
+      Enables the Linux input system's autorepeat feature on the input device.
+
+  linux,keycodes:
+    minItems: 6
+    maxItems: 6
+    description: |
+      Specifies an array of numeric keycode values to
+      be used for the channels. If this property is
+      omitted, KEY_A, KEY_B, etc are used as defaults.
+      The array must have exactly six entries.
+
+  microchip,sensor-gain:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    default: 1
+    enum: [1, 2, 4, 8]
+    description: |
+      Defines the gain of the sensor circuitry. This
+      effectively controls the sensitivity, as a
+      smaller delta capacitance is required to
+      generate the same delta count values.
+
+  microchip,irq-active-high:
+    type: boolean

Documentation/devicetree/bindings/input/microchip,cap11xx.yaml line 72

Quoted 10 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +10 -0
+    description: |
+      By default the interrupt pin is active low
+      open drain. This property allows using the active
+      high push-pull output.
+
+patternProperties:
+  "^led@[0-7]$":
+    type: object
+    description: CAP11xx LEDs
+    $ref: ../leds/common.yaml#

/schemas/leds/common.yaml#

Quoted 7 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +7 -0
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      label: true
+

Documentation/devicetree/bindings/input/microchip,cap11xx.yaml line 89

Quoted 10 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +10 -0
+      linux,default-trigger: true
+
+      default-state: true
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+allOf:

- $ref: input.yaml#

Quoted 61 lines
Documentation/devicetree/bindings/input/microchip,cap11xx.yaml new file +57 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,cap1106
+    then:
+      patternProperties:
+        "^led@[0-7]$": false
+
+required:
+  - compatible
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      cap1188@28 {
+        compatible = "microchip,cap1188";
+        interrupt-parent = <&gpio1>;
+        interrupts = <0 0>;
+        reg = <0x28>;
+        autorepeat;
+        microchip,sensor-gain = <2>;
+
+        linux,keycodes = <103>,	/* KEY_UP */
+                         <106>,	/* KEY_RIGHT */
+                         <108>,	/* KEY_DOWN */
+                         <105>,	/* KEY_LEFT */
+                         <109>,	/* KEY_PAGEDOWN */
+                         <104>;	/* KEY_PAGEUP */
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led@0 {
+                label = "cap11xx:green:usr0";
+                reg = <0>;
+        };
+
+        led@1 {
+                label = "cap11xx:green:usr1";
+                reg = <1>;
+        };
+
+        led@2 {
+                label = "cap11xx:green:alive";
+                reg = <2>;
+                linux,default-trigger = "heartbeat";
+        };
+      };
+    };
Signature · 1 line
2.33.0