Skip to contentSkip to conversation

Add support for Azoteq IQS626A

PATCH Superseded Jeff LaBundy 3 participants 10 messages Jan 24, 2021 – Mar 23, 2021

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for Azoteq IQS626A

This series introduces support for the Azoteq IQS626A capacitive touch controller, a highly flexible multifunction sensor targeting wearable applications. It is a close cousin to the IQS269A with the following key differences:

- Channel count increases from 8 to 14.
- Channels are assigned dedicated functions as follows:
- ULP (ultra-low power): a single channel that continues to be sampled during the device's lowest-power sensing mode for wake-up signaling.
- Trackpad: a group of 6 or 9 channels forming a capacitive trackpad with gesture support.
- Generic: 3 independent channels capable of capacitive or inductive sensing, plus much more.
- Hall: a single channel leveraging a pair of internal Hall-effect plates serving lid or dock detection.
- Each channel (or group of channels) has a unique collection of configurable parameters rather than common parameters for every channel.

Channels and events reported by the channels are configured using the device tree, similar to what was done for the IQS269A.

Also included are some preparatory patches that move the touchscreen helper functions into the core input directory, allowing them to be leveraged by multimodal devices like the IQS626A.

A demo is shown in the following video: https://youtu.be/n0Q5BXYFIgI

Jeff LaBundy (5):
input: touchscreen: Move helper functions to core
input: touchscreen: Broaden use-cases described in comments
dt-bindings: input: touchscreen: Move helper bindings to core
dt-bindings: input: Add bindings for Azoteq IQS626A
input: Add support for Azoteq IQS626A

 .../devicetree/bindings/input/elan_i2c.txt         |    2 +-
 .../devicetree/bindings/input/iqs626a.yaml         |  843 +++++++++
 .../devicetree/bindings/input/touchscreen.txt      |    1 +
 .../devicetree/bindings/input/touchscreen.yaml     |   83 +
 .../bindings/input/touchscreen/ads7846.txt         |    2 +-
 .../bindings/input/touchscreen/bu21013.txt         |    2 +-
 .../input/touchscreen/cypress,cy8ctma140.yaml      |    2 +-
 .../bindings/input/touchscreen/edt-ft5x06.yaml     |    2 +-
 .../bindings/input/touchscreen/eeti,exc3000.yaml   |    2 +-
 .../input/touchscreen/elan,elants_i2c.yaml         |    2 +-
 .../bindings/input/touchscreen/goodix.yaml         |    2 +-
 .../bindings/input/touchscreen/iqs5xx.txt          |    2 +-
 .../bindings/input/touchscreen/mms114.txt          |    2 +-
 .../bindings/input/touchscreen/touchscreen.txt     |    1 -
 .../bindings/input/touchscreen/touchscreen.yaml    |   83 -
 drivers/input/Makefile                             |    1 +
 drivers/input/misc/Kconfig                         |   11 +
 drivers/input/misc/Makefile                        |    1 +
 drivers/input/misc/iqs626a.c                       | 1837 ++++++++++++++++++++
 drivers/input/touchscreen.c                        |  207 +++
 drivers/input/touchscreen/Kconfig                  |    4 -
 drivers/input/touchscreen/Makefile                 |    1 -
 drivers/input/touchscreen/of_touchscreen.c         |  206 ---
 23 files changed, 2994 insertions(+), 305 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/iqs626a.yaml
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
 create mode 100644 drivers/input/misc/iqs626a.c
 create mode 100644 drivers/input/touchscreen.c
 delete mode 100644 drivers/input/touchscreen/of_touchscreen.c

--
2.7.4

#1 lore raw

PATCH v2 1/5 input: touchscreen: Move helper functions to core

Some devices outside of drivers/input/touchscreen/ can still make use of the touchscreen helper functions. Therefore, it was agreed in [1] to move them outside of drivers/input/touchscreen/ so that other devices can call them without INPUT_TOUCHSCREEN being set.

As part of this change, 'of' is dropped from the filename because the helpers no longer actually use OF. No changes are made to the file contents whatsoever.

[1] https://patchwork.kernel.org/patch/11924029/

---
Changes in v2:
- Added this patch to the series

 drivers/input/Makefile                     |   1 +
 drivers/input/touchscreen.c                | 206 +++++++++++++++++++++++++++++
 drivers/input/touchscreen/Kconfig          |   4 -
 drivers/input/touchscreen/Makefile         |   1 -
 drivers/input/touchscreen/of_touchscreen.c | 206 -----------------------------
 5 files changed, 207 insertions(+), 211 deletions(-)
 create mode 100644 drivers/input/touchscreen.c
 delete mode 100644 drivers/input/touchscreen/of_touchscreen.c
drivers/input/Makefile +1 -0
index d8f5310..037cc59 100644
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_INPUT)		+= input-core.o
 input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o
+input-core-y += touchscreen.o
 
 obj-$(CONFIG_INPUT_FF_MEMLESS)	+= ff-memless.o
 obj-$(CONFIG_INPUT_SPARSEKMAP)	+= sparse-keymap.o
drivers/input/touchscreen.c new file +206 -0

206 lines not on this page · raw message

drivers/input/touchscreen/Kconfig +0 -4
index f012fe7..4c33278 100644
@@ -12,10 +12,6 @@ menuconfig INPUT_TOUCHSCREEN
 
 if INPUT_TOUCHSCREEN
 
-config TOUCHSCREEN_PROPERTIES
-	def_tristate INPUT
-	depends on INPUT
-
 config TOUCHSCREEN_88PM860X
 	tristate "Marvell 88PM860x touchscreen"
 	depends on MFD_88PM860X
drivers/input/touchscreen/Makefile +0 -1
index 6233541..80cd241 100644
@@ -7,7 +7,6 @@
 
 wm97xx-ts-y := wm97xx-core.o
 
-obj-$(CONFIG_TOUCHSCREEN_PROPERTIES)	+= of_touchscreen.o
 obj-$(CONFIG_TOUCHSCREEN_88PM860X)	+= 88pm860x-ts.o
 obj-$(CONFIG_TOUCHSCREEN_AD7877)	+= ad7877.o
 obj-$(CONFIG_TOUCHSCREEN_AD7879)	+= ad7879.o
drivers/input/touchscreen/of_touchscreen.c deleted +0 -206

