Skip to contentSkip to conversation

dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D

PATCH In review Jeff LaBundy 4 participants 7 messages May 31, 2023 – Jun 12, 2023

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

PATCH 1/2 dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D

Extend the common binding to include a new variant of the silicon.

---
 .../bindings/input/azoteq,iqs7222.yaml        | 202 +++++++++++++++++-
 1 file changed, 192 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +192 -10
index 9ddba7f2e7aa..a4c251a430fa 100644
@@ -4,14 +4,14 @@
 $id: http://devicetree.org/schemas/input/azoteq,iqs7222.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Azoteq IQS7222A/B/C Capacitive Touch Controller
+title: Azoteq IQS7222A/B/C/D Capacitive Touch Controller
 
 maintainers:
   - Jeff LaBundy <[email protected]>
 
 description: |
-  The Azoteq IQS7222A, IQS7222B and IQS7222C are multichannel capacitive touch
-  controllers that feature additional sensing capabilities.
+  The Azoteq IQS7222A, IQS7222B, IQS7222C and IQS7222D are multichannel capac-
+  itive touch controllers that feature additional sensing capabilities.
 
   Link to datasheets: https://www.azoteq.com/
 
@@ -21,6 +21,7 @@ properties:
       - azoteq,iqs7222a
       - azoteq,iqs7222b
       - azoteq,iqs7222c
+      - azoteq,iqs7222d
 
   reg:
     maxItems: 1
@@ -173,6 +174,148 @@ properties:
     maximum: 3000
     description: Specifies the report rate (in ms) during ultra-low-power mode.
 
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true
+
+  trackpad:
+    type: object
+    description: Represents all channels associated with the trackpad.
+
+    properties:
+      azoteq,channel-select:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 12
+        items:
+          minimum: 0
+          maximum: 13
+        description:
+          Specifies the order of the channels that participate in the trackpad.
+          Specify 255 to omit a given channel for the purpose of mapping a non-
+          rectangular trackpad.
+
+      azoteq,num-rows:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of rows that comprise the trackpad.
+
+      azoteq,num-cols:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of columns that comprise the trackpad.
+
+      azoteq,top-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        multipleOf: 4
+        minimum: 0
+        maximum: 1020
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          no longer applied.
+
+      azoteq,bottom-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          linearly reduced.
+
+      azoteq,use-prox:
+        type: boolean
+        description:
+          Directs the trackpad to respond to the proximity states of the se-
+          lected channels instead of their corresponding touch states. Note
+          the trackpad cannot report granular coordinates during a state of
+          proximity.
+
+    patternProperties:
+      "^azoteq,lower-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's lower starting points.
+
+      "^azoteq,upper-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's upper starting points.
+
+      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
+        type: object
+        $ref: input.yaml#
+        description:
+          Represents a press or gesture event reported by the trackpad. Specify
+          'linux,code' under the press event to report absolute coordinates.
+
+        properties:
+          linux,code: true
+
+          azoteq,gesture-angle-tighten:
+            type: boolean
+            description:
+              Limits the tangent of the gesture angle to 0.5 (axial gestures
+              only). If specified in one direction, the effect is applied in
+              either direction.
+
+          azoteq,gesture-max-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) within which a tap, swipe
+              or flick gesture must be completed in order to be acknowledged
+              by the device. The number specified for any one swipe or flick
+              gesture applies to all other swipe or flick gestures.
+
+          azoteq,gesture-min-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) for which a tap gesture must
+              be held in order to be acknowledged by the device.
+
+          azoteq,gesture-dist:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 65535
+            description:
+              Specifies the distance across which a tap, swipe or flick gesture
+              must travel in order to be acknowledged by the device. The number
+              specified for any one swipe or flick gesture applies to all other
+              swipe or flick gestures.
+
+          azoteq,gpio-select:
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            minItems: 1
+            maxItems: 3
+            items:
+              minimum: 0
+              maximum: 2
+            description: |
+              Specifies one or more GPIO mapped to the event as follows:
+              0: GPIO0
+              1: GPIO3
+              2: GPIO4
+
+              Note that although multiple events can be mapped to a single
+              GPIO, they must all be of the same type (proximity, touch or
+              trackpad gesture).
+
+        additionalProperties: false
+
+    required:
+      - azoteq,channel-select
+
+    additionalProperties: false
+
 patternProperties:
   "^cycle-[0-9]$":
     type: object
@@ -288,6 +431,10 @@ patternProperties:
           Activates the reference channel in response to proximity events
           instead of touch events.
 
+      azoteq,counts-filt-enable:
+        type: boolean
+        description: Applies counts filtering to the channel.
+
       azoteq,ati-band:
         $ref: /schemas/types.yaml#/definitions/uint32
         enum: [0, 1, 2, 3]
@@ -432,12 +579,12 @@ patternProperties:
             description: |
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4
 
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
-              slider gesture).
+              slider/trackpad gesture).
 
           azoteq,thresh:
             $ref: /schemas/types.yaml#/definitions/uint32
@@ -610,8 +757,8 @@ patternProperties:
             description: |
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4
 
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
@@ -629,8 +776,8 @@ patternProperties:
     description: |
       Represents a GPIO mapped to one or more events as follows:
       gpio-0: GPIO0
-      gpio-1: GPIO3 (IQS7222C only)
-      gpio-2: GPIO4 (IQS7222C only)
+      gpio-1: GPIO3
+      gpio-2: GPIO4
 
     allOf:
       - $ref: ../pinctrl/pincfg-node.yaml#
