Skip to contentSkip to conversation

dt-bindings: input: add Semtech SX951x binding

PATCH In review David Bauer 4 participants 9 messages May 5, 2025 – May 20, 2025

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

PATCH 1/2 dt-bindings: input: add Semtech SX951x binding

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

---
 .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
 1 file changed, 180 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +180 -0
new file mode 100644
index 000000000000..e4f938decd86
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |
+      The polling interval for touch events in milliseconds.
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      linux,keycodes:
+        maxItems: 1
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:
+        $ref: /schemas/leds/common.yaml#
+        type: object
+        unevaluatedProperties: false
+        description: |
+          Presence of this property indicates the channel
+          is used as an LED driver.
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/leds/common.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      touch@2b {
+        compatible = "semtech,sx9512";
+
+        reg = <0x2b>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        poll-interval = <100>;
+
+        channel@1 {
+          reg = <1>;
+
+          semtech,cin-delta = <0x3>;
+          semtech,sense-threshold = <0xff>;
+
+          linux,keycodes = <KEY_A>;
+        };
+
+        channel@2 {
+          reg = <2>;
+
+          semtech,cin-delta = <0x3>;
+          semtech,sense-threshold = <0xff>;
+
+          linux,keycodes = <KEY_B>;
+        };
+
+        channel@3 {
+          reg = <3>;
+
+          semtech,cin-delta = <0x3>;
+          semtech,sense-threshold = <0xff>;
+
+          linux,keycodes = <KEY_WPS_BUTTON>;
+        };
+
+        channel@4 {
+          reg = <4>;
+
+          led {
+            color = <LED_COLOR_ID_RED>;
+            function = LED_FUNCTION_WAN;
+          };
+        };
+
+        channel@5 {
+          reg = <5>;
+
+          led {
+            color = <LED_COLOR_ID_GREEN>;
+            function = LED_FUNCTION_WAN;
+          };
+        };
+
+        channel@6 {
+          reg = <6>;
+
+          led {
+            color = <LED_COLOR_ID_GREEN>;
+            function = LED_FUNCTION_WLAN;
+            linux,default-trigger = "phy1tx";
+          };
+        };
+
+        channel@7 {
+          reg = <7>;
+
+          led {
+            color = <LED_COLOR_ID_GREEN>;
+            function = LED_FUNCTION_WLAN;
+            linux,default-trigger = "phy0tx";
+          };
+        };
+      };
+    };
Signature · 1 line
2.47.2
#1 lore raw

PATCH 2/2 Input sx951x: add Semtech SX9512/SX9513 driver

The Semtech SX9512/SX9513 is a family of capacitive touch-keyboard controllers.

All chips offer 8 channel touch sensitive inputs with one LED driver per output channel.

The also SX9512 supports proximity detection which is currently not supported with the driver.

This chip can be found on the Genexis Pulse EX400 repeater platform.

---
 drivers/input/keyboard/Kconfig  |  11 +
 drivers/input/keyboard/Makefile |   1 +
 drivers/input/keyboard/sx951x.c | 490 ++++++++++++++++++++++++++++++++
 3 files changed, 502 insertions(+)
 create mode 100644 drivers/input/keyboard/sx951x.c
drivers/input/keyboard/Kconfig +11 -0
index 1d0c5f4c0f99..6dc397389c64 100644
@@ -616,6 +616,17 @@ config KEYBOARD_SUNKBD
 	  To compile this driver as a module, choose M here: the
 	  module will be called sunkbd.
 
+config KEYBOARD_SX951X
+	tristate "Semtech SX951X capacitive touch controller"
+	depends on OF && I2C
+	select REGMAP_I2C
+	help
+	  Say Y here to enable the Semtech SX9512/SX9153 capacitive
+	  touch controller driver.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called sx951x.
+
 config KEYBOARD_SH_KEYSC
 	tristate "SuperH KEYSC keypad support"
 	depends on ARCH_SHMOBILE || COMPILE_TEST