206 lines not on this page · raw message

--
2.7.4

#2 lore raw

PATCH v2 2/5 input: touchscreen: Broaden use-cases described in comments

In reply to Jeff LaBundy

Now that the helper functions have been moved to drivers/input/ so that all input devices may use them, the introductory comments can be updated to remove any implication that the helper functions are solely limited to touchscreens.

This patch also scrubs any remaining use of 'DT' since there isn't any actual dependency on OF. A minor spelling error is resolved as well ('setups' -> 'sets up').

---
Changes in v2:
- Added this patch to the series

 drivers/input/touchscreen.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/input/touchscreen.c +6 -5
index 97342e1..46cf25c 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- *  Generic DT helper functions for touchscreen devices
+ *  Generic helper functions for touchscreens and other two-dimensional
+ *  pointing devices
  *
  *  Copyright (c) 2014 Sebastian Reichel <[email protected]>
  */
@@ -37,7 +38,7 @@ static void touchscreen_set_params(struct input_dev *dev,
 
 	if (!test_bit(axis, dev->absbit)) {
 		dev_warn(&dev->dev,
-			 "DT specifies parameters but the axis %lu is not set up\n",
+			 "Parameters are specified but the axis %lu is not set up\n",
 			 axis);
 		return;
 	}
@@ -49,7 +50,7 @@ static void touchscreen_set_params(struct input_dev *dev,
 }
 
 /**
- * touchscreen_parse_properties - parse common touchscreen DT properties
+ * touchscreen_parse_properties - parse common touchscreen properties
  * @input: input device that should be parsed
  * @multitouch: specifies whether parsed properties should be applied to
  *	single-touch or multi-touch axes
@@ -57,9 +58,9 @@ static void touchscreen_set_params(struct input_dev *dev,
  *	axis swap and invert info for use with touchscreen_report_x_y();
  *	or %NULL
  *
- * This function parses common DT properties for touchscreens and setups the
+ * This function parses common properties for touchscreens and sets up the
  * input device accordingly. The function keeps previously set up default
- * values if no value is specified via DT.
+ * values if no value is specified.
  */
 void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
 				  struct touchscreen_properties *prop)

--
2.7.4

#3 lore raw

PATCH v2 3/5 dt-bindings: input: touchscreen: Move helper bindings to core

In reply to Jeff LaBundy

With the helper functions moving to /drivers/input/ following the discussion in [1], touchscreen.yaml and touchscreen.txt are moved one level up as well to maintain a consistent directory structure.

No changes are made to either file except to update the $id field in touchscreen.yaml to reflect the new path. The handful of .yaml bindings that reference the original relative path are updated as well.

Last but not least, the handful of .txt bindings that included an absolute path to touchscreen.txt are updated too.

[1] https://patchwork.kernel.org/patch/11924029/

---
Changes in v2:
- Added this patch to the series

 .../devicetree/bindings/input/elan_i2c.txt         |  2 +-
 .../devicetree/bindings/input/touchscreen.txt      |  1 +
 .../devicetree/bindings/input/touchscreen.yaml     | 83 ++++++++++++++++++++++
 .../bindings/input/touchscreen/ads7846.txt         |  2 +-
 .../bindings/input/touchscreen/bu21013.txt         |  2 +-
 .../input/touchscreen/cypress,cy8ctma140.yaml      |  2 +-
 .../bindings/input/touchscreen/edt-ft5x06.yaml     |  2 +-
 .../bindings/input/touchscreen/eeti,exc3000.yaml   |  2 +-
 .../input/touchscreen/elan,elants_i2c.yaml         |  2 +-
 .../bindings/input/touchscreen/goodix.yaml         |  2 +-
 .../bindings/input/touchscreen/iqs5xx.txt          |  2 +-
 .../bindings/input/touchscreen/mms114.txt          |  2 +-
 .../bindings/input/touchscreen/touchscreen.txt     |  1 -
 .../bindings/input/touchscreen/touchscreen.yaml    | 83 ----------------------
 14 files changed, 94 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