@@ -641,6 +788,41 @@ patternProperties:
     additionalProperties: false
 
 allOf:
+  - $ref: touchscreen/touchscreen.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: azoteq,iqs7222d
+
+    then:
+      patternProperties:
+        "^cycle-[0-9]$":
+          properties:
+            azoteq,iref-enable: false
+
+        "^channel-([0-9]|1[0-9])$":
+          properties:
+            azoteq,ref-select: false
+
+        "^slider-[0-1]$": false
+
+    else:
+      properties:
+        touchscreen-size-x: false
+        touchscreen-size-y: false
+        touchscreen-inverted-x: false
+        touchscreen-inverted-y: false
+        touchscreen-swapped-x-y: false
+
+        trackpad: false
+
+      patternProperties:
+        "^channel-([0-9]|1[0-9])$":
+          properties:
+            azoteq,counts-filt-enable: false
+
   - if:
       properties:
         compatible:
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 Input: iqs7222 - add support for Azoteq IQS7222D

The vendor has introduced a new variant of silicon which is highly similar to the existing IQS7222A, but with its independent sliders essentially replaced with a single-contact trackpad.

Update the common driver to support this new device's register map and report trackpad events. As with the IQS7222A, the new IQS7222D can report both raw coordinates as well as gestures.

---
 drivers/input/misc/Kconfig   |   4 +-
 drivers/input/misc/iqs7222.c | 468 ++++++++++++++++++++++++++++++++++-
 2 files changed, 461 insertions(+), 11 deletions(-)
drivers/input/misc/Kconfig +2 -2
index 81a54a59e13c..c47eecc6f83b 100644
@@ -791,10 +791,10 @@ config INPUT_IQS626A
 	  module will be called iqs626a.
 
 config INPUT_IQS7222
-	tristate "Azoteq IQS7222A/B/C capacitive touch controller"
+	tristate "Azoteq IQS7222A/B/C/D capacitive touch controller"
 	depends on I2C
 	help
-	  Say Y to enable support for the Azoteq IQS7222A/B/C family
+	  Say Y to enable support for the Azoteq IQS7222A/B/C/D family
 	  of capacitive touch controllers.
 
 	  To compile this driver as a module, choose M here: the
drivers/input/misc/iqs7222.c +459 -9

609 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 2/2] Input: iqs7222 - add support for Azoteq IQS7222D

kernel test robot noticed the following build warnings:

Hi Jeff,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus robh/for-next hid/for-next linus/master v6.4-rc4 next-20230531] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jeff-LaBundy/Input-iqs7222-add-support-for-Azoteq-IQS7222D/20230531-095226
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/ZHaoFCIpUM6ocPKO%40nixie71
patch subject: [PATCH 2/2] Input: iqs7222 - add support for Azoteq IQS7222D
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20230601/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/b8b40762779cc4c0208ff51ef9fbb2d8015ba164
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jeff-LaBundy/Input-iqs7222-add-support-for-Azoteq-IQS7222D/20230531-095226 git checkout b8b40762779cc4c0208ff51ef9fbb2d8015ba164
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 olddefconfig
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/input/misc/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/input/misc/iqs7222.c: In function 'iqs7222_parse_tpad':

>> drivers/input/misc/iqs7222.c:2574:36: warning: unused variable 'val' [-Wunused-variable]
    2574 |         unsigned int chan_sel[12], val;
         |                                    ^~~

vim +/val +2574 drivers/input/misc/iqs7222.c

2563
2564 static int iqs7222_parse_tpad(struct iqs7222_private *iqs7222,
2565 struct fwnode_handle *tpad_node, int tpad_index)
2566 {
2567 const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc;
2568 struct touchscreen_properties *prop = &iqs7222->prop;
2569 struct i2c_client *client = iqs7222->client;
2570 int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row;
2571 int count, error, i;
2572 u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset];
2573 u16 *tpad_setup = iqs7222->tpad_setup;