drivers/input/keyboard/Makefile +1 -0
index aecef00c5d09..e59ca83c30ec 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_KEYBOARD_STOWAWAY)		+= stowaway.o
 obj-$(CONFIG_KEYBOARD_ST_KEYSCAN)	+= st-keyscan.o
 obj-$(CONFIG_KEYBOARD_SUN4I_LRADC)	+= sun4i-lradc-keys.o
 obj-$(CONFIG_KEYBOARD_SUNKBD)		+= sunkbd.o
+obj-$(CONFIG_KEYBOARD_SX951X)		+= sx951x.o
 obj-$(CONFIG_KEYBOARD_TC3589X)		+= tc3589x-keypad.o
 obj-$(CONFIG_KEYBOARD_TEGRA)		+= tegra-kbc.o
 obj-$(CONFIG_KEYBOARD_TM2_TOUCHKEY)	+= tm2-touchkey.o
drivers/input/keyboard/sx951x.c new file +490 -0

490 lines not on this page · raw message

Signature · 1 line
2.47.2
maintainer
#2 lore raw

Re: [PATCH 2/2] Input sx951x: add Semtech SX9512/SX9513 driver

Hi David,

Quoted 26 lines · David Bauer

The Semtech SX9512/SX9513 is a family of capacitive touch-keyboard controllers.

All chips offer 8 channel touch sensitive inputs with one LED driver per output channel.

The also SX9512 supports proximity detection which is currently not supported with the driver.

This chip can be found on the Genexis Pulse EX400 repeater platform.

---
 drivers/input/keyboard/Kconfig  |  11 +
 drivers/input/keyboard/Makefile |   1 +
 drivers/input/keyboard/sx951x.c | 490 ++++++++++++++++++++++++++++++++
 3 files changed, 502 insertions(+)
 create mode 100644 drivers/input/keyboard/sx951x.c
drivers/input/keyboard/Kconfig +0 -0
index 1d0c5f4c0f99..6dc397389c64 100644

drivers/input/keyboard/Kconfig config KEYBOARD_SUNKBD · line 621

Quoted 6 lines
drivers/input/keyboard/Kconfig +3 -0
@@ -616,6 +616,17 @@ config KEYBOARD_SUNKBD
 	  To compile this driver as a module, choose M here: the
 	  module will be called sunkbd.
 
+config KEYBOARD_SX951X
+	tristate "Semtech SX951X capacitive touch controller"
+	depends on OF && I2C

I do not believe it should depend on OF. Please have the driver use generic device properties instead (device_property_*()).

...

drivers/input/keyboard/Kconfig config KEYBOARD_SUNKBD · line 627

Quoted 6 lines
drivers/input/keyboard/Kconfig +6 -0
+
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/input.h>
+ #include <linux/leds.h>
+ #include <linux/of.h>

You will likely need mod_devicetable.h instead of of.h.

drivers/input/keyboard/Kconfig config KEYBOARD_SUNKBD

Quoted 8 lines
drivers/input/keyboard/Kconfig +8 -0
+ #include <linux/regmap.h>
+ #include <linux/i2c.h>
+ #include <linux/gpio/consumer.h>
+ #include <linux/bitfield.h>
+
+ /* Generic properties */
+#define SX951X_I2C_ADDRESS		0x2b
+#define SX951XB_I2C_ADDRESS_		0x2d

Why underscore at the end?

...

drivers/input/keyboard/Kconfig

Quoted 9 lines
drivers/input/keyboard/Kconfig +9 -0
+
+#ifdef CONFIG_LEDS_CLASS
+		error = sx951x_led_init(priv, child, reg);
+		if (error) {
+			dev_err(dev, "Failed to initialize LED %d: %d\n",
+				reg, error);
+			return error;
+		}
+#endif

Please provide stub for sx951x_led_init() instead of using #ifdef here.

...

drivers/input/keyboard/Kconfig