Documentation/devicetree/bindings/input/elan_i2c.txt +1 -1
index 9963247..f11c8e1 100644
@@ -26,7 +26,7 @@ Optional properties:
 
 [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 [1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
-[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
+[2]: Documentation/devicetree/bindings/input/touchscreen.txt
 
 Example:
 	&i2c1 {
Documentation/devicetree/bindings/input/touchscreen.txt new file +1 -0
new file mode 100644
index 0000000..e1adb90
@@ -0,0 +1 @@
+See touchscreen.yaml
Documentation/devicetree/bindings/input/touchscreen.yaml new file +83 -0

83 lines not on this page · raw message

Documentation/devicetree/bindings/input/touchscreen/ads7846.txt +1 -1
index 81f6bda..b158a86 100644
@@ -69,7 +69,7 @@ Optional properties:
 	touchscreen-swapped-x-y		General touchscreen binding, see [1].
 
 [1] All general touchscreen properties are described in
-    Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt.
+    Documentation/devicetree/bindings/input/touchscreen.txt.
 
 Deprecated properties:
 
Documentation/devicetree/bindings/input/touchscreen/bu21013.txt +1 -1
index da4c9d8..e056a5f 100644
@@ -17,7 +17,7 @@ Optional properties:
  - touchscreen-swapped-x-y : General touchscreen binding, see [1].
 
 [1] All general touchscreen properties are described in
-    Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt.
+    Documentation/devicetree/bindings/input/touchscreen.txt.
 
 Deprecated properties:
  - rohm,touch-max-x        : Maximum outward permitted limit in the X axis
Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma140.yaml +1 -1
index 3225c8d..900e112 100644
@@ -10,7 +10,7 @@ maintainers:
   - Linus Walleij <[email protected]>
 
 allOf:
-  - $ref: touchscreen.yaml#
+  - $ref: ../touchscreen.yaml#
 
 properties:
   compatible:
Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml +1 -1
index 4ce1094..3d73fe3 100644
@@ -18,7 +18,7 @@ maintainers:
   - Dmitry Torokhov <[email protected]>
 
 allOf:
-  - $ref: touchscreen.yaml#
+  - $ref: ../touchscreen.yaml#
   - if:
       properties:
         compatible:
Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml +1 -1
index 007adbc..b1beb61 100644
@@ -10,7 +10,7 @@ maintainers:
   - Dmitry Torokhov <[email protected]>
 
 allOf:
-  - $ref: touchscreen.yaml#
+  - $ref: ../touchscreen.yaml#
 
 properties:
   compatible:
Documentation/devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml +1 -1
index a792d63..d3fabaf 100644
@@ -10,7 +10,7 @@ maintainers:
   - David Heidelberg <[email protected]>
 
 allOf:
-  - $ref: touchscreen.yaml#
+  - $ref: ../touchscreen.yaml#
 
 properties:
   compatible:
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml +1 -1
index da5b0d8..5bea19a 100644
@@ -10,7 +10,7 @@ maintainers:
   - Dmitry Torokhov <[email protected]>
 
 allOf:
-  - $ref: touchscreen.yaml#
+  - $ref: ../touchscreen.yaml#
 
 properties:
   compatible:
Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt +1 -1
index efa0820..d9c107e 100644
@@ -56,7 +56,7 @@ Optional properties:
 
 [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 [1]: Documentation/devicetree/bindings/gpio/gpio.txt
-[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
+[2]: Documentation/devicetree/bindings/input/touchscreen.txt
 
 Example:
 
Documentation/devicetree/bindings/input/touchscreen/mms114.txt +1 -1
index 707234c..4c28a30 100644
@@ -18,7 +18,7 @@ Optional properties:
 - touchscreen-inverted-y: See [1]
 - touchscreen-swapped-x-y: See [1]
 
-[1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
+[1]: Documentation/devicetree/bindings/input/touchscreen.txt
 
 Example:
 
Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt deleted +0 -1
deleted file mode 100644
index e1adb90..0000000
@@ -1 +0,0 @@
-See touchscreen.yaml
Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml deleted +0 -83

83 lines not on this page · raw message

--
2.7.4

#9 lore raw

PATCH v2 5/5 input: Add support for Azoteq IQS626A

In reply to Jeff LaBundy

This patch adds support for the Azoteq IQS626A capacitive touch controller.

---
Changes in v2:
- Dropped guards for CONFIG_TOUCHSCREEN_PROPERTIES

 drivers/input/misc/Kconfig   |   11 +
 drivers/input/misc/Makefile  |    1 +
 drivers/input/misc/iqs626a.c | 1837 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1849 insertions(+)
 create mode 100644 drivers/input/misc/iqs626a.c
drivers/input/misc/Kconfig +11 -0
index ad1b6c9..bbab23a 100644
@@ -752,6 +752,17 @@ config INPUT_IQS269A
 	  To compile this driver as a module, choose M here: the
 	  module will be called iqs269a.
 
+config INPUT_IQS626A
+	tristate "Azoteq IQS626A capacitive touch controller"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say Y to enable support for the Azoteq IQS626A capacitive
+	  touch controller.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called iqs626a.
+
 config INPUT_CMA3000
 	tristate "VTI CMA3000 Tri-axis accelerometer"
 	help
drivers/input/misc/Makefile +1 -0
index 7f202ba..034c80a7 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_INPUT_HISI_POWERKEY)	+= hisi_powerkey.o
 obj-$(CONFIG_HP_SDC_RTC)		+= hp_sdc_rtc.o
 obj-$(CONFIG_INPUT_IMS_PCU)		+= ims-pcu.o
 obj-$(CONFIG_INPUT_IQS269A)		+= iqs269a.o
+obj-$(CONFIG_INPUT_IQS626A)		+= iqs626a.o
 obj-$(CONFIG_INPUT_IXP4XX_BEEPER)	+= ixp4xx-beeper.o
 obj-$(CONFIG_INPUT_KEYSPAN_REMOTE)	+= keyspan_remote.o
 obj-$(CONFIG_INPUT_KXTJ9)		+= kxtj9.o
drivers/input/misc/iqs626a.c new file +1837 -0

1,837 lines not on this page · raw message

--
2.7.4

#7 lore raw

PATCH v2 4/5 dt-bindings: input: Add bindings for Azoteq IQS626A

In reply to Jeff LaBundy

This patch adds device tree bindings for the Azoteq IQS626A capacitive touch controller.

---
Changes in v2:
- Added missing $ref to touchscreen.yaml

 .../devicetree/bindings/input/iqs626a.yaml         | 843 +++++++++++++++++++++
 1 file changed, 843 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/iqs626a.yaml
Documentation/devicetree/bindings/input/iqs626a.yaml new file +843 -0
new file mode 100644
index 0000000..679971e
@@ -0,0 +1,843 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/iqs626a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Azoteq IQS626A Capacitive Touch Controller
+
+maintainers:
+  - Jeff LaBundy <[email protected]>
+
+description: |
+  The Azoteq IQS626A is a 14-channel capacitive touch controller that features
+  additional Hall-effect and inductive sensing capabilities.
+
+  Link to datasheet: https://www.azoteq.com/
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: azoteq,iqs626a
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  azoteq,suspend-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    default: 0
+    description: |
+      Specifies the power mode during suspend as follows:
+      0: Automatic (same as normal runtime, i.e. suspend/resume disabled)
+      1: Low power (all sensing at a reduced reporting rate)
+      2: Ultra-low power (ULP channel proximity sensing)
+      3: Halt (no sensing)
+
+  azoteq,clk-div:
+    type: boolean
+    description: Divides the device's core clock by a factor of 4.
+
+  azoteq,ulp-enable:
+    type: boolean
+    description:
+      Permits the device to automatically enter ultra-low-power mode from low-
+      power mode.
+
+  azoteq,ulp-update:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3, 4, 5, 6, 7]
+    default: 3
+    description: |
+      Specifies the rate at which the trackpad, generic and Hall channels are
+      updated during ultra-low-power mode as follows:
+      0: 8
+      1: 13
+      2: 28
+      3: 54
+      4: 89
+      5: 135
+      6: 190
+      7: 256
+
+  azoteq,ati-band-disable:
+    type: boolean
+    description: Disables the ATI band check.
+
+  azoteq,ati-lp-only:
+    type: boolean
+    description: Limits automatic ATI to low-power mode.
+
+  azoteq,gpio3-select:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3, 4, 5, 6, 7]
+    default: 1
+    description: |
+      Selects the channel or group of channels for which the GPIO3 pin
+      represents touch state as follows:
+      0: None
+      1: ULP channel
+      2: Trackpad
+      3: Trackpad
+      4: Generic channel 0
+      5: Generic channel 1
+      6: Generic channel 2
+      7: Hall channel
+
+  azoteq,reseed-select:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    default: 0
+    description: |
+      Specifies the event(s) that prompt the device to reseed (i.e. reset the
+      long-term average) of an associated channel as follows:
+      0: None
+      1: Proximity
+      2: Proximity or touch
+      3: Proximity, touch or deep touch
+
+  azoteq,thresh-extend:
+    type: boolean
+    description: Multiplies all touch and deep-touch thresholds by 4.
+
+  azoteq,tracking-enable:
+    type: boolean
+    description:
+      Enables all associated channels to track their respective reference
+      channels.
+
+  azoteq,reseed-offset:
+    type: boolean
+    description:
+      Applies an 8-count offset to all long-term averages upon either ATI or
+      reseed events.
+
+  azoteq,rate-np-ms:
+    minimum: 0
+    maximum: 255
+    default: 150
+    description: Specifies the report rate (in ms) during normal-power mode.
+
+  azoteq,rate-lp-ms:
+    minimum: 0
+    maximum: 255
+    default: 150
+    description: Specifies the report rate (in ms) during low-power mode.
+
+  azoteq,rate-ulp-ms:
+    multipleOf: 16
+    minimum: 0
+    maximum: 4080
+    default: 0
+    description: Specifies the report rate (in ms) during ultra-low-power mode.
+
+  azoteq,timeout-pwr-ms:
+    multipleOf: 512
+    minimum: 0
+    maximum: 130560
+    default: 2560
+    description:
+      Specifies the length of time (in ms) to wait for an event before moving
+      from normal-power mode to low-power mode, or (if 'azoteq,ulp-enable' is
+      present) from low-power mode to ultra-low-power mode.
+
+  azoteq,timeout-lta-ms:
+    multipleOf: 512
+    minimum: 0
+    maximum: 130560
+    default: 40960
+    description:
+      Specifies the length of time (in ms) to wait before resetting the long-
+      term average of all channels. Specify the maximum timeout to disable it
+      altogether.
+
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true
+
+patternProperties:
+  "^ulp-0|generic-[0-2]|hall$":
+    type: object
+    description:
+      Represents a single sensing channel. A channel is active if defined and
+      inactive otherwise.
+
+    properties:
+      azoteq,ati-exclude:
+        type: boolean
+        description:
+          Prevents the channel from participating in an ATI event that is
+          manually triggered during initialization.
+
+      azoteq,reseed-disable:
+        type: boolean
+        description:
+          Prevents the channel from being reseeded if the long-term average
+          timeout (defined in 'azoteq,timeout-lta') expires.
+
+      azoteq,meas-cap-decrease:
+        type: boolean
+        description:
+          Decreases the internal measurement capacitance from 60 pF to 15 pF.
+
+      azoteq,rx-inactive:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2]
+        default: 0
+        description: |
+          Specifies how inactive CRX pins are to be terminated as follows:
+          0: VSS
+          1: Floating
+          2: VREG (generic channels only)
+
+      azoteq,linearize:
+        type: boolean
+        description:
+          Enables linearization of the channel's counts (generic and Hall
+          channels) or inverts the polarity of the channel's proximity or
+          touch states (ULP channel).
+
+      azoteq,dual-direction:
+        type: boolean
+        description:
+          Specifies that the channel's long-term average is to freeze in the
+          presence of either increasing or decreasing counts, thereby permit-
+          ting events to be reported in either direction.
+
+      azoteq,filt-disable:
+        type: boolean
+        description: Disables raw count filtering for the channel.
+
+      azoteq,ati-mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        description: |
+          Specifies the channel's ATI mode as follows:
+          0: Disabled
+          1: Semi-partial
+          2: Partial
+          3: Full
+
+          The default value is a function of the channel and the device's reset
+          user interface (RUI); reference the datasheet for further information
+          about the available RUI options.
+
+      azoteq,ati-base:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [75, 100, 150, 200]
+        description:
+          Specifies the channel's ATI base. The default value is a function
+          of the channel and the device's RUI.
+
+      azoteq,ati-target:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        multipleOf: 32
+        minimum: 0
+        maximum: 2016
+        description:
+          Specifies the channel's ATI target. The default value is a function
+          of the channel and the device's RUI.
+
+      azoteq,cct-increase:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 16
+        default: 0
+        description:
+          Specifies the degree to which the channel's charge cycle time is to
+          be increased, with 0 representing no increase. The maximum value is
+          limited to 4 in the case of the ULP channel, and the property is un-
+          available entirely in the case of the Hall channel.
+
+      azoteq,proj-bias:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: |
+          Specifies the bias current applied during projected-capacitance
+          sensing as follows:
+          0: 2.5 uA
+          1: 5 uA
+          2: 10 uA
+          3: 20 uA
+
+          This property is unavailable in the case of the Hall channel.
+
+      azoteq,sense-freq:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        description: |
+          Specifies the channel's sensing frequency as follows (parenthesized
+          numbers represent the frequency if 'azoteq,clk-div' is present):
+          0: 4 MHz (1 MHz)
+          1: 2 MHz (500 kHz)
+          2: 1 MHz (250 kHz)
+          3: 500 kHz (125 kHz)
+
+          This property is unavailable in the case of the Hall channel. The
+          default value is a function of the channel and the device's RUI.
+
+      azoteq,ati-band-tighten:
+        type: boolean
+        description:
+          Tightens the ATI band from 1/8 to 1/16 of the desired target (ULP and
+          generic channels only).
+
+      azoteq,proj-enable:
+        type: boolean
+        description: Enables projected-capacitance sensing (ULP channel only).
+
+      azoteq,filt-str-np-cnt:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the raw count filter strength during normal-power mode (ULP
+          and generic channels only).
+
+      azoteq,filt-str-lp-cnt:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the raw count filter strength during low-power mode (ULP and
+          generic channels only).
+
+      azoteq,filt-str-np-lta:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the long-term average filter strength during normal-power
+          mode (ULP and generic channels only).
+
+      azoteq,filt-str-lp-lta:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the long-term average filter strength during low-power mode
+          (ULP and generic channels only).
+
+      azoteq,rx-enable:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 8
+        items:
+          minimum: 0
+          maximum: 7
+        description:
+          Specifies the CRX pin(s) associated with the channel.
+
+          This property is unavailable in the case of the Hall channel. The
+          default value is a function of the channel and the device's RUI.
+
+      azoteq,tx-enable:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 8
+        items:
+          minimum: 0
+          maximum: 7
+        description:
+          Specifies the TX pin(s) associated with the channel.
+
+          This property is unavailable in the case of the Hall channel. The
+          default value is a function of the channel and the device's RUI.
+
+      azoteq,local-cap-size:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3, 4]
+        default: 0
+        description: |
+          Specifies the capacitance to be added to the channel as follows:
+          0: 0 pF
+          1: 0.5 pF
+          2: 1.0 pF
+          3: 1.5 pF
+          4: 2.0 pF
+
+          This property is unavailable in the case of the ULP or Hall channels.
+
+      azoteq,sense-mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 8, 9, 12, 14, 15]
+        description: |
+          Specifies the channel's sensing mode as follows:
+          0:  Self capacitance
+          1:  Projected capacitance
+          8:  Self inductance
+          9:  Mutual inductance
+          12: External
+          14: Hall effect
+          15: Temperature
+
+          This property is unavailable in the case of the ULP or Hall channels.
+          The default value is a function of the channel and the device's RUI.
+
+      azoteq,tx-freq:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: |
+          Specifies the inductive sensing excitation frequency as follows
+          (parenthesized numbers represent the frequency if 'azoteq,clk-div'
+          is present):
+          0: 16 MHz (4 MHz)
+          1: 8 MHz (2 MHz)
+          2: 4 MHz (1 MHz)
+          3: 2 MHz (500 kHz)
+
+          This property is unavailable in the case of the ULP or Hall channels.
+
+      azoteq,invert-enable:
+        type: boolean
+        description:
+          Inverts the polarity of the states reported for proximity, touch and
+          deep-touch events relative to their respective thresholds (generic
+          channels only).
+
+      azoteq,comp-disable:
+        type: boolean
+        description:
+          Disables compensation for the channel (generic channels only).
+
+      azoteq,static-enable:
+        type: boolean
+        description:
+          Enables the static front-end for the channel (generic channels only).
+
+      azoteq,assoc-select:
+        $ref: /schemas/types.yaml#/definitions/string-array
+        minItems: 1
+        maxItems: 6
+        items:
+          enum:
+            - ulp-0
+            - trackpad-3x2
+            - trackpad-3x3
+            - generic-0
+            - generic-1
+            - generic-2
+            - hall
+        description:
+          Specifies the associated channels for which the channel serves as a
+          reference channel. By default, no channels are selected. This prop-
+          erty is only available for the generic channels.
+
+      azoteq,assoc-weight:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 0
+        description:
+          Specifies the channel's impact weight if it acts as an associated
+          channel (0 = 0% impact, 255 = 200% impact). This property is only
+          available for the generic channels.
+
+    patternProperties:
+      "^event-(prox|touch|deep)(-alt)?$":
+        type: object
+        description:
+          Represents a proximity, touch or deep-touch event reported by the
+          channel in response to a decrease in counts. Node names suffixed with
+          '-alt' instead correspond to an increase in counts.
+
+          By default, the long-term average tracks an increase in counts such
+          that only events corresponding to a decrease in counts are reported
+          (refer to the datasheet for more information).
+
+          Specify 'azoteq,dual-direction' to freeze the long-term average when
+          the counts increase or decrease such that events of either direction
+          can be reported. Alternatively, specify 'azoteq,invert-enable' to in-
+          vert the polarity of the states reported by the channel.
+
+          Complementary events (e.g. event-touch and event-touch-alt) can both
+          be present and specify different key or switch codes, but not differ-
+          ent thresholds or hysteresis (if applicable).
+
+          Proximity events are unavailable in the case of the Hall channel, and
+          deep-touch events are only available for the generic channels. Unless
+          otherwise specified, default values are a function of the channel and
+          the device's RUI.
+
+        properties:
+          azoteq,thresh:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 255
+            description: Specifies the threshold for the event.
+
+          azoteq,hyst:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 15
+            description:
+              Specifies the hysteresis for the event (touch and deep-touch
+              events only).
+
+          linux,code:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            description: Numeric key or switch code associated with the event.
+
+          linux,input-type:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [1, 5]
+            description:
+              Specifies whether the event is to be interpreted as a key (1) or
+              a switch (5). By default, Hall-channel events are interpreted as
+              switches and all others are interpreted as keys.
+
+        dependencies:
+          linux,input-type: ["linux,code"]
+
+        additionalProperties: false
+
+    dependencies:
+      azoteq,assoc-weight: ["azoteq,assoc-select"]
+
+    additionalProperties: false
+
+  "^trackpad-3x[2-3]$":
+    type: object
+    description:
+      Represents all channels associated with the trackpad. The channels are
+      collectively active if the trackpad is defined and inactive otherwise.
+
+    properties:
+      azoteq,ati-exclude:
+        type: boolean
+        description:
+          Prevents the trackpad channels from participating in an ATI event
+          that is manually triggered during initialization.
+
+      azoteq,reseed-disable:
+        type: boolean
+        description:
+          Prevents the trackpad channels from being reseeded if the long-term
+          average timeout (defined in 'azoteq,timeout-lta') expires.
+
+      azoteq,meas-cap-decrease:
+        type: boolean
+        description:
+          Decreases the internal measurement capacitance from 60 pF to 15 pF.
+
+      azoteq,rx-inactive:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1]
+        default: 0
+        description: |
+          Specifies how inactive CRX pins are to be terminated as follows:
+          0: VSS
+          1: Floating
+
+      azoteq,linearize:
+        type: boolean
+        description: Inverts the polarity of the trackpad's touch state.
+
+      azoteq,dual-direction:
+        type: boolean
+        description:
+          Specifies that the trackpad's long-term averages are to freeze in
+          the presence of either increasing or decreasing counts, thereby
+          permitting events to be reported in either direction.
+
+      azoteq,filt-disable:
+        type: boolean
+        description: Disables raw count filtering for the trackpad channels.
+
+      azoteq,ati-mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: |
+          Specifies the trackpad's ATI mode as follows:
+          0: Disabled
+          1: Semi-partial
+          2: Partial
+          3: Full
+
+      azoteq,ati-base:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 6
+        maxItems: 9
+        items:
+          minimum: 45
+          maximum: 300
+        default: [45, 45, 45, 45, 45, 45, 45, 45, 45]
+        description: Specifies each individual trackpad channel's ATI base.
+
+      azoteq,ati-target:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        multipleOf: 32
+        minimum: 0
+        maximum: 2016
+        default: 0
+        description: Specifies the trackpad's ATI target.
+
+      azoteq,cct-increase:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 4
+        default: 0
+        description:
+          Specifies the degree to which the trackpad's charge cycle time is to
+          be increased, with 0 representing no increase.
+
+      azoteq,proj-bias:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: |
+          Specifies the bias current applied during projected-capacitance
+          sensing as follows:
+          0: 2.5 uA
+          1: 5 uA
+          2: 10 uA
+          3: 20 uA
+
+      azoteq,sense-freq:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: |
+          Specifies the trackpad's sensing frequency as follows (parenthesized
+          numbers represent the frequency if 'azoteq,clk-div' is present):
+          0: 4 MHz (1 MHz)
+          1: 2 MHz (500 kHz)
+          2: 1 MHz (250 kHz)
+          3: 500 kHz (125 kHz)
+
+      azoteq,ati-band-tighten:
+        type: boolean
+        description:
+          Tightens the ATI band from 1/8 to 1/16 of the desired target.
+
+      azoteq,thresh:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 6
+        maxItems: 9
+        items:
+          minimum: 0
+          maximum: 255
+        default: [0, 0, 0, 0, 0, 0, 0, 0, 0]
+        description:
+          Specifies each individual trackpad channel's touch threshold.
+
+      azoteq,hyst:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 15
+        default: 0
+        description: Specifies the trackpad's touch hysteresis.
+
+      azoteq,lta-update:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3, 4, 5, 6, 7]
+        default: 0
+        description: |
+          Specifies the update rate of the trackpad's long-term average during
+          ultra-low-power mode as follows:
+          0: 2
+          1: 4
+          2: 8
+          3: 16
+          4: 32
+          5: 64
+          6: 128
+          7: 255
+
+      azoteq,filt-str-trackpad:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description: Specifies the trackpad coordinate filter strength.
+
+      azoteq,filt-str-np-cnt:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the raw count filter strength during normal-power mode.
+
+      azoteq,filt-str-lp-cnt:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        enum: [0, 1, 2, 3]
+        default: 0
+        description:
+          Specifies the raw count filter strength during low-power mode.
+
+      linux,keycodes:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 6
+        description: |
+          Specifies the numeric keycodes associated with each available gesture
+          in the following order (enter 0 for unused gestures):
+          0: Positive flick or swipe in X direction
+          1: Negative flick or swipe in X direction
+          2: Positive flick or swipe in Y direction
+          3: Negative flick or swipe in Y direction
+          4: Tap
+          5: Hold
+
+      azoteq,gesture-swipe:
+        type: boolean
+        description:
+          Directs the device to interpret axial gestures as a swipe (finger
+          remains on trackpad) instead of a flick (finger leaves trackpad).
+
+      azoteq,timeout-tap-ms:
+        multipleOf: 16
+        minimum: 0
+        maximum: 4080
+        default: 0
+        description:
+          Specifies the length of time (in ms) within which a trackpad touch
+          must be released in order to be interpreted as a tap.
+
+      azoteq,timeout-swipe-ms:
+        multipleOf: 16
+        minimum: 0
+        maximum: 4080
+        default: 0
+        description:
+          Specifies the length of time (in ms) within which an axial gesture
+          must be completed in order to be interpreted as a flick or swipe.
+
+      azoteq,thresh-swipe:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        default: 0
+        description:
+          Specifies the number of points across which an axial gesture must
+          travel in order to be interpreted as a flick or swipe.
+
+    dependencies:
+      azoteq,gesture-swipe: ["linux,keycodes"]
+      azoteq,timeout-tap-ms: ["linux,keycodes"]
+      azoteq,timeout-swipe-ms: ["linux,keycodes"]
+      azoteq,thresh-swipe: ["linux,keycodes"]
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    i2c {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            iqs626a@44 {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    compatible = "azoteq,iqs626a";
+                    reg = <0x44>;
+                    interrupt-parent = <&gpio>;
+                    interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
+
+                    azoteq,rate-np-ms = <16>;
+                    azoteq,rate-lp-ms = <160>;
+
+                    azoteq,timeout-pwr-ms = <2560>;
+                    azoteq,timeout-lta-ms = <32768>;
+
+                    ulp-0 {
+                            azoteq,meas-cap-decrease;
+
+                            azoteq,ati-base = <75>;
+                            azoteq,ati-target = <1024>;
+
+                            azoteq,rx-enable = <2>, <3>, <4>,
+                                               <5>, <6>, <7>;
+
+                            event-prox {
+                                    linux,code = <KEY_POWER>;
+                            };
+                    };
+
+                    trackpad-3x3 {
+                            azoteq,filt-str-np-cnt = <1>;
+                            azoteq,filt-str-lp-cnt = <1>;
+
+                            azoteq,hyst = <4>;
+                            azoteq,thresh = <35>, <40>, <40>,
+                                            <38>, <33>, <38>,
+                                            <35>, <35>, <35>;
+
+                            azoteq,ati-mode = <3>;
+                            azoteq,ati-base = <195>, <195>, <195>,
+                                              <195>, <195>, <195>,
+                                              <195>, <195>, <195>;
+                            azoteq,ati-target = <512>;
+
+                            azoteq,proj-bias = <1>;
+                            azoteq,sense-freq = <2>;
+
+                            linux,keycodes = <KEY_VOLUMEUP>,
+                                             <KEY_VOLUMEDOWN>,
+                                             <KEY_NEXTSONG>,
+                                             <KEY_PREVIOUSSONG>,
+                                             <KEY_PLAYPAUSE>,
+                                             <KEY_STOPCD>;
+
+                            azoteq,gesture-swipe;
+                            azoteq,timeout-swipe-ms = <800>;
+                            azoteq,timeout-tap-ms = <400>;
+                            azoteq,thresh-swipe = <40>;
+                    };
+
+                    /*
+                     * Preserve the default register settings for
+                     * the temperature-tracking channel leveraged
+                     * by reset user interface (RUI) 1.
+                     *
+                     * Scalar properties (e.g. ATI mode) are left
+                     * untouched by simply omitting them; boolean
+                     * properties must be specified explicitly as
+                     * needed.
+                     */
+                    generic-2 {
+                            azoteq,reseed-disable;
+                            azoteq,meas-cap-decrease;
+                            azoteq,dual-direction;
+                            azoteq,comp-disable;
+                            azoteq,static-enable;
+                    };
+
+                    hall {
+                            azoteq,reseed-disable;
+                            azoteq,meas-cap-decrease;
+
+                            event-touch {
+                                    linux,code = <SW_LID>;
+                            };
+                    };
+            };
+    };
+
+...