> 2574		unsigned int chan_sel[12], val;
  2575	
  2576		error = iqs7222_parse_props(iqs7222, tpad_node, tpad_index,
  2577					    IQS7222_REG_GRP_TPAD,
  2578					    IQS7222_REG_KEY_NONE);
  2579		if (error)
  2580			return error;
  2581	
  2582		count = fwnode_property_count_u32(tpad_node, "azoteq,channel-select");
  2583		if (count < 0) {
  2584			dev_err(&client->dev, "Failed to count %s channels: %d\n",
  2585				fwnode_get_name(tpad_node), count);
  2586			return count;
  2587		} else if (!count || count > ARRAY_SIZE(chan_sel)) {
  2588			dev_err(&client->dev, "Invalid number of %s channels\n",
  2589				fwnode_get_name(tpad_node));
  2590			return -EINVAL;
  2591		}
  2592	
  2593		error = fwnode_property_read_u32_array(tpad_node,
  2594						       "azoteq,channel-select",
  2595						       chan_sel, count);
  2596		if (error) {
  2597			dev_err(&client->dev, "Failed to read %s channels: %d\n",
  2598				fwnode_get_name(tpad_node), error);
  2599			return error;
  2600		}
  2601	
  2602		tpad_setup[6] &= ~GENMASK(num_chan - 1, 0);
  2603	
  2604		for (i = 0; i < ARRAY_SIZE(chan_sel); i++) {
  2605			tpad_setup[8 + i] = 0;
  2606			if (i >= count || chan_sel[i] == U8_MAX)
  2607				continue;
  2608	
  2609			if (chan_sel[i] >= num_chan) {
  2610				dev_err(&client->dev, "Invalid %s channel: %u\n",
  2611					fwnode_get_name(tpad_node), chan_sel[i]);
  2612				return -EINVAL;
  2613			}
  2614	
  2615			/*
  2616			 * The following fields indicate which channels participate in
  2617			 * the trackpad, as well as each channel's relative placement.
  2618			 */
  2619			tpad_setup[6] |= BIT(chan_sel[i]);
  2620			tpad_setup[8 + i] = chan_sel[i] * 34 + 1072;
  2621		}
  2622	
  2623		tpad_setup[7] = dev_desc->touch_link;
  2624		if (fwnode_property_present(tpad_node, "azoteq,use-prox"))
  2625			tpad_setup[7] -= 2;
  2626	
  2627		for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++)
  2628			tpad_setup[20] &= ~(iqs7222_tp_events[i].strict |
  2629					    iqs7222_tp_events[i].enable);
  2630	
  2631		for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++) {
  2632			const char *event_name = iqs7222_tp_events[i].name;
  2633			struct fwnode_handle *event_node;
  2634	
  2635			event_node = fwnode_get_named_child_node(tpad_node, event_name);
  2636			if (!event_node)
  2637				continue;
  2638	
  2639			if (fwnode_property_present(event_node,
  2640						    "azoteq,gesture-angle-tighten"))
  2641				tpad_setup[20] |= iqs7222_tp_events[i].strict;
  2642	
  2643			tpad_setup[20] |= iqs7222_tp_events[i].enable;
  2644	
  2645			error = iqs7222_parse_event(iqs7222, event_node, tpad_index,
  2646						    IQS7222_REG_GRP_TPAD,
  2647						    iqs7222_tp_events[i].reg_key,
  2648						    iqs7222_tp_events[i].link, 1566,
  2649						    NULL,
  2650						    &iqs7222->tp_code[i]);

2651 fwnode_handle_put(event_node);
2652 if (error)
2653 return error;
2654
2655 if (!dev_desc->event_offset)
2656 continue;
2657
2658 /*
2659 * The press/release event is determined based on whether the
2660 * coordinate fields report 0xFFFF and solely relies on touch
2661 * or proximity interrupts to be unmasked.
2662 */
2663 if (i)
2664 *event_mask |= IQS7222_EVENT_MASK_TPAD;
2665 else if (tpad_setup[7] == dev_desc->touch_link)
2666 *event_mask |= IQS7222_EVENT_MASK_TOUCH;
2667 else
2668 *event_mask |= IQS7222_EVENT_MASK_PROX;
2669 }
2670
2671 if (!iqs7222->tp_code[0])
2672 return 0;
2673
2674 input_set_abs_params(iqs7222->keypad, ABS_X,
2675 0, (tpad_setup[4] ? : 1) - 1, 0, 0);
2676
2677 input_set_abs_params(iqs7222->keypad, ABS_Y,
2678 0, (tpad_setup[5] ? : 1) - 1, 0, 0);
2679
2680 touchscreen_parse_properties(iqs7222->keypad, false, prop);
2681
2682 if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) {
2683 dev_err(&client->dev, "Invalid trackpad size: %u*%u\n",
2684 prop->max_x, prop->max_y);
2685 return -EINVAL;
2686 }
2687
2688 tpad_setup[4] = prop->max_x + 1;
2689 tpad_setup[5] = prop->max_y + 1;
2690
2691 return 0;
2692 }
2693

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#3 lore raw
In reply to Jeff LaBundy
Quoted 3 lines · Jeff LaBundy

Extend the common binding to include a new variant of the silicon.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. 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.

It's not the first time - you keep ignoring maintainers output all the time.

Quoted 13 lines
---
 .../bindings/input/azoteq,iqs7222.yaml        | 202 +++++++++++++++++-
 1 file changed, 192 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0 -1
index 9ddba7f2e7aa..a4c251a430fa 100644
@@ -4,14 +4,14 @@
 $id: http://devicetree.org/schemas/input/azoteq,iqs7222.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Azoteq IQS7222A/B/C Capacitive Touch Controller

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +3 -2
+title: Azoteq IQS7222A/B/C/D Capacitive Touch Controller
 
 maintainers:
   - Jeff LaBundy <[email protected]>
 
 description: |
-  The Azoteq IQS7222A, IQS7222B and IQS7222C are multichannel capacitive touch
-  controllers that feature additional sensing capabilities.
+  The Azoteq IQS7222A, IQS7222B, IQS7222C and IQS7222D are multichannel capac-
+  itive touch controllers that feature additional sensing capabilities.

Don't split words.

Quoted 12 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +1 -0
   Link to datasheets: https://www.azoteq.com/
 
@@ -21,6 +21,7 @@ properties:
       - azoteq,iqs7222a
       - azoteq,iqs7222b
       - azoteq,iqs7222c
+      - azoteq,iqs7222d
 
   reg:
     maxItems: 1

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 181

Quoted 8 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +5 -0
@@ -173,6 +174,148 @@ properties:
     maximum: 3000
     description: Specifies the report rate (in ms) during ultra-low-power mode.
 
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true

Why? Aren't they coming from common schema?