Quoted 3 lines
drivers/input/keyboard/Kconfig +3 -0
+
+	priv = devm_kzalloc(dev,
+			    sizeof(struct sx951x_priv),

sizeof(*priv)

Thanks.

Signature · 1 line
Dmitry
#3 lore raw
In reply to David Bauer
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument, so you will not CC people just because they made one commit years ago). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Quoted 11 lines
---
 .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
 1 file changed, 180 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +0 -0
new file mode 100644
index 000000000000..e4f938decd86

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 9

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 20

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513

Devices are not compatible? What are the differences?

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 33

Quoted 13 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +13 -0
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |

Do not need '|' unless you need to preserve formatting. Same comment everywhere.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 34

Quoted 1 line
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +1 -0
+      The polling interval for touch events in milliseconds.

Missing -ms property unit suffix... unless you are using existing property from common schema, but I do not see any reference (and thus unevaluatedProperties at the end).

Quoted 12 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +12 -0
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 56

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      linux,keycodes:
+        maxItems: 1
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:

Use proper unit suffix and express it in pF.

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:

I think subnode is here not needed. This should be part of the channel, probably.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 88

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+        $ref: /schemas/leds/common.yaml#
+        type: object
+        unevaluatedProperties: false
+        description: |
+          Presence of this property indicates the channel
+          is used as an LED driver.
+
+    required:
+      - reg
+
+    additionalProperties: false

unevaluatedProperties instead

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
+
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 107

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/leds/common.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      touch@2b {
+        compatible = "semtech,sx9512";
+

Drop blank line

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 109

Quoted 2 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +2 -0
+        reg = <0x2b>;
+

Best regards,
Krzysztof

#4 lore raw

Hi Krzysztof,

thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

I'm a bit unsure what you are referring to - maybe I've set the options for get_maintainer.pl wrong, but i use

get_maintainer.pl --nogit --nogit-fallback --norolestats --nol

to determine TO recipients and

get_maintainer.pl --nogit --nogit-fallback --norolestats --nom

for CC destinations.

Granted, my tree was a bit out of date but it was from mainline and after rebase both commands returned consistent results.

Hope you can provide me with some guidance there.

Quoted 39 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument, so you will not CC people just because they made one commit years ago). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Quoted 11 lines
---
  .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
  1 file changed, 180 insertions(+)

create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml

Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +0 -0
new file mode 100644
index 000000000000..e4f938decd86

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 9

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 13 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 20

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513

Devices are not compatible? What are the differences?

The SX9513 is a cost-reduced version which does not support proximity sensing. With the current support of the driver they work identical. Should i add this information as a comment?

Quoted 40 lines
Quoted 4 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +3 -0
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |

Do not need '|' unless you need to preserve formatting. Same comment everywhere.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 34

Quoted 1 line
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +1 -0
+      The polling interval for touch events in milliseconds.

Missing -ms property unit suffix... unless you are using existing property from common schema, but I do not see any reference (and thus unevaluatedProperties at the end).

Quoted 16 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      linux,keycodes:
+        maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 56

Quoted 6 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +6 -0
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:

Use proper unit suffix and express it in pF.

To represent 2.3 and 3.8 pF, would it be better to represent in femtofarad?

Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 77

Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +5 -0
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:

I think subnode is here not needed. This should be part of the channel, probably.

Just to be sure - you mean to have a property "led" upon which instructs the channel to be used to drive an LED and include the LED specific properties in the node of the channel?

Quoted 43 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 88

Quoted 12 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+        $ref: /schemas/leds/common.yaml#
+        type: object
+        unevaluatedProperties: false
+        description: |
+          Presence of this property indicates the channel
+          is used as an LED driver.
+
+    required:
+      - reg
+
+    additionalProperties: false