--
2.7.4

maintainer
#4 lore raw

Re: [PATCH v2 3/5] dt-bindings: input: touchscreen: Move helper bindings to core

In reply to Jeff LaBundy
Quoted 30 lines · Jeff LaBundy

With the helper functions moving to /drivers/input/ following the discussion in [1], touchscreen.yaml and touchscreen.txt are moved one level up as well to maintain a consistent directory structure.

No changes are made to either file except to update the $id field in touchscreen.yaml to reflect the new path. The handful of .yaml bindings that reference the original relative path are updated as well.

Last but not least, the handful of .txt bindings that included an absolute path to touchscreen.txt are updated too.

[1] https://patchwork.kernel.org/patch/11924029/

---
Changes in v2:
- Added this patch to the series

 .../devicetree/bindings/input/elan_i2c.txt         |  2 +-
 .../devicetree/bindings/input/touchscreen.txt      |  1 +
 .../devicetree/bindings/input/touchscreen.yaml     | 83 ++++++++++++++++++++++
 .../bindings/input/touchscreen/ads7846.txt         |  2 +-
 .../bindings/input/touchscreen/bu21013.txt         |  2 +-
 .../input/touchscreen/cypress,cy8ctma140.yaml      |  2 +-
 .../bindings/input/touchscreen/edt-ft5x06.yaml     |  2 +-
 .../bindings/input/touchscreen/eeti,exc3000.yaml   |  2 +-
 .../input/touchscreen/elan,elants_i2c.yaml         |  2 +-
 .../bindings/input/touchscreen/goodix.yaml         |  2 +-
 .../bindings/input/touchscreen/iqs5xx.txt          |  2 +-