Quoted 28 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +28 -0
+
+  trackpad:
+    type: object
+    description: Represents all channels associated with the trackpad.
+
+    properties:
+      azoteq,channel-select:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 12
+        items:
+          minimum: 0
+          maximum: 13
+        description:
+          Specifies the order of the channels that participate in the trackpad.
+          Specify 255 to omit a given channel for the purpose of mapping a non-
+          rectangular trackpad.
+
+      azoteq,num-rows:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of rows that comprise the trackpad.
+
+      azoteq,num-cols:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 219

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +10 -0
+        description: Specifies the number of columns that comprise the trackpad.
+
+      azoteq,top-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        multipleOf: 4
+        minimum: 0
+        maximum: 1020
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          no longer applied.

Units?

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 227

Quoted 8 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +8 -0
+
+      azoteq,bottom-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          linearly reduced.

Units?

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 233

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+
+      azoteq,use-prox:
+        type: boolean
+        description:
+          Directs the trackpad to respond to the proximity states of the se-
+          lected channels instead of their corresponding touch states. Note

Don't split the words.

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 242

Quoted 9 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +9 -0
+          the trackpad cannot report granular coordinates during a state of
+          proximity.
+
+    patternProperties:
+      "^azoteq,lower-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's lower starting points.

Why would you need this property? Why does this represent hardware property?

Quoted 91 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +80 -0
+
+      "^azoteq,upper-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's upper starting points.
+
+      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
+        type: object
+        $ref: input.yaml#
+        description:
+          Represents a press or gesture event reported by the trackpad. Specify
+          'linux,code' under the press event to report absolute coordinates.
+
+        properties:
+          linux,code: true
+
+          azoteq,gesture-angle-tighten:
+            type: boolean
+            description:
+              Limits the tangent of the gesture angle to 0.5 (axial gestures
+              only). If specified in one direction, the effect is applied in
+              either direction.
+
+          azoteq,gesture-max-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) within which a tap, swipe
+              or flick gesture must be completed in order to be acknowledged
+              by the device. The number specified for any one swipe or flick
+              gesture applies to all other swipe or flick gestures.
+
+          azoteq,gesture-min-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) for which a tap gesture must
+              be held in order to be acknowledged by the device.
+
+          azoteq,gesture-dist:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 65535
+            description:
+              Specifies the distance across which a tap, swipe or flick gesture
+              must travel in order to be acknowledged by the device. The number
+              specified for any one swipe or flick gesture applies to all other
+              swipe or flick gestures.
+
+          azoteq,gpio-select:
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            minItems: 1
+            maxItems: 3
+            items:
+              minimum: 0
+              maximum: 2
+            description: |
+              Specifies one or more GPIO mapped to the event as follows:
+              0: GPIO0
+              1: GPIO3
+              2: GPIO4
+
+              Note that although multiple events can be mapped to a single
+              GPIO, they must all be of the same type (proximity, touch or
+              trackpad gesture).
+
+        additionalProperties: false
+
+    required:
+      - azoteq,channel-select
+
+    additionalProperties: false
+
 patternProperties:
   "^cycle-[0-9]$":
     type: object
@@ -288,6 +431,10 @@ patternProperties:
           Activates the reference channel in response to proximity events
           instead of touch events.
 
+      azoteq,counts-filt-enable:
+        type: boolean
+        description: Applies counts filtering to the channel.
+
       azoteq,ati-band:
         $ref: /schemas/types.yaml#/definitions/uint32
         enum: [0, 1, 2, 3]

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 583

Quoted 7 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -2
@@ -432,12 +579,12 @@ patternProperties:
             description: |
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4

Why changing this? Is it valid for IQS7222A?

Quoted 53 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +24 -5
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
-              slider gesture).
+              slider/trackpad gesture).
 
           azoteq,thresh:
             $ref: /schemas/types.yaml#/definitions/uint32
@@ -610,8 +757,8 @@ patternProperties:
             description: |
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4
 
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
@@ -629,8 +776,8 @@ patternProperties:
     description: |
       Represents a GPIO mapped to one or more events as follows:
       gpio-0: GPIO0
-      gpio-1: GPIO3 (IQS7222C only)
-      gpio-2: GPIO4 (IQS7222C only)
+      gpio-1: GPIO3
+      gpio-2: GPIO4
 
     allOf:
       - $ref: ../pinctrl/pincfg-node.yaml#
@@ -641,6 +788,41 @@ patternProperties:
     additionalProperties: false
 
 allOf:
+  - $ref: touchscreen/touchscreen.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: azoteq,iqs7222d
+
+    then:
+      patternProperties:
+        "^cycle-[0-9]$":
+          properties:
+            azoteq,iref-enable: false
+
+        "^channel-([0-9]|1[0-9])$":
+          properties:
+            azoteq,ref-select: false
+
+        "^slider-[0-1]$": false

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 819

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +10 -0
+
+    else:
+      properties:
+        touchscreen-size-x: false
+        touchscreen-size-y: false
+        touchscreen-inverted-x: false
+        touchscreen-inverted-y: false
+        touchscreen-swapped-x-y: false
+
+        trackpad: false

The binding got quite complicated. Are you sure these are similar devices?

Best regards,
Krzysztof

#4 lore raw

Hi Krzysztof,

Quoted 11 lines · Krzysztof Kozlowski
Quoted 3 lines · Jeff LaBundy

Extend the common binding to include a new variant of the silicon.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. 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.

It's not the first time - you keep ignoring maintainers output all the time.