unevaluatedProperties instead

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
+
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 107

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/leds/common.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      touch@2b {
+        compatible = "semtech,sx9512";
+

Drop blank line

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 109

Quoted 2 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +2 -0
+        reg = <0x2b>;
+

Best regards,
Krzysztof

maintainer
#5 lore raw
Quoted 22 lines · David Bauer

Hi Krzysztof,

thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

I'm a bit unsure what you are referring to - maybe I've set the options for get_maintainer.pl wrong, but i use

get_maintainer.pl --nogit --nogit-fallback --norolestats --nol

to determine TO recipients and

Quoted 8 lines

get_maintainer.pl --nogit --nogit-fallback --norolestats --nom

for CC destinations.

Granted, my tree was a bit out of date but it was from mainline and after rebase both commands returned consistent results.

Hope you can provide me with some guidance there.

Probably that I don't use 'robh+dt' for a while now. Just 'robh'.

Quoted 53 lines
Quoted 39 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument, so you will not CC people just because they made one commit years ago). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Quoted 11 lines
---
  .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
  1 file changed, 180 insertions(+)

create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml

Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +0 -0
new file mode 100644
index 000000000000..e4f938decd86

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 9

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 13 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 20

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513

Devices are not compatible? What are the differences?

Quoted 4 lines

The SX9513 is a cost-reduced version which does not support proximity sensing. With the current support of the driver they work identical. Should i add this information as a comment?

In the 'description' above, but not the driver support part.

Quoted 23 lines
Quoted 23 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 33

Quoted 13 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +13 -0
+
+  reg:
+    maxItems: 1
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |

Do not need '|' unless you need to preserve formatting. Same comment everywhere.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 34

Quoted 1 line
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +1 -0
+      The polling interval for touch events in milliseconds.

Missing -ms property unit suffix... unless you are using existing property from common schema, but I do not see any reference (and thus unevaluatedProperties at the end).

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +5 -0
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 47

Quoted 8 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +8 -0
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]

maximum: 7

Quoted 12 lines
Quoted 11 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 56

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
+
+      linux,keycodes:
+        maxItems: 1
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:

Use proper unit suffix and express it in pF.

Quoted 2 lines

To represent 2.3 and 3.8 pF, would it be better to represent in femtofarad?

Yes.

Quoted 25 lines
Quoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 77

Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +5 -0
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:

I think subnode is here not needed. This should be part of the channel, probably.

Quoted 3 lines

Just to be sure - you mean to have a property "led" upon which instructs the channel to be used to drive an LED and include the LED specific properties in the node of the channel?

Actually, I think it is fine as-is if the LED driver works simultaneously with the touch input and isn't mutually exclusive. The 'led' node is for the LED. The parent node is the driver/controller.

If they are mutually exclusive, then I'd say you want channel@[0-7] and led@[0-7] nodes at the same level.

Rob

#6 lore raw
In reply to David Bauer
Quoted 20 lines · David Bauer

Hi Krzysztof,

thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

I'm a bit unsure what you are referring to - maybe I've set the options for get_maintainer.pl wrong, but i use

get_maintainer.pl --nogit --nogit-fallback --norolestats --nol

Quoted 7 lines

to determine TO recipients and

get_maintainer.pl --nogit --nogit-fallback --norolestats --nom

for CC destinations.

Granted, my tree was a bit out of date but it was from mainline

Mainline means latest RC or maintainer tree or linux next. v5.0 is not mainline anymoer.

Quoted 3 lines

and after rebase both commands returned consistent results.

Hope you can provide me with some guidance there.

Well, read full reply. It is impossible to get such email address from above commands. Such email address does not exist since long time and it easy to prove - just git grep for it. No results, so how could it be printed by get_maintainers.pl?

If you disagree then please paste full output of:

$ git describe
$ git status
$ scripts/get_maintainer.pl 0*

I provided you extensive guideline exactly to avoid further trivial discussions about that triviality, so I would really appreciate if you followed it.

Quoted 54 lines
Quoted 40 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument, so you will not CC people just because they made one commit years ago). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Quoted 11 lines
---
  .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
  1 file changed, 180 insertions(+)

create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml

Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +0 -0
new file mode 100644
index 000000000000..e4f938decd86

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 9

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 13 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 20

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513

Devices are not compatible? What are the differences?

Quoted 4 lines

The SX9513 is a cost-reduced version which does not support proximity sensing. With the current support of the driver they work identical. Should i add this information as a comment?

So they are compatible and this should be expressed via fallback.