Quoted 8 lines
 .../bindings/input/touchscreen/mms114.txt          |  2 +-
 .../bindings/input/touchscreen/touchscreen.txt     |  1 -
 .../bindings/input/touchscreen/touchscreen.yaml    | 83 ----------------------
 14 files changed, 94 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml

No, I prefer the current structure. It's easier to find similar types of h/w as-is. In fact, if you wanted to move keyboards/keypads to their own subdir, I'd welcome that.

Rob

maintainer Reviewed-by on v2 4/5
#8 lore raw

Re: [PATCH v2 4/5] dt-bindings: input: Add bindings for Azoteq IQS626A

In reply to Jeff LaBundy
Quoted 12 lines · Jeff LaBundy

This patch adds device tree bindings for the Azoteq IQS626A capacitive touch controller.

---
Changes in v2:
- Added missing $ref to touchscreen.yaml

 .../devicetree/bindings/input/iqs626a.yaml         | 843 +++++++++++++++++++++
 1 file changed, 843 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/iqs626a.yaml

Other than the file path:

#5 lore raw

Re: [PATCH v2 3/5] dt-bindings: input: touchscreen: Move helper bindings to core

In reply to Rob Herring

Hi Rob,

Thank you for taking a look at the series.

Quoted 40 lines · Rob Herring
Quoted 30 lines · Jeff LaBundy