You'll have to forgive me; I'm submitting using some homemade tooling that is not yet stitched to get_maintainers, and I neglected to see that we're fortunate to have two more great maintainers. I'll fix that going forward.

Quoted 19 lines
Quoted 19 lines
---
 .../bindings/input/azoteq,iqs7222.yaml        | 202 +++++++++++++++++-
 1 file changed, 192 insertions(+), 10 deletions(-)
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +1 -1
index 9ddba7f2e7aa..a4c251a430fa 100644
@@ -4,14 +4,14 @@
 $id: http://devicetree.org/schemas/input/azoteq,iqs7222.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Azoteq IQS7222A/B/C Capacitive Touch Controller
+title: Azoteq IQS7222A/B/C/D Capacitive Touch Controller
 
 maintainers:
   - Jeff LaBundy <[email protected]>
 
Quoted 7 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml line 14

Quoted 5 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -2
 description: |
-  The Azoteq IQS7222A, IQS7222B and IQS7222C are multichannel capacitive touch
-  controllers that feature additional sensing capabilities.
+  The Azoteq IQS7222A, IQS7222B, IQS7222C and IQS7222D are multichannel capac-
+  itive touch controllers that feature additional sensing capabilities.

Don't split words.

ACK.

Quoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +1 -0
   Link to datasheets: https://www.azoteq.com/
 
@@ -21,6 +21,7 @@ properties:
       - azoteq,iqs7222a
       - azoteq,iqs7222b
       - azoteq,iqs7222c
+      - azoteq,iqs7222d
 
   reg:
     maxItems: 1
@@ -173,6 +174,148 @@ properties:
     maximum: 3000
     description: Specifies the report rate (in ms) during ultra-low-power mode.
 
Quoted 7 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +5 -0
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true

Why? Aren't they coming from common schema?

Yes, but because additionalProperties is set to false here, we must explicitly include the subset of properties from the common schema that are allowed for this particular instance. I counted over a dozen other bindings doing the same.

In case I have misunderstood, please let me know.

Quoted 33 lines
Quoted 33 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +32 -0
+
+  trackpad:
+    type: object
+    description: Represents all channels associated with the trackpad.
+
+    properties:
+      azoteq,channel-select:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 12
+        items:
+          minimum: 0
+          maximum: 13
+        description:
+          Specifies the order of the channels that participate in the trackpad.
+          Specify 255 to omit a given channel for the purpose of mapping a non-
+          rectangular trackpad.
+
+      azoteq,num-rows:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of rows that comprise the trackpad.
+
+      azoteq,num-cols:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of columns that comprise the trackpad.
+
+      azoteq,top-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 219

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+        multipleOf: 4
+        minimum: 0
+        maximum: 1020
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          no longer applied.

Units?

This is a ratiometric, i.e. unitless value that represents a hardware filter coefficient. It already exists in this binding prior to this patch under the slider-0/1 node and is simply re-used here.

Quoted 11 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 227

Quoted 9 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +8 -0
+
+      azoteq,bottom-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          linearly reduced.

Units?

Same here.

Quoted 9 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 233

Quoted 7 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+
+      azoteq,use-prox:
+        type: boolean
+        description:
+          Directs the trackpad to respond to the proximity states of the se-
+          lected channels instead of their corresponding touch states. Note

Don't split the words.

ACK.

Quoted 11 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 242

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +9 -0
+          the trackpad cannot report granular coordinates during a state of
+          proximity.
+
+    patternProperties:
+      "^azoteq,lower-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's lower starting points.
Quoted 1 line

Why would you need this property? Why does this represent hardware property?

This property and its cousin below define the physical boundaries of the touch surface. They are typically used to mask areas that cannot elicit an electrical response due to manufacturing tolerances or the presence of an overlay. For that reason, they descend directly from properties of the hardware.

Similar properties already exist in this binding for the slider case; this device simply extends the functionality to a second dimenstion.

Quoted 93 lines
Quoted 93 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +80 -0
+
+      "^azoteq,upper-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's upper starting points.
+
+      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
+        type: object
+        $ref: input.yaml#
+        description:
+          Represents a press or gesture event reported by the trackpad. Specify
+          'linux,code' under the press event to report absolute coordinates.
+
+        properties:
+          linux,code: true
+
+          azoteq,gesture-angle-tighten:
+            type: boolean
+            description:
+              Limits the tangent of the gesture angle to 0.5 (axial gestures
+              only). If specified in one direction, the effect is applied in
+              either direction.
+
+          azoteq,gesture-max-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) within which a tap, swipe
+              or flick gesture must be completed in order to be acknowledged
+              by the device. The number specified for any one swipe or flick
+              gesture applies to all other swipe or flick gestures.
+
+          azoteq,gesture-min-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) for which a tap gesture must
+              be held in order to be acknowledged by the device.
+
+          azoteq,gesture-dist:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 65535
+            description:
+              Specifies the distance across which a tap, swipe or flick gesture
+              must travel in order to be acknowledged by the device. The number
+              specified for any one swipe or flick gesture applies to all other
+              swipe or flick gestures.
+
+          azoteq,gpio-select:
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            minItems: 1
+            maxItems: 3
+            items:
+              minimum: 0
+              maximum: 2
+            description: |
+              Specifies one or more GPIO mapped to the event as follows:
+              0: GPIO0
+              1: GPIO3
+              2: GPIO4
+
+              Note that although multiple events can be mapped to a single
+              GPIO, they must all be of the same type (proximity, touch or
+              trackpad gesture).
+
+        additionalProperties: false
+
+    required:
+      - azoteq,channel-select
+
+    additionalProperties: false
+
 patternProperties:
   "^cycle-[0-9]$":
     type: object