Quoted 79 lines
Quoted 41 lines
Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +3 -0
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |

Do not need '|' unless you need to preserve formatting. Same comment everywhere.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 34

Quoted 1 line
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +1 -0
+      The polling interval for touch events in milliseconds.

Missing -ms property unit suffix... unless you are using existing property from common schema, but I do not see any reference (and thus unevaluatedProperties at the end).

Quoted 16 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      linux,keycodes:
+        maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 56

Quoted 6 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +6 -0
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:

Use proper unit suffix and express it in pF.

To represent 2.3 and 3.8 pF, would it be better to represent in femtofarad?

Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 77

Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +5 -0
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:

I think subnode is here not needed. This should be part of the channel, probably.

Quoted 3 lines

Just to be sure - you mean to have a property "led" upon which instructs the channel to be used to drive an LED and include the LED specific properties in the node of the channel?

No, I do not mean a property led. I mean that child node should be folded into parent.

Best regards,
Krzysztof

#7 lore raw
Quoted 43 lines · Krzysztof Kozlowski
Quoted 20 lines · David Bauer

Hi Krzysztof,

thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

I'm a bit unsure what you are referring to - maybe I've set the options for get_maintainer.pl wrong, but i use

get_maintainer.pl --nogit --nogit-fallback --norolestats --nol

Quoted 7 lines

to determine TO recipients and

get_maintainer.pl --nogit --nogit-fallback --norolestats --nom

for CC destinations.

Granted, my tree was a bit out of date but it was from mainline

Mainline means latest RC or maintainer tree or linux next. v5.0 is not mainline anymoer.

Quoted 3 lines

and after rebase both commands returned consistent results.

Hope you can provide me with some guidance there.

Well, read full reply. It is impossible to get such email address from above commands. Such email address does not exist since long time and it easy to prove - just git grep for it. No results, so how could it be printed by get_maintainers.pl?

If you disagree then please paste full output of:

Quoted 7 lines
$ git describe
$ git status
$ scripts/get_maintainer.pl 0*

I provided you extensive guideline exactly to avoid further trivial discussions about that triviality, so I would really appreciate if you followed it.

Huh, I noticed I responded after two weeks so pretty late... Huh, exactly because of the reason why I asked to use up2date addresses - the mailbox used in this patchset is not being used/checked/accessed since long time and kernel since long time has correct address.

Best regards,
Krzysztof

#8 lore raw
In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 43 lines · Krzysztof Kozlowski
Quoted 20 lines · David Bauer

Hi Krzysztof,

thanks for the review.

Quoted 10 lines · Krzysztof Kozlowski
Quoted 4 lines · David Bauer

Add device-tree binding for the Semtech SX9512/SX9513 family of touch controllers with integrated LED driver.

You CC-ed an address, which suggests you do not work on mainline kernel or you do not use get_maintainers.pl/b4/patman. Please rebase and always work on mainline or start using mentioned tools, so correct addresses will be used.

I'm a bit unsure what you are referring to - maybe I've set the options for get_maintainer.pl wrong, but i use

get_maintainer.pl --nogit --nogit-fallback --norolestats --nol

Quoted 7 lines

to determine TO recipients and

get_maintainer.pl --nogit --nogit-fallback --norolestats --nom

for CC destinations.

Granted, my tree was a bit out of date but it was from mainline

Mainline means latest RC or maintainer tree or linux next. v5.0 is not mainline anymoer.

Quoted 3 lines

and after rebase both commands returned consistent results.

Hope you can provide me with some guidance there.

Well, read full reply. It is impossible to get such email address from above commands. Such email address does not exist since long time and it easy to prove - just git grep for it. No results, so how could it be printed by get_maintainers.pl?

If you disagree then please paste full output of:

Quoted 7 lines
$ git describe
$ git status
$ scripts/get_maintainer.pl 0*

I provided you extensive guideline exactly to avoid further trivial discussions about that triviality, so I would really appreciate if you followed it.