With the helper functions moving to /drivers/input/ following the discussion in [1], touchscreen.yaml and touchscreen.txt are moved one level up as well to maintain a consistent directory structure.

No changes are made to either file except to update the $id field in touchscreen.yaml to reflect the new path. The handful of .yaml bindings that reference the original relative path are updated as well.

Last but not least, the handful of .txt bindings that included an absolute path to touchscreen.txt are updated too.

[1] https://patchwork.kernel.org/patch/11924029/

---
Changes in v2:
- Added this patch to the series

 .../devicetree/bindings/input/elan_i2c.txt         |  2 +-
 .../devicetree/bindings/input/touchscreen.txt      |  1 +
 .../devicetree/bindings/input/touchscreen.yaml     | 83 ++++++++++++++++++++++
 .../bindings/input/touchscreen/ads7846.txt         |  2 +-
 .../bindings/input/touchscreen/bu21013.txt         |  2 +-
 .../input/touchscreen/cypress,cy8ctma140.yaml      |  2 +-
 .../bindings/input/touchscreen/edt-ft5x06.yaml     |  2 +-
 .../bindings/input/touchscreen/eeti,exc3000.yaml   |  2 +-
 .../input/touchscreen/elan,elants_i2c.yaml         |  2 +-
 .../bindings/input/touchscreen/goodix.yaml         |  2 +-
 .../bindings/input/touchscreen/iqs5xx.txt          |  2 +-