@@ -288,6 +431,10 @@ patternProperties:
           Activates the reference channel in response to proximity events
           instead of touch events.
 
+      azoteq,counts-filt-enable:
+        type: boolean
+        description: Applies counts filtering to the channel.
+
       azoteq,ati-band:
         $ref: /schemas/types.yaml#/definitions/uint32
         enum: [0, 1, 2, 3]
@@ -432,12 +579,12 @@ patternProperties:
             description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 583

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -2
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4

Why changing this? Is it valid for IQS7222A?

It's not, only for 'C' and now 'D'. However, the restriction for 'A' is already conveyed in an if/then schema in the original binding. So rather than updating this text to say "(IQS7222C and IQS7222D only)", I opted to drop the open-coded text and rely on the existing schema.

Quoted 57 lines
Quoted 57 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +28 -5
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
-              slider gesture).
+              slider/trackpad gesture).
 
           azoteq,thresh:
             $ref: /schemas/types.yaml#/definitions/uint32
@@ -610,8 +757,8 @@ patternProperties:
             description: |
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4
 
               Note that although multiple events can be mapped to a single
               GPIO, they must all be of the same type (proximity, touch or
@@ -629,8 +776,8 @@ patternProperties:
     description: |
       Represents a GPIO mapped to one or more events as follows:
       gpio-0: GPIO0
-      gpio-1: GPIO3 (IQS7222C only)
-      gpio-2: GPIO4 (IQS7222C only)
+      gpio-1: GPIO3
+      gpio-2: GPIO4
 
     allOf:
       - $ref: ../pinctrl/pincfg-node.yaml#
@@ -641,6 +788,41 @@ patternProperties:
     additionalProperties: false
 
 allOf:
+  - $ref: touchscreen/touchscreen.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: azoteq,iqs7222d
+
+    then:
+      patternProperties:
+        "^cycle-[0-9]$":
+          properties:
+            azoteq,iref-enable: false
+
+        "^channel-([0-9]|1[0-9])$":
+          properties:
+            azoteq,ref-select: false
+
+        "^slider-[0-1]$": false
+
+    else:
+      properties:
+        touchscreen-size-x: false
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 819

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+        touchscreen-size-y: false
+        touchscreen-inverted-x: false
+        touchscreen-inverted-y: false
+        touchscreen-swapped-x-y: false
+
+        trackpad: false

The binding got quite complicated. Are you sure these are similar devices?

Yes, I'm quite sure. The silicon is largely the same, the primary difference being the way two access are reported (2x 1-D vs. 1x 2-D).

The binding hasn't necessarily grown functionally; rather, most properties from the slider-0/1 node are simply re-used or extended to two dimensions for the new trackpad node.

My long-term goal is to defer most of these properties to a common vendor schema as per my note to Rob in [1], but it does not seem possible yet. If I'm mistaken, or there is a more efficient means of re-use under the current tooling, I'll happily follow suit.

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

Quoted 4 lines

Best regards,
Krzysztof

Kind regards,
Jeff LaBundy

#5 lore raw
Quoted 15 lines · Jeff LaBundy
Quoted 7 lines
Quoted 7 lines

reg:
maxItems: 1

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0 -0
@@ -173,6 +174,148 @@ properties:
     maximum: 3000
     description: Specifies the report rate (in ms) during ultra-low-power mode.
 
Quoted 7 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +5 -0
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true

Why? Aren't they coming from common schema?

Quoted 5 lines

Yes, but because additionalProperties is set to false here, we must explicitly include the subset of properties from the common schema that are allowed for this particular instance. I counted over a dozen other bindings doing the same.

In case I have misunderstood, please let me know.

If you are listing now most of touchscreen properties, it is a sign you should use just unevaluatedProperties: false (instead additionalProperties) and then no need for any of these here.

Quoted 43 lines
Quoted 34 lines
Quoted 34 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +32 -0
+
+  trackpad:
+    type: object
+    description: Represents all channels associated with the trackpad.
+
+    properties:
+      azoteq,channel-select:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 12
+        items:
+          minimum: 0
+          maximum: 13
+        description:
+          Specifies the order of the channels that participate in the trackpad.
+          Specify 255 to omit a given channel for the purpose of mapping a non-
+          rectangular trackpad.
+
+      azoteq,num-rows:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of rows that comprise the trackpad.
+
+      azoteq,num-cols:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of columns that comprise the trackpad.
+
+      azoteq,top-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 219

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+        multipleOf: 4
+        minimum: 0
+        maximum: 1020
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          no longer applied.

Units?

Quoted 3 lines

This is a ratiometric, i.e. unitless value that represents a hardware filter coefficient. It already exists in this binding prior to this patch under the slider-0/1 node and is simply re-used here.

Then mention the ratio (e.g. "speed of movement expressed as ratio of..."). Description said "speed" and we usually measure speed in very specific units.

Quoted 40 lines
Quoted 11 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 227

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +8 -0
+
+      azoteq,bottom-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          linearly reduced.
Quoted 1 line

Units?

Same here.

Quoted 9 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 233

Quoted 7 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+
+      azoteq,use-prox:
+        type: boolean
+        description:
+          Directs the trackpad to respond to the proximity states of the se-
+          lected channels instead of their corresponding touch states. Note

Don't split the words.

ACK.

Quoted 11 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 242

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +9 -0
+          the trackpad cannot report granular coordinates during a state of
+          proximity.
+
+    patternProperties:
+      "^azoteq,lower-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's lower starting points.
Quoted 1 line

Why would you need this property? Why does this represent hardware property?

Quoted 8 lines

This property and its cousin below define the physical boundaries of the touch surface. They are typically used to mask areas that cannot elicit an electrical response due to manufacturing tolerances or the presence of an overlay. For that reason, they descend directly from properties of the hardware.

Similar properties already exist in this binding for the slider case; this device simply extends the functionality to a second dimenstion.

OK

Quoted 103 lines
Quoted 94 lines
Quoted 94 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +80 -0
+
+      "^azoteq,upper-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's upper starting points.
+
+      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
+        type: object
+        $ref: input.yaml#
+        description:
+          Represents a press or gesture event reported by the trackpad. Specify
+          'linux,code' under the press event to report absolute coordinates.
+
+        properties:
+          linux,code: true
+
+          azoteq,gesture-angle-tighten:
+            type: boolean
+            description:
+              Limits the tangent of the gesture angle to 0.5 (axial gestures
+              only). If specified in one direction, the effect is applied in
+              either direction.
+
+          azoteq,gesture-max-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) within which a tap, swipe
+              or flick gesture must be completed in order to be acknowledged
+              by the device. The number specified for any one swipe or flick
+              gesture applies to all other swipe or flick gestures.
+
+          azoteq,gesture-min-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) for which a tap gesture must
+              be held in order to be acknowledged by the device.
+
+          azoteq,gesture-dist:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 65535
+            description:
+              Specifies the distance across which a tap, swipe or flick gesture
+              must travel in order to be acknowledged by the device. The number
+              specified for any one swipe or flick gesture applies to all other
+              swipe or flick gestures.
+
+          azoteq,gpio-select:
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            minItems: 1
+            maxItems: 3
+            items:
+              minimum: 0
+              maximum: 2
+            description: |
+              Specifies one or more GPIO mapped to the event as follows:
+              0: GPIO0
+              1: GPIO3
+              2: GPIO4
+
+              Note that although multiple events can be mapped to a single
+              GPIO, they must all be of the same type (proximity, touch or
+              trackpad gesture).
+
+        additionalProperties: false
+
+    required:
+      - azoteq,channel-select
+
+    additionalProperties: false
+
 patternProperties:
   "^cycle-[0-9]$":
     type: object