I did a complete new clone of my repository without changing the base-branch and now the script outputs the correct set of addresses. Be assured v2 will reach the correct inbox(es).

Sorry for the confusion here. Still appreciate you did point this out to me.

Quoted 142 lines
Quoted 55 lines
Quoted 41 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument, so you will not CC people just because they made one commit years ago). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Quoted 11 lines
---
   .../bindings/input/semtech,sx951x.yaml        | 180 ++++++++++++++++++
   1 file changed, 180 insertions(+)

create mode 100644 Documentation/devicetree/bindings/input/semtech,sx951x.yaml

Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +0 -0
new file mode 100644
index 000000000000..e4f938decd86

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 9

Quoted 9 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +9 -0
@@ -0,0 +1,180 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/semtech,sx951x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Semtech SX9512/SX9513 based capacitive touch sensors
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 13 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 20

Quoted 11 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+  The Semtech SX9512/SX9513 Family of capacitive touch controllers
+  with integrated LED drivers. The device communication is using I2C only.
+
+maintainers:
+  - David Bauer <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - semtech,sx9512
+      - semtech,sx9513

Devices are not compatible? What are the differences?

Quoted 4 lines

The SX9513 is a cost-reduced version which does not support proximity sensing. With the current support of the driver they work identical. Should i add this information as a comment?

So they are compatible and this should be expressed via fallback.

Quoted 79 lines
Quoted 41 lines
Quoted 5 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +3 -0
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  poll-interval:
+    default: 100
+    description: |

Do not need '|' unless you need to preserve formatting. Same comment everywhere.

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 34

Quoted 1 line
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +1 -0
+      The polling interval for touch events in milliseconds.

Missing -ms property unit suffix... unless you are using existing property from common schema, but I do not see any reference (and thus unevaluatedProperties at the end).

Quoted 16 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +16 -0
+
+patternProperties:
+  "^channel@[0-7]$":
+    $ref: input.yaml#
+    type: object
+    description: |
+      Each node represents a channel of the touch controller.
+      Each channel provides a capacitive touch sensor input and
+      an LED driver output.
+
+    properties:
+      reg:
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+      linux,keycodes:
+        maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 56

Quoted 6 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +6 -0
+        description: |
+          Specifies an array of numeric keycode values to
+          be used for the channels. If this property is
+          omitted, the channel is not used as a key.
+
+      semtech,cin-delta:

Use proper unit suffix and express it in pF.

To represent 2.3 and 3.8 pF, would it be better to represent in femtofarad?

Quoted 25 lines
Quoted 12 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +11 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+        default: 3
+        description: |
+          The capacitance delta which is used to detect a touch
+          or release event. The property value is mapped to a
+          farad range between 7pF and 2.3pF internally. The delta
+          becomes smaller the higher the value is.
+
+      semtech,sense-threshold:

Documentation/devicetree/bindings/input/semtech,sx951x.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/input/semtech,sx951x.yaml new file +10 -0
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 4
+        description: |
+          The threshold value after which the channel detects a touch.
+          Refer to the datasheet for the internal calculation of the
+          resulting touch sensitivity.
+
+      led:

I think subnode is here not needed. This should be part of the channel, probably.

Quoted 5 lines
Quoted 3 lines

Just to be sure - you mean to have a property "led" upon which instructs the channel to be used to drive an LED and include the LED specific properties in the node of the channel?

No, I do not mean a property led. I mean that child node should be folded into parent.

Okay, now i get it. The hardware supports the exclusive as well as combined use of channels as LED-driver and touch input.

In case the channel is not wired up to work as an input, the linux,keycodes property can be omitted, not creating the input channel.

In turn if the channel is not wired up to an LED, omitting the led subnode prevents an led device from being created for this channel.

If I were to fold the led subnode into the channel node I would still need a way to indicate if an LED is actually present in hardware, correct? This was what i was aiming for with the "led" property. However if I've had to choose between these two approaches, I prefer the subnode.

If you have a different idea how to handle this apart from Rob's suggestion, It could also be the case I'm creating more problems than I solve with this approach :)

Best
David