Quoted 8 lines
 .../bindings/input/touchscreen/mms114.txt          |  2 +-
 .../bindings/input/touchscreen/touchscreen.txt     |  1 -
 .../bindings/input/touchscreen/touchscreen.yaml    | 83 ----------------------
 14 files changed, 94 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
Quoted 3 lines

No, I prefer the current structure. It's easier to find similar types of h/w as-is. In fact, if you wanted to move keyboards/keypads to their own subdir, I'd welcome that.

No problem, I will drop this patch from the series and update the $ref in patch [4/5] to reference the original touchscreen.yaml.

Quoted 2 lines

Rob

Kind regards,
Jeff LaBundy

maintainer
#6 lore raw

Re: [PATCH v2 3/5] dt-bindings: input: touchscreen: Move helper bindings to core

In reply to Rob Herring
Quoted 40 lines · Rob Herring
Quoted 30 lines · Jeff LaBundy

With the helper functions moving to /drivers/input/ following the discussion in [1], touchscreen.yaml and touchscreen.txt are moved one level up as well to maintain a consistent directory structure.

No changes are made to either file except to update the $id field in touchscreen.yaml to reflect the new path. The handful of .yaml bindings that reference the original relative path are updated as well.

Last but not least, the handful of .txt bindings that included an absolute path to touchscreen.txt are updated too.

