Skip to contentSkip to conversation

dt-bindings: input: touchscreen: iqs5xx: Add bindings

PATCH In review Jeff LaBundy 2 participants 4 messages Apr 29, 2019 – Apr 30, 2019

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

PATCH v10 1/2 dt-bindings: input: touchscreen: iqs5xx: Add bindings

This patch adds binding documentation for the Azoteq IQS550/572/525 family of trackpad/touchscreen controllers.

---
Changes in v10:
- None

Changes in v9:
- Corrected the polarity of the reset GPIO in the example node to match that of the device's active-low NRST pin
- Removed previous Reviewed-by trailer as this file has since changed

Changes in v8:
- Added Reviewed-by trailer

Changes in v7:
- Removed the azoteq,exp-ver-major and azoteq,exp-ver-minor properties to match the driver's updated device identification scheme
- Updated the example node to use a level-sensitive interrupt rather than an edge-sensitive interrupt
- Removed previous Reviewed-by trailer as this file has since changed

Changes in v6:
- None

Changes in v5:
- None

Changes in v4:
- None

Changes in v3:
- Added Reviewed-by trailer

Changes in v2:
- Separated each valid "compatible" property with a line break
- Specified the polarity of the RDY and NRST pins
- Replaced duplicate definitions of common touchscreen properties with a reference to touchscreen.txt
- Specified the example node as "touchscreen@74"

 .../bindings/input/touchscreen/iqs5xx.txt          | 80 ++++++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.txt        |  1 +
 2 files changed, 81 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt
Documentation/devicetree/bindings/input/touchscreen/iqs5xx.txt new file +80 -0
new file mode 100644
index 0000000..efa0820
@@ -0,0 +1,80 @@
+Azoteq IQS550/572/525 Trackpad/Touchscreen Controller
+
+Required properties:
+
+- compatible			: Must be equal to one of the following:
+				  "azoteq,iqs550"
+				  "azoteq,iqs572"
+				  "azoteq,iqs525"
+
+- reg				: I2C slave address for the device.
+
+- interrupts			: GPIO to which the device's active-high RDY
+				  output is connected (see [0]).
+
+- reset-gpios			: GPIO to which the device's active-low NRST
+				  input is connected (see [1]).
+
+Optional properties:
+
+- touchscreen-min-x		: See [2].
+
+- touchscreen-min-y		: See [2].
+
+- touchscreen-size-x		: See [2]. If this property is omitted, the
+				  maximum x-coordinate is specified by the
+				  device's "X Resolution" register.
+
+- touchscreen-size-y		: See [2]. If this property is omitted, the
+				  maximum y-coordinate is specified by the
+				  device's "Y Resolution" register.
+
+- touchscreen-max-pressure	: See [2]. Pressure is expressed as the sum of
+				  the deltas across all channels impacted by a
+				  touch event. A channel's delta is calculated
+				  as its count value minus a reference, where
+				  the count value is inversely proportional to
+				  the channel's capacitance.
+
+- touchscreen-fuzz-x		: See [2].
+
+- touchscreen-fuzz-y		: See [2].
+
+- touchscreen-fuzz-pressure	: See [2].
+
+- touchscreen-inverted-x	: See [2]. Inversion is applied relative to that
+				  which may already be specified by the device's
+				  FLIP_X and FLIP_Y register fields.
+
+- touchscreen-inverted-y	: See [2]. Inversion is applied relative to that
+				  which may already be specified by the device's
+				  FLIP_X and FLIP_Y register fields.
+
+- touchscreen-swapped-x-y	: See [2]. Swapping is applied relative to that
+				  which may already be specified by the device's
+				  SWITCH_XY_AXIS register field.
+
+[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+[1]: Documentation/devicetree/bindings/gpio/gpio.txt
+[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
+
+Example:
+
+	&i2c1 {
+		/* ... */
+
+		touchscreen@74 {
+			compatible = "azoteq,iqs550";
+			reg = <0x74>;
+			interrupt-parent = <&gpio>;
+			interrupts = <17 4>;
+			reset-gpios = <&gpio 27 1>;
+
+			touchscreen-size-x = <640>;
+			touchscreen-size-y = <480>;
+
+			touchscreen-max-pressure = <16000>;
+		};
+
+		/* ... */
+	};
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
index 4b1a2a8..51f9954 100644
@@ -53,6 +53,7 @@ avic	Shanghai AVIC Optoelectronics Co., Ltd.
 avnet	Avnet, Inc.
 axentia	Axentia Technologies AB
 axis	Axis Communications AB
+azoteq	Azoteq (Pty) Ltd
 bananapi BIPAI KEJI LIMITED
 bhf	Beckhoff Automation GmbH & Co. KG
 bitmain	Bitmain Technologies

--
2.7.4

#1 lore raw

PATCH v10 2/2 input: touchscreen: Add support for Azoteq IQS550/572/525

This patch adds support for the Azoteq IQS550/572/525 family of trackpad/touchscreen controllers.

The driver has been tested with an IQS550EV02 evaluation board. A demonstration of the driver's capabilities is available here:

https://youtu.be/sRNNx4XZBts

---
Changes in v10:
- Changed the type of mlen to u16 in iqs5xx_write_burst to match the type of len (this and the previous change to iqs5xx_read_burst simply allow either to span the entire register map if needed for test purposes in the future)

Changes in v9:
- Swapped the values passed to gpiod_set_value_cansleep in iqs5xx_reset such that a value of '1' (active) places the device in reset
- Replaced buf of type u8 with an equal-size array of type iqs5xx_touch_data instead of redundantly casting buf as iqs5xx_touch_data in iqs5xx_irq
- Changed the type of len to u16 in iqs5xx_read_burst and iqs5xx_write_burst to match the type of i2c_msg.len
- Updated iqs5xx_bl_write and iqs5xx_bl_verify to use sizeof for calculating buffer size instead of ARRAY_SIZE
- Updated iqs5xx_fw_file_parse to use sizeof to determine the size passed to hex2bin instead of ARRAY_SIZE
- Reduced IQS5XX_REC_LEN_MAX from 256 to 255 to correctly reflect the maximum number of data bytes within a hex record

Changes in v8:
- Updated iqs5xx_fw_file_write to disable the interrupt before resetting the device, and reset the device into normal mode if the firmware update fails
- Updated iqs5xx_dev_init to validate the device's bootloader status
- Updated iqs5xx_irq to return IRQ_NONE instead of IRQ_HANDLED if the device unexpectedly asserts the RDY output during bootloader mode

Changes in v7:
- Changed the 'val' pointer type in iqs5xx_read_burst and iqs5xx_write_burst to void * and const void *, respectively so that callers need not cast
- Overhauled the device initialization process to simply enter the bootloader (for subsequent firmware updates from user space) rather than automatically updating firmware in response to version mismatches
- Withheld input device allocation and registration until the device has been successfully identified (or corrected firmware pushed from user space)
- Added comments in iqs5xx_fw_file_parse to explain why request_ihex_firmware is not used
- Delayed the return from iqs5xx_irq until the device releases its RDY output to allow the use of level-sensitive interrupts
- Removed IRQF_TRIGGER_RISING to preserve the type specified by device tree

Changes in v6:
- None

Changes in v5:
- Demoted the first instance of dev_err in iqs5xx_update_firmware to dev_info
- Updated the commit message to describe the test setup and provide a link to a demonstration of the driver's capabilities

Changes in v4:
- Replaced 'ret' with 'error' where applicable
- Made use of packed structures to parse device ID and touch data registers as well as firmware records
- Overhauled iqs5xx_update_firmware to make use of existing helper functions and to be robust against erroneous firmware files
- Refactored and fortified the bootloader steps in iqs5xx_update_firmware by allowing additional retries upon failure
- Optimized register read/write functions and added wrappers for single-byte transactions
- Updated the error handling in iqs5xx_set_state and removed the superfluous 'disabled' flag
- General improvements to error messages returned via dev_err

Changes in v3:
- None

Changes in v2:
- Rebased on top of updated iqs5xx.txt
- Refactored the axis configuration logic in iqs5xx_dev_init to adhere to the behavior defined in touchscreen.txt

 drivers/input/touchscreen/Kconfig  |   10 +
 drivers/input/touchscreen/Makefile |    1 +
 drivers/input/touchscreen/iqs5xx.c | 1129 ++++++++++++++++++++++++++++++++++++
 3 files changed, 1140 insertions(+)
 create mode 100644 drivers/input/touchscreen/iqs5xx.c
drivers/input/touchscreen/Kconfig +10 -0
index 6c16aae..d8337ed 100644
@@ -1311,4 +1311,14 @@ config TOUCHSCREEN_ROHM_BU21023
 	  To compile this driver as a module, choose M here: the
 	  module will be called bu21023_ts.
 
+config TOUCHSCREEN_IQS5XX
+	tristate "Azoteq IQS550/572/525 trackpad/touchscreen controller"
+	depends on I2C
+	help
+	  Say Y to enable support for the Azoteq IQS550/572/525
+	  family of trackpad/touchscreen controllers.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called iqs5xx.
+
 endif
drivers/input/touchscreen/Makefile +1 -0
index fcc7605..084a596 100644
@@ -110,3 +110,4 @@ obj-$(CONFIG_TOUCHSCREEN_ZFORCE)	+= zforce_ts.o
 obj-$(CONFIG_TOUCHSCREEN_COLIBRI_VF50)	+= colibri-vf50-ts.o
 obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023)	+= rohm_bu21023.o
 obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW)	+= raspberrypi-ts.o