@@ -288,6 +431,10 @@ patternProperties:
           Activates the reference channel in response to proximity events
           instead of touch events.
 
+      azoteq,counts-filt-enable:
+        type: boolean
+        description: Applies counts filtering to the channel.
+
       azoteq,ati-band:
         $ref: /schemas/types.yaml#/definitions/uint32
         enum: [0, 1, 2, 3]
@@ -432,12 +579,12 @@ patternProperties:
             description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 583

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -2
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4

Why changing this? Is it valid for IQS7222A?

Quoted 4 lines

It's not, only for 'C' and now 'D'. However, the restriction for 'A' is already conveyed in an if/then schema in the original binding. So rather than updating this text to say "(IQS7222C and IQS7222D only)", I opted to drop the open-coded text and rely on the existing schema.

OK

Quoted 1 line

Best regards,
Krzysztof

#6 lore raw

Hi Krzysztof,

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Jeff LaBundy
Quoted 7 lines
Quoted 7 lines

reg:
maxItems: 1

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +0 -0
@@ -173,6 +174,148 @@ properties:
     maximum: 3000
     description: Specifies the report rate (in ms) during ultra-low-power mode.
 
Quoted 7 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +5 -0
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true

Why? Aren't they coming from common schema?

Yes, but because additionalProperties is set to false here, we must explicitly include the subset of properties from the common schema that are allowed for this particular instance. I counted over a dozen other bindings doing the same.

Quoted 5 lines
Quoted 1 line

In case I have misunderstood, please let me know.

If you are listing now most of touchscreen properties, it is a sign you should use just unevaluatedProperties: false (instead additionalProperties) and then no need for any of these here.

At present, touchscreen.yaml offers 17 properties. I am only replicating 5 of them, so this binding may not be such a case for this idea. That said, I tried your suggestion locally.

In the present implementation (additionalProperties: false), the tooling rightfully presents an error if the example includes a property that is not explicitly offered (e.g. 'touchscreen-x-plate-ohms').

If I change the binding to use "unevaluatedProperties: false", the tooling accepts an example which includes this same property that is not supported by this particular hardware. This seems like a regression.

In my humble opinion, the present implementation is optimal. It is for that reason we see multiple bindings with this same block of inherited properties. I will leave this unchanged; please let me know in case I have misunderstood.

Quoted 44 lines
Quoted 44 lines
Quoted 43 lines
Quoted 31 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +28 -0
+
+  trackpad:
+    type: object
+    description: Represents all channels associated with the trackpad.
+
+    properties:
+      azoteq,channel-select:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        minItems: 1
+        maxItems: 12
+        items:
+          minimum: 0
+          maximum: 13
+        description:
+          Specifies the order of the channels that participate in the trackpad.
+          Specify 255 to omit a given channel for the purpose of mapping a non-
+          rectangular trackpad.
+
+      azoteq,num-rows:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12
+        description: Specifies the number of rows that comprise the trackpad.
+
+      azoteq,num-cols:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 1
+        maximum: 12

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 219

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +10 -0
+        description: Specifies the number of columns that comprise the trackpad.
+
+      azoteq,top-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        multipleOf: 4
+        minimum: 0
+        maximum: 1020
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          no longer applied.