[1] https://patchwork.kernel.org/patch/11924029/

---
Changes in v2:
- Added this patch to the series

 .../devicetree/bindings/input/elan_i2c.txt         |  2 +-
 .../devicetree/bindings/input/touchscreen.txt      |  1 +
 .../devicetree/bindings/input/touchscreen.yaml     | 83 ++++++++++++++++++++++
 .../bindings/input/touchscreen/ads7846.txt         |  2 +-
 .../bindings/input/touchscreen/bu21013.txt         |  2 +-
 .../input/touchscreen/cypress,cy8ctma140.yaml      |  2 +-
 .../bindings/input/touchscreen/edt-ft5x06.yaml     |  2 +-
 .../bindings/input/touchscreen/eeti,exc3000.yaml   |  2 +-
 .../input/touchscreen/elan,elants_i2c.yaml         |  2 +-
 .../bindings/input/touchscreen/goodix.yaml         |  2 +-
 .../bindings/input/touchscreen/iqs5xx.txt          |  2 +-
Quoted 8 lines
 .../bindings/input/touchscreen/mms114.txt          |  2 +-
 .../bindings/input/touchscreen/touchscreen.txt     |  1 -
 .../bindings/input/touchscreen/touchscreen.yaml    | 83 ----------------------
 14 files changed, 94 insertions(+), 94 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen.yaml
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
Quoted 3 lines

No, I prefer the current structure. It's easier to find similar types of h/w as-is. In fact, if you wanted to move keyboards/keypads to their own subdir, I'd welcome that.

I agree that we should keep all touchscreens in the same subdirectory, however the bindings in touchscreen.yaml are applicable to all touch controllers and not only touchscreens, so I'd like to rename it to touch-controller.yaml and move it to bindings/input/.

Is it possible to have bindings/input/touchscreen/touchscreen.yaml include bindings/input/touch-controller.yaml?

I also want to get in the patch below where we accept not only "touchscreen-*" properties that I want deprecate, but "touch-*' properties. If we agree I will try to adjust bindings to reflect the new names and mark old ones deprecated.

Thanks!

Signature · 24 lines
Dmitry


Input: rename touchscreen helper module to touch-helper

From: Dmitry Torokhov <[email protected]>

Because functionality in drivers/input/touchscreen.c is applicable to all
touch controllers (i.e. not only to touchscreens but touchpads as well),
let's rename it to touch-helper.c and rename all APIs from touchscreen_*()
to touch_*() and accept properties with prefix "touch-*" as well as
"touchscreen-*".

Signed-off-by: Dmitry Torokhov <[email protected]>
---
 drivers/input/Makefile             |    2 
 drivers/input/touch-helper.c       |  220 ++++++++++++++++++++++++++++++++++++
 drivers/input/touchscreen.c        |  207 ----------------------------------
 include/linux/input/touch-helper.h |   32 +++++
 include/linux/input/touchscreen.h  |   30 +++--
 5 files changed, 269 insertions(+), 222 deletions(-)
 create mode 100644 drivers/input/touch-helper.c
 delete mode 100644 drivers/input/touchscreen.c
 create mode 100644 include/linux/input/touch-helper.h
drivers/input/Makefile +1 -1
index 037cc595106c..c81b16090437 100644
@@ -7,7 +7,7 @@
 
 obj-$(CONFIG_INPUT)		+= input-core.o
 input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o
-input-core-y += touchscreen.o
+input-core-y += touch-helper.o
 
 obj-$(CONFIG_INPUT_FF_MEMLESS)	+= ff-memless.o
 obj-$(CONFIG_INPUT_SPARSEKMAP)	+= sparse-keymap.o
drivers/input/touch-helper.c new file +220 -0

220 lines not on this page · raw message

drivers/input/touchscreen.c deleted +0 -207

207 lines not on this page · raw message

include/linux/input/touch-helper.h new file +32 -0
new file mode 100644
index 000000000000..c9cafacf7a6e
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2014 Sebastian Reichel <[email protected]>
+ */
+
+#ifndef _TOUCH_HELPER_H
+#define _TOUCH_HELPER_H
+
+struct input_dev;
+struct input_mt_pos;
+
+struct touch_properties {
+	unsigned int max_x;
+	unsigned int max_y;
+	bool invert_x;
+	bool invert_y;
+	bool swap_x_y;
+};
+
+void touch_parse_properties(struct input_dev *input, bool multitouch,
+			    struct touch_properties *prop);
+
+void touch_set_mt_pos(struct input_mt_pos *pos,
+		      const struct touch_properties *prop,
+		      unsigned int x, unsigned int y);
+
+void touch_report_pos(struct input_dev *input,
+		      const struct touch_properties *prop,
+		      unsigned int x, unsigned int y,
+		      bool multitouch);
+
+#endif
include/linux/input/touchscreen.h +16 -14
index fe66e2b58f62..fa202ec436df 100644
@@ -6,27 +6,29 @@
 #ifndef _TOUCHSCREEN_H
 #define _TOUCHSCREEN_H
 
-struct input_dev;
-struct input_mt_pos;
+#include <linux/input/touch-helper.h>
 
-struct touchscreen_properties {
-	unsigned int max_x;
-	unsigned int max_y;
-	bool invert_x;
-	bool invert_y;
-	bool swap_x_y;
-};
+#define touchscreen_properties touch_properties
 
 void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
-				  struct touchscreen_properties *prop);
+				  struct touch_properties *prop)
+{
+	touch_parse_properties(input, multitouch, prop);
+}
 
 void touchscreen_set_mt_pos(struct input_mt_pos *pos,
-			    const struct touchscreen_properties *prop,
-			    unsigned int x, unsigned int y);
+			    const struct touch_properties *prop,
+			    unsigned int x, unsigned int y)
+{
+	touch_set_mt_pos(pos, prop, x, y);
+}
 
 void touchscreen_report_pos(struct input_dev *input,
-			    const struct touchscreen_properties *prop,
+			    const struct touch_properties *prop,
 			    unsigned int x, unsigned int y,
-			    bool multitouch);
+			    bool multitouch)
+{
+	touch_report_pos(input, prop, x, y, multitouch);
+}
 
 #endif