* [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D @ 2023-05-31 1:49 Jeff LaBundy 2023-05-31 1:51 ` [PATCH 2/2] Input: iqs7222 - add support " Jeff LaBundy 2023-05-31 17:22 ` [PATCH 1/2] dt-bindings: input: iqs7222: Add properties " Krzysztof Kozlowski 0 siblings, 2 replies; 7+ messages in thread From: Jeff LaBundy @ 2023-05-31 1:49 UTC (permalink / raw) To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, jeff Extend the common binding to include a new variant of the silicon. Signed-off-by: Jeff LaBundy <jeff@labundy.com> --- .../bindings/input/azoteq,iqs7222.yaml | 202 +++++++++++++++++- 1 file changed, 192 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml index 9ddba7f2e7aa..a4c251a430fa 100644 --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml @@ -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 <jeff@labundy.com> 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: -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] Input: iqs7222 - add support for Azoteq IQS7222D 2023-05-31 1:49 [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D Jeff LaBundy @ 2023-05-31 1:51 ` Jeff LaBundy 2023-05-31 16:45 ` kernel test robot 2023-05-31 17:22 ` [PATCH 1/2] dt-bindings: input: iqs7222: Add properties " Krzysztof Kozlowski 1 sibling, 1 reply; 7+ messages in thread From: Jeff LaBundy @ 2023-05-31 1:51 UTC (permalink / raw) To: dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree, jeff 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. Signed-off-by: Jeff LaBundy <jeff@labundy.com> --- drivers/input/misc/Kconfig | 4 +- drivers/input/misc/iqs7222.c | 468 ++++++++++++++++++++++++++++++++++- 2 files changed, 461 insertions(+), 11 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 81a54a59e13c..c47eecc6f83b 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -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 diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c index 096b0925f41b..b837274b03f0 100644 --- a/drivers/input/misc/iqs7222.c +++ b/drivers/input/misc/iqs7222.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Azoteq IQS7222A/B/C Capacitive Touch Controller + * Azoteq IQS7222A/B/C/D Capacitive Touch Controller * * Copyright (C) 2022 Jeff LaBundy <jeff@labundy.com> */ @@ -12,6 +12,7 @@ #include <linux/gpio/consumer.h> #include <linux/i2c.h> #include <linux/input.h> +#include <linux/input/touchscreen.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/ktime.h> @@ -25,6 +26,7 @@ #define IQS7222_PROD_NUM_A 840 #define IQS7222_PROD_NUM_B 698 #define IQS7222_PROD_NUM_C 863 +#define IQS7222_PROD_NUM_D 1046 #define IQS7222_SYS_STATUS 0x10 #define IQS7222_SYS_STATUS_RESET BIT(3) @@ -54,6 +56,7 @@ #define IQS7222_EVENT_MASK_ATI BIT(12) #define IQS7222_EVENT_MASK_SLDR BIT(10) +#define IQS7222_EVENT_MASK_TPAD IQS7222_EVENT_MASK_SLDR #define IQS7222_EVENT_MASK_TOUCH BIT(1) #define IQS7222_EVENT_MASK_PROX BIT(0) @@ -71,6 +74,7 @@ #define IQS7222_MAX_COLS_CHAN 6 #define IQS7222_MAX_COLS_FILT 2 #define IQS7222_MAX_COLS_SLDR 11 +#define IQS7222_MAX_COLS_TPAD 24 #define IQS7222_MAX_COLS_GPIO 3 #define IQS7222_MAX_COLS_SYS 13 @@ -102,16 +106,18 @@ enum iqs7222_reg_grp_id { IQS7222_REG_GRP_BTN, IQS7222_REG_GRP_CHAN, IQS7222_REG_GRP_SLDR, + IQS7222_REG_GRP_TPAD, IQS7222_REG_GRP_GPIO, IQS7222_REG_GRP_SYS, IQS7222_NUM_REG_GRPS }; static const char * const iqs7222_reg_grp_names[IQS7222_NUM_REG_GRPS] = { - [IQS7222_REG_GRP_CYCLE] = "cycle", - [IQS7222_REG_GRP_CHAN] = "channel", - [IQS7222_REG_GRP_SLDR] = "slider", - [IQS7222_REG_GRP_GPIO] = "gpio", + [IQS7222_REG_GRP_CYCLE] = "cycle-%d", + [IQS7222_REG_GRP_CHAN] = "channel-%d", + [IQS7222_REG_GRP_SLDR] = "slider-%d", + [IQS7222_REG_GRP_TPAD] = "trackpad", + [IQS7222_REG_GRP_GPIO] = "gpio-%d", }; static const unsigned int iqs7222_max_cols[IQS7222_NUM_REG_GRPS] = { @@ -122,6 +128,7 @@ static const unsigned int iqs7222_max_cols[IQS7222_NUM_REG_GRPS] = { [IQS7222_REG_GRP_CHAN] = IQS7222_MAX_COLS_CHAN, [IQS7222_REG_GRP_FILT] = IQS7222_MAX_COLS_FILT, [IQS7222_REG_GRP_SLDR] = IQS7222_MAX_COLS_SLDR, + [IQS7222_REG_GRP_TPAD] = IQS7222_MAX_COLS_TPAD, [IQS7222_REG_GRP_GPIO] = IQS7222_MAX_COLS_GPIO, [IQS7222_REG_GRP_SYS] = IQS7222_MAX_COLS_SYS, }; @@ -130,8 +137,10 @@ static const unsigned int iqs7222_gpio_links[] = { 2, 5, 6, }; struct iqs7222_event_desc { const char *name; + u16 link; u16 mask; u16 val; + u16 strict; u16 enable; enum iqs7222_reg_key_id reg_key; }; @@ -188,6 +197,93 @@ static const struct iqs7222_event_desc iqs7222_sl_events[] = { }, }; +static const struct iqs7222_event_desc iqs7222_tp_events[] = { + { + .name = "event-press", + .link = BIT(7), + }, + { + .name = "event-tap", + .link = BIT(0), + .mask = BIT(0), + .val = BIT(0), + .enable = BIT(0), + .reg_key = IQS7222_REG_KEY_TAP, + }, + { + .name = "event-swipe-x-pos", + .link = BIT(2), + .mask = BIT(2) | BIT(1), + .val = BIT(2), + .strict = BIT(4), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-y-pos", + .link = BIT(3), + .mask = BIT(3) | BIT(1), + .val = BIT(3), + .strict = BIT(3), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-x-neg", + .link = BIT(4), + .mask = BIT(4) | BIT(1), + .val = BIT(4), + .strict = BIT(4), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-swipe-y-neg", + .link = BIT(5), + .mask = BIT(5) | BIT(1), + .val = BIT(5), + .strict = BIT(3), + .enable = BIT(1), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-x-pos", + .link = BIT(2), + .mask = BIT(2) | BIT(1), + .val = BIT(2) | BIT(1), + .strict = BIT(4), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-y-pos", + .link = BIT(3), + .mask = BIT(3) | BIT(1), + .val = BIT(3) | BIT(1), + .strict = BIT(3), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-x-neg", + .link = BIT(4), + .mask = BIT(4) | BIT(1), + .val = BIT(4) | BIT(1), + .strict = BIT(4), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, + { + .name = "event-flick-y-neg", + .link = BIT(5), + .mask = BIT(5) | BIT(1), + .val = BIT(5) | BIT(1), + .strict = BIT(3), + .enable = BIT(2), + .reg_key = IQS7222_REG_KEY_AXIAL, + }, +}; + struct iqs7222_reg_grp_desc { u16 base; int num_row; @@ -524,6 +620,62 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = { }, }, }, + { + .prod_num = IQS7222_PROD_NUM_D, + .fw_major = 0, + .fw_minor = 37, + .touch_link = 1770, + .allow_offset = 9, + .event_offset = 10, + .comms_offset = 11, + .reg_grps = { + [IQS7222_REG_GRP_STAT] = { + .base = IQS7222_SYS_STATUS, + .num_row = 1, + .num_col = 7, + }, + [IQS7222_REG_GRP_CYCLE] = { + .base = 0x8000, + .num_row = 7, + .num_col = 2, + }, + [IQS7222_REG_GRP_GLBL] = { + .base = 0x8700, + .num_row = 1, + .num_col = 3, + }, + [IQS7222_REG_GRP_BTN] = { + .base = 0x9000, + .num_row = 14, + .num_col = 3, + }, + [IQS7222_REG_GRP_CHAN] = { + .base = 0xA000, + .num_row = 14, + .num_col = 4, + }, + [IQS7222_REG_GRP_FILT] = { + .base = 0xAE00, + .num_row = 1, + .num_col = 2, + }, + [IQS7222_REG_GRP_TPAD] = { + .base = 0xB000, + .num_row = 1, + .num_col = 24, + }, + [IQS7222_REG_GRP_GPIO] = { + .base = 0xC000, + .num_row = 3, + .num_col = 3, + }, + [IQS7222_REG_GRP_SYS] = { + .base = IQS7222_SYS_SETUP, + .num_row = 1, + .num_col = 12, + }, + }, + }, }; struct iqs7222_prop_desc { @@ -1008,6 +1160,123 @@ static const struct iqs7222_prop_desc iqs7222_props[] = { .val_pitch = 4, .label = "maximum gesture time", }, + { + .name = "azoteq,num-rows", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 0, + .reg_shift = 4, + .reg_width = 4, + .val_min = 1, + .val_max = 12, + .label = "number of rows", + }, + { + .name = "azoteq,num-cols", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 0, + .reg_shift = 0, + .reg_width = 4, + .val_min = 1, + .val_max = 12, + .label = "number of columns", + }, + { + .name = "azoteq,lower-cal-y", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 1, + .reg_shift = 8, + .reg_width = 8, + .label = "lower vertical calibration", + }, + { + .name = "azoteq,lower-cal-x", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 1, + .reg_shift = 0, + .reg_width = 8, + .label = "lower horizontal calibration", + }, + { + .name = "azoteq,upper-cal-y", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 2, + .reg_shift = 8, + .reg_width = 8, + .label = "upper vertical calibration", + }, + { + .name = "azoteq,upper-cal-x", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 2, + .reg_shift = 0, + .reg_width = 8, + .label = "upper horizontal calibration", + }, + { + .name = "azoteq,top-speed", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 3, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 4, + .label = "top speed", + }, + { + .name = "azoteq,bottom-speed", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_offset = 3, + .reg_shift = 0, + .reg_width = 8, + .label = "bottom speed", + }, + { + .name = "azoteq,gesture-min-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 20, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 16, + .label = "minimum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_AXIAL, + .reg_offset = 21, + .reg_shift = 8, + .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-max-ms", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 21, + .reg_shift = 0, + .reg_width = 8, + .val_pitch = 16, + .label = "maximum gesture time", + }, + { + .name = "azoteq,gesture-dist", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_TAP, + .reg_offset = 22, + .reg_shift = 0, + .reg_width = 16, + .label = "gesture distance", + }, + { + .name = "azoteq,gesture-dist", + .reg_grp = IQS7222_REG_GRP_TPAD, + .reg_key = IQS7222_REG_KEY_AXIAL, + .reg_offset = 23, + .reg_shift = 0, + .reg_width = 16, + .label = "gesture distance", + }, { .name = "drive-open-drain", .reg_grp = IQS7222_REG_GRP_GPIO, @@ -1091,16 +1360,19 @@ struct iqs7222_private { struct gpio_desc *irq_gpio; struct i2c_client *client; struct input_dev *keypad; + struct touchscreen_properties prop; unsigned int kp_type[IQS7222_MAX_CHAN][ARRAY_SIZE(iqs7222_kp_events)]; unsigned int kp_code[IQS7222_MAX_CHAN][ARRAY_SIZE(iqs7222_kp_events)]; unsigned int sl_code[IQS7222_MAX_SLDR][ARRAY_SIZE(iqs7222_sl_events)]; unsigned int sl_axis[IQS7222_MAX_SLDR]; + unsigned int tp_code[ARRAY_SIZE(iqs7222_tp_events)]; u16 cycle_setup[IQS7222_MAX_CHAN / 2][IQS7222_MAX_COLS_CYCLE]; u16 glbl_setup[IQS7222_MAX_COLS_GLBL]; u16 btn_setup[IQS7222_MAX_CHAN][IQS7222_MAX_COLS_BTN]; u16 chan_setup[IQS7222_MAX_CHAN][IQS7222_MAX_COLS_CHAN]; u16 filt_setup[IQS7222_MAX_COLS_FILT]; u16 sldr_setup[IQS7222_MAX_SLDR][IQS7222_MAX_COLS_SLDR]; + u16 tpad_setup[IQS7222_MAX_COLS_TPAD]; u16 gpio_setup[ARRAY_SIZE(iqs7222_gpio_links)][IQS7222_MAX_COLS_GPIO]; u16 sys_setup[IQS7222_MAX_COLS_SYS]; }; @@ -1127,6 +1399,9 @@ static u16 *iqs7222_setup(struct iqs7222_private *iqs7222, case IQS7222_REG_GRP_SLDR: return iqs7222->sldr_setup[row]; + case IQS7222_REG_GRP_TPAD: + return iqs7222->tpad_setup; + case IQS7222_REG_GRP_GPIO: return iqs7222->gpio_setup[row]; @@ -1936,6 +2211,14 @@ static int iqs7222_parse_chan(struct iqs7222_private *iqs7222, ref_setup[4] = dev_desc->touch_link; if (fwnode_property_present(chan_node, "azoteq,use-prox")) ref_setup[4] -= 2; + } else if (dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row && + fwnode_property_present(chan_node, + "azoteq,counts-filt-enable")) { + /* + * In the case of IQS7222D, however, the reference mode field + * is partially repurposed as a counts filter enable control. + */ + chan_setup[0] |= IQS7222_CHAN_SETUP_0_REF_MODE_REF; } if (fwnode_property_present(chan_node, "azoteq,rx-enable")) { @@ -2278,6 +2561,136 @@ static int iqs7222_parse_sldr(struct iqs7222_private *iqs7222, IQS7222_REG_KEY_NO_WHEEL); } +static int iqs7222_parse_tpad(struct iqs7222_private *iqs7222, + struct fwnode_handle *tpad_node, int tpad_index) +{ + const struct iqs7222_dev_desc *dev_desc = iqs7222->dev_desc; + struct touchscreen_properties *prop = &iqs7222->prop; + struct i2c_client *client = iqs7222->client; + int num_chan = dev_desc->reg_grps[IQS7222_REG_GRP_CHAN].num_row; + int count, error, i; + u16 *event_mask = &iqs7222->sys_setup[dev_desc->event_offset]; + u16 *tpad_setup = iqs7222->tpad_setup; + unsigned int chan_sel[12], val; + + error = iqs7222_parse_props(iqs7222, tpad_node, tpad_index, + IQS7222_REG_GRP_TPAD, + IQS7222_REG_KEY_NONE); + if (error) + return error; + + count = fwnode_property_count_u32(tpad_node, "azoteq,channel-select"); + if (count < 0) { + dev_err(&client->dev, "Failed to count %s channels: %d\n", + fwnode_get_name(tpad_node), count); + return count; + } else if (!count || count > ARRAY_SIZE(chan_sel)) { + dev_err(&client->dev, "Invalid number of %s channels\n", + fwnode_get_name(tpad_node)); + return -EINVAL; + } + + error = fwnode_property_read_u32_array(tpad_node, + "azoteq,channel-select", + chan_sel, count); + if (error) { + dev_err(&client->dev, "Failed to read %s channels: %d\n", + fwnode_get_name(tpad_node), error); + return error; + } + + tpad_setup[6] &= ~GENMASK(num_chan - 1, 0); + + for (i = 0; i < ARRAY_SIZE(chan_sel); i++) { + tpad_setup[8 + i] = 0; + if (i >= count || chan_sel[i] == U8_MAX) + continue; + + if (chan_sel[i] >= num_chan) { + dev_err(&client->dev, "Invalid %s channel: %u\n", + fwnode_get_name(tpad_node), chan_sel[i]); + return -EINVAL; + } + + /* + * The following fields indicate which channels participate in + * the trackpad, as well as each channel's relative placement. + */ + tpad_setup[6] |= BIT(chan_sel[i]); + tpad_setup[8 + i] = chan_sel[i] * 34 + 1072; + } + + tpad_setup[7] = dev_desc->touch_link; + if (fwnode_property_present(tpad_node, "azoteq,use-prox")) + tpad_setup[7] -= 2; + + for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++) + tpad_setup[20] &= ~(iqs7222_tp_events[i].strict | + iqs7222_tp_events[i].enable); + + for (i = 0; i < ARRAY_SIZE(iqs7222_tp_events); i++) { + const char *event_name = iqs7222_tp_events[i].name; + struct fwnode_handle *event_node; + + event_node = fwnode_get_named_child_node(tpad_node, event_name); + if (!event_node) + continue; + + if (fwnode_property_present(event_node, + "azoteq,gesture-angle-tighten")) + tpad_setup[20] |= iqs7222_tp_events[i].strict; + + tpad_setup[20] |= iqs7222_tp_events[i].enable; + + error = iqs7222_parse_event(iqs7222, event_node, tpad_index, + IQS7222_REG_GRP_TPAD, + iqs7222_tp_events[i].reg_key, + iqs7222_tp_events[i].link, 1566, + NULL, + &iqs7222->tp_code[i]); + fwnode_handle_put(event_node); + if (error) + return error; + + if (!dev_desc->event_offset) + continue; + + /* + * The press/release event is determined based on whether the + * coordinate fields report 0xFFFF and solely relies on touch + * or proximity interrupts to be unmasked. + */ + if (i) + *event_mask |= IQS7222_EVENT_MASK_TPAD; + else if (tpad_setup[7] == dev_desc->touch_link) + *event_mask |= IQS7222_EVENT_MASK_TOUCH; + else + *event_mask |= IQS7222_EVENT_MASK_PROX; + } + + if (!iqs7222->tp_code[0]) + return 0; + + input_set_abs_params(iqs7222->keypad, ABS_X, + 0, (tpad_setup[4] ? : 1) - 1, 0, 0); + + input_set_abs_params(iqs7222->keypad, ABS_Y, + 0, (tpad_setup[5] ? : 1) - 1, 0, 0); + + touchscreen_parse_properties(iqs7222->keypad, false, prop); + + if (prop->max_x >= U16_MAX || prop->max_y >= U16_MAX) { + dev_err(&client->dev, "Invalid trackpad size: %u*%u\n", + prop->max_x, prop->max_y); + return -EINVAL; + } + + tpad_setup[4] = prop->max_x + 1; + tpad_setup[5] = prop->max_y + 1; + + return 0; +} + static int (*iqs7222_parse_extra[IQS7222_NUM_REG_GRPS]) (struct iqs7222_private *iqs7222, struct fwnode_handle *reg_grp_node, @@ -2285,6 +2698,7 @@ static int (*iqs7222_parse_extra[IQS7222_NUM_REG_GRPS]) [IQS7222_REG_GRP_CYCLE] = iqs7222_parse_cycle, [IQS7222_REG_GRP_CHAN] = iqs7222_parse_chan, [IQS7222_REG_GRP_SLDR] = iqs7222_parse_sldr, + [IQS7222_REG_GRP_TPAD] = iqs7222_parse_tpad, }; static int iqs7222_parse_reg_grp(struct iqs7222_private *iqs7222, @@ -2298,7 +2712,7 @@ static int iqs7222_parse_reg_grp(struct iqs7222_private *iqs7222, if (iqs7222_reg_grp_names[reg_grp]) { char reg_grp_name[16]; - snprintf(reg_grp_name, sizeof(reg_grp_name), "%s-%d", + snprintf(reg_grp_name, sizeof(reg_grp_name), iqs7222_reg_grp_names[reg_grp], reg_grp_index); reg_grp_node = device_get_named_child_node(&client->dev, @@ -2346,8 +2760,8 @@ static int iqs7222_parse_all(struct iqs7222_private *iqs7222) continue; /* - * The IQS7222C exposes multiple GPIO and must be informed - * as to which GPIO this group represents. + * The IQS7222C and IQS7222D expose multiple GPIO and must be + * informed as to which GPIO this group represents. */ for (j = 0; j < ARRAY_SIZE(iqs7222_gpio_links); j++) gpio_setup[0] &= ~BIT(iqs7222_gpio_links[j]); @@ -2480,6 +2894,41 @@ static int iqs7222_report(struct iqs7222_private *iqs7222) iqs7222->sl_code[i][j], 0); } + for (i = 0; i < dev_desc->reg_grps[IQS7222_REG_GRP_TPAD].num_row; i++) { + u16 tpad_pos_x = le16_to_cpu(status[4]); + u16 tpad_pos_y = le16_to_cpu(status[5]); + u16 state = le16_to_cpu(status[6]); + + input_report_key(iqs7222->keypad, iqs7222->tp_code[0], + tpad_pos_x < U16_MAX); + + if (tpad_pos_x < U16_MAX) + touchscreen_report_pos(iqs7222->keypad, &iqs7222->prop, + tpad_pos_x, tpad_pos_y, false); + + if (!(le16_to_cpu(status[1]) & IQS7222_EVENT_MASK_TPAD)) + continue; + + /* + * Skip the press/release event, as it does not have separate + * status fields and is handled separately. + */ + for (j = 1; j < ARRAY_SIZE(iqs7222_tp_events); j++) { + u16 mask = iqs7222_tp_events[j].mask; + u16 val = iqs7222_tp_events[j].val; + + input_report_key(iqs7222->keypad, + iqs7222->tp_code[j], + (state & mask) == val); + } + + input_sync(iqs7222->keypad); + + for (j = 1; j < ARRAY_SIZE(iqs7222_tp_events); j++) + input_report_key(iqs7222->keypad, + iqs7222->tp_code[j], 0); + } + input_sync(iqs7222->keypad); return 0; @@ -2584,6 +3033,7 @@ static const struct of_device_id iqs7222_of_match[] = { { .compatible = "azoteq,iqs7222a" }, { .compatible = "azoteq,iqs7222b" }, { .compatible = "azoteq,iqs7222c" }, + { .compatible = "azoteq,iqs7222d" }, { } }; MODULE_DEVICE_TABLE(of, iqs7222_of_match); @@ -2598,5 +3048,5 @@ static struct i2c_driver iqs7222_i2c_driver = { module_i2c_driver(iqs7222_i2c_driver); MODULE_AUTHOR("Jeff LaBundy <jeff@labundy.com>"); -MODULE_DESCRIPTION("Azoteq IQS7222A/B/C Capacitive Touch Controller"); +MODULE_DESCRIPTION("Azoteq IQS7222A/B/C/D Capacitive Touch Controller"); MODULE_LICENSE("GPL"); -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] Input: iqs7222 - add support for Azoteq IQS7222D 2023-05-31 1:51 ` [PATCH 2/2] Input: iqs7222 - add support " Jeff LaBundy @ 2023-05-31 16:45 ` kernel test robot 0 siblings, 0 replies; 7+ messages in thread From: kernel test robot @ 2023-05-31 16:45 UTC (permalink / raw) To: Jeff LaBundy, dmitry.torokhov, robh+dt Cc: oe-kbuild-all, linux-input, devicetree, jeff 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/202306010012.Dmk3yaas-lkp@intel.com/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 <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202306010012.Dmk3yaas-lkp@intel.com/ 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 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D 2023-05-31 1:49 [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D Jeff LaBundy 2023-05-31 1:51 ` [PATCH 2/2] Input: iqs7222 - add support " Jeff LaBundy @ 2023-05-31 17:22 ` Krzysztof Kozlowski 2023-06-01 1:23 ` Jeff LaBundy 1 sibling, 1 reply; 7+ messages in thread From: Krzysztof Kozlowski @ 2023-05-31 17:22 UTC (permalink / raw) To: Jeff LaBundy, dmitry.torokhov, robh+dt; +Cc: linux-input, devicetree On 31/05/2023 03:49, Jeff LaBundy wrote: > Extend the common binding to include a new variant of the silicon. > > Signed-off-by: Jeff LaBundy <jeff@labundy.com> 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. > --- > .../bindings/input/azoteq,iqs7222.yaml | 202 +++++++++++++++++- > 1 file changed, 192 insertions(+), 10 deletions(-) > > diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > index 9ddba7f2e7aa..a4c251a430fa 100644 > --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > @@ -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 <jeff@labundy.com> > > 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. > > 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 Why? Aren't they coming from common schema? > + > + 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. Units? > + > + 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? > + > + 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. > + 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? > + > + "^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 Why changing this? Is it valid for IQS7222A? > > 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 The binding got quite complicated. Are you sure these are similar devices? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D 2023-05-31 17:22 ` [PATCH 1/2] dt-bindings: input: iqs7222: Add properties " Krzysztof Kozlowski @ 2023-06-01 1:23 ` Jeff LaBundy 2023-06-02 7:21 ` Krzysztof Kozlowski 0 siblings, 1 reply; 7+ messages in thread From: Jeff LaBundy @ 2023-06-01 1:23 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: dmitry.torokhov, robh+dt, linux-input, devicetree, krzysztof.kozlowski+dt, conor+dt Hi Krzysztof, On Wed, May 31, 2023 at 07:22:31PM +0200, Krzysztof Kozlowski wrote: > On 31/05/2023 03:49, Jeff LaBundy wrote: > > Extend the common binding to include a new variant of the silicon. > > > > Signed-off-by: Jeff LaBundy <jeff@labundy.com> > > 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. > > > --- > > .../bindings/input/azoteq,iqs7222.yaml | 202 +++++++++++++++++- > > 1 file changed, 192 insertions(+), 10 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > > index 9ddba7f2e7aa..a4c251a430fa 100644 > > --- a/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > > +++ b/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml > > @@ -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 <jeff@labundy.com> > > > > 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. > > > > > 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 > > 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. > > > + > > + 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. > > 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. > > > + > > + 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. > > > + > > + 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. > > > + 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? 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. > > > + > > + "^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 > > 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. > > > > 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 > > 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/ > > Best regards, > Krzysztof > Kind regards, Jeff LaBundy ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D 2023-06-01 1:23 ` Jeff LaBundy @ 2023-06-02 7:21 ` Krzysztof Kozlowski 2023-06-12 0:29 ` Jeff LaBundy 0 siblings, 1 reply; 7+ messages in thread From: Krzysztof Kozlowski @ 2023-06-02 7:21 UTC (permalink / raw) To: Jeff LaBundy, Krzysztof Kozlowski Cc: dmitry.torokhov, robh+dt, linux-input, devicetree, krzysztof.kozlowski+dt, conor+dt On 01/06/2023 03:23, Jeff LaBundy wrote: >>> >>> 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 >> >> 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. 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. > >> >>> + >>> + 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. >> >> 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. 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. > >> >>> + >>> + 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. > >> >>> + >>> + 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. > >> >>> + 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? > > 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 > >> >>> + >>> + "^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 >> >> 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. OK > Best regards, Krzysztof ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D 2023-06-02 7:21 ` Krzysztof Kozlowski @ 2023-06-12 0:29 ` Jeff LaBundy 0 siblings, 0 replies; 7+ messages in thread From: Jeff LaBundy @ 2023-06-12 0:29 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Krzysztof Kozlowski, dmitry.torokhov, robh+dt, linux-input, devicetree, krzysztof.kozlowski+dt, conor+dt Hi Krzysztof, On Fri, Jun 02, 2023 at 09:21:00AM +0200, Krzysztof Kozlowski wrote: > On 01/06/2023 03:23, Jeff LaBundy wrote: > >>> > >>> 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 > >> > >> 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. > > 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. > > > > >> > >>> + > >>> + 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. > >> > >> 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. > > 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. > > > > >> > >>> + > >>> + 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. > > > >> > >>> + > >>> + 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. > > > >> > >>> + 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? > > > > 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 > > > > >> > >>> + > >>> + "^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 > >> > >> 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. > > OK > > > > > > Best regards, > Krzysztof > Kind regards, Jeff LaBundy ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-06-12 0:30 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-05-31 1:49 [PATCH 1/2] dt-bindings: input: iqs7222: Add properties for Azoteq IQS7222D Jeff LaBundy 2023-05-31 1:51 ` [PATCH 2/2] Input: iqs7222 - add support " Jeff LaBundy 2023-05-31 16:45 ` kernel test robot 2023-05-31 17:22 ` [PATCH 1/2] dt-bindings: input: iqs7222: Add properties " Krzysztof Kozlowski 2023-06-01 1:23 ` Jeff LaBundy 2023-06-02 7:21 ` Krzysztof Kozlowski 2023-06-12 0:29 ` Jeff LaBundy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).