Units?

Quoted 7 lines
Quoted 3 lines

This is a ratiometric, i.e. unitless value that represents a hardware filter coefficient. It already exists in this binding prior to this patch under the slider-0/1 node and is simply re-used here.

Then mention the ratio (e.g. "speed of movement expressed as ratio of..."). Description said "speed" and we usually measure speed in very specific units.

ACK; this is a good call-out. Please note that the existing binding uses the same language elsewhere; I will mirror the updated language to the existing instances in a separate patch.

Quoted 160 lines
Quoted 41 lines
Quoted 12 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 227

Quoted 11 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +8 -0
+
+      azoteq,bottom-speed:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description:
+          Specifies the speed of movement after which coordinate filtering is
+          linearly reduced.
Quoted 1 line

Units?

Same here.

Quoted 9 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 233

Quoted 7 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +6 -0
+
+      azoteq,use-prox:
+        type: boolean
+        description:
+          Directs the trackpad to respond to the proximity states of the se-
+          lected channels instead of their corresponding touch states. Note

Don't split the words.

ACK.

Quoted 11 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml properties: · line 242

Quoted 10 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +9 -0
+          the trackpad cannot report granular coordinates during a state of
+          proximity.
+
+    patternProperties:
+      "^azoteq,lower-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's lower starting points.
Quoted 1 line

Why would you need this property? Why does this represent hardware property?

Quoted 8 lines

This property and its cousin below define the physical boundaries of the touch surface. They are typically used to mask areas that cannot elicit an electrical response due to manufacturing tolerances or the presence of an overlay. For that reason, they descend directly from properties of the hardware.

Similar properties already exist in this binding for the slider case; this device simply extends the functionality to a second dimenstion.

OK

Quoted 103 lines
Quoted 94 lines
Quoted 94 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +80 -0
+
+      "^azoteq,upper-cal-(x|y)$":
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 255
+        description: Specifies the trackpad's upper starting points.
+
+      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
+        type: object
+        $ref: input.yaml#
+        description:
+          Represents a press or gesture event reported by the trackpad. Specify
+          'linux,code' under the press event to report absolute coordinates.
+
+        properties:
+          linux,code: true
+
+          azoteq,gesture-angle-tighten:
+            type: boolean
+            description:
+              Limits the tangent of the gesture angle to 0.5 (axial gestures
+              only). If specified in one direction, the effect is applied in
+              either direction.
+
+          azoteq,gesture-max-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) within which a tap, swipe
+              or flick gesture must be completed in order to be acknowledged
+              by the device. The number specified for any one swipe or flick
+              gesture applies to all other swipe or flick gestures.
+
+          azoteq,gesture-min-ms:
+            multipleOf: 16
+            minimum: 0
+            maximum: 4080
+            description:
+              Specifies the length of time (in ms) for which a tap gesture must
+              be held in order to be acknowledged by the device.
+
+          azoteq,gesture-dist:
+            $ref: /schemas/types.yaml#/definitions/uint32
+            minimum: 0
+            maximum: 65535
+            description:
+              Specifies the distance across which a tap, swipe or flick gesture
+              must travel in order to be acknowledged by the device. The number
+              specified for any one swipe or flick gesture applies to all other
+              swipe or flick gestures.
+
+          azoteq,gpio-select:
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            minItems: 1
+            maxItems: 3
+            items:
+              minimum: 0
+              maximum: 2
+            description: |
+              Specifies one or more GPIO mapped to the event as follows:
+              0: GPIO0
+              1: GPIO3
+              2: GPIO4
+
+              Note that although multiple events can be mapped to a single
+              GPIO, they must all be of the same type (proximity, touch or
+              trackpad gesture).
+
+        additionalProperties: false
+
+    required:
+      - azoteq,channel-select
+
+    additionalProperties: false
+
 patternProperties:
   "^cycle-[0-9]$":
     type: object
@@ -288,6 +431,10 @@ patternProperties:
           Activates the reference channel in response to proximity events
           instead of touch events.
 
+      azoteq,counts-filt-enable:
+        type: boolean
+        description: Applies counts filtering to the channel.
+
       azoteq,ati-band:
         $ref: /schemas/types.yaml#/definitions/uint32
         enum: [0, 1, 2, 3]
@@ -432,12 +579,12 @@ patternProperties:
             description: |
Quoted 8 lines

Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml patternProperties: · line 583

Quoted 6 lines
Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +2 -2
               Specifies one or more GPIO mapped to the event as follows:
               0: GPIO0
-              1: GPIO3 (IQS7222C only)
-              2: GPIO4 (IQS7222C only)
+              1: GPIO3
+              2: GPIO4

Why changing this? Is it valid for IQS7222A?

Quoted 4 lines

It's not, only for 'C' and now 'D'. However, the restriction for 'A' is already conveyed in an if/then schema in the original binding. So rather than updating this text to say "(IQS7222C and IQS7222D only)", I opted to drop the open-coded text and rely on the existing schema.

Quoted 8 lines

OK

Quoted 1 line

Best regards,
Krzysztof

Kind regards,
Jeff LaBundy