+obj-$(CONFIG_TOUCHSCREEN_IQS5XX)	+= iqs5xx.o
drivers/input/touchscreen/iqs5xx.c new file +1129 -0

1,129 lines not on this page · raw message

--
2.7.4

maintainer
#2 lore raw
In reply to Jeff LaBundy

Hi Jeff,

Quoted 4 lines · Jeff LaBundy

This patch adds binding documentation for the Azoteq IQS550/572/525 family of trackpad/touchscreen controllers.

Quoted 8 lines

---
Changes in v10:
- None

Changes in v9:
- Corrected the polarity of the reset GPIO in the example node to match that of the device's active-low NRST pin
- Removed previous Reviewed-by trailer as this file has since changed

Applied with minor formatting changes. I restored Rob's reviewed-by since he was happy with the binding.

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

Hi Dmitry,

Many thanks for your support; your changes look great to me. I'll use the same indentation style for future patches.

Thanks,
Jeff L.

Quoted 24 lines · Dmitry Torokhov

Hi Jeff,

Quoted 4 lines · Jeff LaBundy

This patch adds binding documentation for the Azoteq IQS550/572/525 family of trackpad/touchscreen controllers.

Quoted 8 lines

---
Changes in v10:
- None

Changes in v9:
- Corrected the polarity of the reset GPIO in the example node to match that of the device's active-low NRST pin
- Removed previous Reviewed-by trailer as this file has since changed

Applied with minor formatting changes. I restored Rob's reviewed-by since he was happy with the binding.

Thanks.

Signature · 1 line
Dmitry