Input: Add TouchNetix aXiom touchscreen driver
Subsystems (3)
v2 cover Input: Add TouchNetix aXiom touchscreen driver
Add a new driver for the TouchNetix's aXiom family of touchscreen controller. This driver only support i2c and can be later adapted for SPI and USB support.
---
Changes in v2:
- Add device tree binding documentation
- Move core functions in axiom_i2c as we only care about i2c support now
- Use static function when required
- Use syntax dev_err_probe()
- Add an hardware based reset
Kamel Bouhara (3):
dt-bindings: vendor-prefixes: Add TouchNetix AS
dt-bindings: input: Add bindings for TouchNetix axiom touchscreen
Input: Add TouchNetix aXiom i2c touchscreen driver
.../touchscreen/touchnetix,axiom_ax54a.yaml | 52 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 6 + drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + .../input/touchscreen/touchnetix_axiom_i2c.c | 751 ++++++++++++++++++ 6 files changed, 825 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom_ax54a.yaml create mode 100644 drivers/input/touchscreen/touchnetix_axiom_i2c.c
Signature · 1 line
2.25.1
PATCH v2 1/3 dt-bindings: vendor-prefixes: Add TouchNetix AS
Add vendor prefix for TouchNetix AS (https://www.touchnetix.com/products/).
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1400,6 +1400,8 @@ patternProperties: description: Toradex AG "^toshiba,.*": description: Toshiba Corporation + "^touchnetix,.*": + description: TouchNetix AS "^toumaz,.*": description: Toumaz "^tpk,.*":
Signature · 1 line
2.25.1
Re: [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add TouchNetix AS
Quoted 4 lines · Kamel Bouhara
Add vendor prefix for TouchNetix AS (https://www.touchnetix.com/products/).
Signed-off-by Kamel Bouhara <[email protected]>---
Best regards,
Krzysztof
PATCH v2 2/3 dt-bindings: input: Add bindings for TouchNetix axiom touchscreen
In reply to Kamel BouharaAdd the TouchNetix axiom I2C touchscreen device tree bindings documentation.
--- .../touchscreen/touchnetix,axiom-ax54a.yaml | 51 +++++++++++++++++++ MAINTAINERS | 6 +++ 2 files changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +51 -0
@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/touchnetix,axiom-ax54a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TouchNetix Axiom series touchscreen controller + +maintainers: + - Kamel Bouhara <[email protected]> + +properties: + compatible: + const: touchnetix,axiom-ax54a + + reg: + const: 0x66 + + interrupts: + maxItems: 1 + + irq-gpios: + maxItems: 1 + + reset-gpios: + maxItems: 1 + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + axiom@66 { + compatible = "touchnetix,axiom-ax54a"; + reg = <0x66>; + interrupt-parent = <&gpio2>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + irq-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + }; + }; + +...
MAINTAINERS +6 -0
@@ -21410,6 +21410,12 @@ S: Maintained F: Documentation/ABI/testing/sysfs-class-firmware-attributes F: drivers/platform/x86/think-lmi.? +TOUCHNETIX AXIOM I2C TOUCHSCREEN DRIVER +M: Kamel Bouhara <[email protected]> +L: [email protected] +S: Maintained +F: Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml + THUNDERBOLT DMA TRAFFIC TEST DRIVER M: Isaac Hazan <[email protected]> L: [email protected]
Signature · 1 line
2.25.1
Re: [PATCH v2 2/3] dt-bindings: input: Add bindings for TouchNetix axiom touchscreen
Quoted 2 lines · Kamel Bouhara
Add the TouchNetix axiom I2C touchscreen device tree bindings documentation.
A nit, subject: drop second/last, redundant "bindings for". The "dt-bindings" prefix is already stating that these are bindings.
Quoted 27 lines
Signed-off-by Kamel Bouhara <[email protected]>--- .../touchscreen/touchnetix,axiom-ax54a.yaml | 51 +++++++++++++++++++ MAINTAINERS | 6 +++ 2 files changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yamlDocumentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +13
-0@@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/touchnetix,axiom-ax54a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TouchNetix Axiom series touchscreen controller + +maintainers: + - Kamel Bouhara <[email protected]> + +properties: + compatible:
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml line 23
Quoted 10 lines
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +10
-0+ const: touchnetix,axiom-ax54a + + reg: + const: 0x66 + + interrupts: + maxItems: 1 + + irq-gpios: + maxItems: 1
Why these are GPIOs? Interrupts are usually just interrupts... You need to clearly describe this.
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml line 28
Quoted 5 lines
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +5
-0+ + reset-gpios: + maxItems: 1 + +additionalProperties: false
This goes after required: block.
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml line 41
Quoted 13 lines
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +13
-0+ +required: + - compatible + - reg + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + axiom@66 {
Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification:
https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml line 46
Quoted 5 lines
Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml new file +5
-0+ compatible = "touchnetix,axiom-ax54a"; + reg = <0x66>; + interrupt-parent = <&gpio2>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + irq-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
Eh? This looks really wrong.
Best regards,
Krzysztof
PATCH v2 3/3 Input: Add TouchNetix aXiom i2c touchscreen driver
In reply to Kamel BouharaAdd a new driver for the TouchNetix's aXiom family of touchscreen controllers. This driver only supports i2c and can be later adapted for SPI and USB support.
--- MAINTAINERS | 1 + drivers/input/touchscreen/Kconfig | 13 + drivers/input/touchscreen/Makefile | 1 + .../input/touchscreen/touchnetix_axiom_i2c.c | 747 ++++++++++++++++++ 4 files changed, 762 insertions(+) create mode 100644 drivers/input/touchscreen/touchnetix_axiom_i2c.c
MAINTAINERS +1 -0
@@ -21415,6 +21415,7 @@ M: Kamel Bouhara <[email protected]> L: [email protected] S: Maintained F: Documentation/devicetree/bindings/input/touchscreen/touchnetix,axiom-ax54a.yaml +F: drivers/input/touchscreen/touchnetix_axiom_i2c.c THUNDERBOLT DMA TRAFFIC TEST DRIVER M: Isaac Hazan <[email protected]>
drivers/input/touchscreen/Kconfig +13 -0
@@ -803,6 +803,19 @@ config TOUCHSCREEN_MIGOR To compile this driver as a module, choose M here: the module will be called migor_ts. +config TOUCHSCREEN_TOUCHNETIX_AXIOM_I2C + tristate "TouchNetix AXIOM based touchscreen controllers" + depends on I2C + depends on GPIOLIB || COMPILE_TEST + help + Say Y here if you have a axiom touchscreen connected to + your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called axiom_i2c. + config TOUCHSCREEN_TOUCHRIGHT tristate "Touchright serial touchscreen" select SERIO
drivers/input/touchscreen/Makefile +1 -0
@@ -88,6 +88,7 @@ obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o obj-$(CONFIG_TOUCHSCREEN_SURFACE3_SPI) += surface3_spi.o obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o +obj-$(CONFIG_TOUCHSCREEN_TOUCHNETIX_AXIOM_I2C) += touchnetix_axiom_i2c.o obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o obj-$(CONFIG_TOUCHSCREEN_TS4800) += ts4800-ts.o
drivers/input/touchscreen/touchnetix_axiom_i2c.c new file +747 -0
747 lines not on this page · raw message
Signature · 1 line
2.25.1
kernel test robot
build botRe: [PATCH v2 3/3] Input: Add TouchNetix aXiom i2c touchscreen driver
kernel test robot noticed the following build warnings:
Hi Kamel,
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 krzk-dt/for-next linus/master v6.6-rc5 next-20231009] [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/Kamel-Bouhara/dt-bindings-vendor-prefixes-Add-TouchNetix-AS/20231009-214751 base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next patch link: https://lore.kernel.org/r/20231009134435.36311-4-kamel.bouhara%40bootlin.com patch subject: [PATCH v2 3/3] Input: Add TouchNetix aXiom i2c touchscreen driver config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20231010/[email protected]/config) compiler: sparc64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231010/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
In file included from include/linux/byteorder/big_endian.h:5,
from arch/sparc/include/uapi/asm/byteorder.h:5, from include/asm-generic/qrwlock_types.h:6,
from arch/sparc/include/asm/spinlock_types.h:17, from include/linux/spinlock_types_raw.h:7,
from include/linux/ratelimit_types.h:7,
from include/linux/printk.h:9,
from include/asm-generic/bug.h:22,
from arch/sparc/include/asm/bug.h:25,
from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from arch/sparc/include/asm/current.h:15,
from include/linux/sched.h:12,
from include/linux/delay.h:23,
from drivers/input/touchscreen/touchnetix_axiom_i2c.c:16:
drivers/input/touchscreen/touchnetix_axiom_i2c.c: In function 'axiom_i2c_read':
>> include/uapi/linux/byteorder/big_endian.h:36:26: warning: conversion from 'short unsigned int' to 'unsigned char:1' changes value from '256' to '0' [-Woverflow]
36 | #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
| ^
include/linux/byteorder/generic.h:90:21: note: in expansion of macro '__cpu_to_le16'
90 | #define cpu_to_le16 __cpu_to_le16
| ^~~~~~~~~~~~~
drivers/input/touchscreen/touchnetix_axiom_i2c.c:214:27: note: in expansion of macro 'cpu_to_le16'
214 | cmd_header.read = cpu_to_le16(1);
| ^~~~~~~~~~~
drivers/input/touchscreen/touchnetix_axiom_i2c.c: At top level:
>> drivers/input/touchscreen/touchnetix_axiom_i2c.c:527:6: warning: no previous prototype for 'axiom_handle_events' [-Wmissing-prototypes]
527 | void axiom_handle_events(struct axiom_data *ts)
| ^~~~~~~~~~~~~~~~~~~
--
>> drivers/input/touchscreen/touchnetix_axiom_i2c.c:164: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst* Translate usage/page/offset triplet into physical address.
vim +/axiom_handle_events +527 drivers/input/touchscreen/touchnetix_axiom_i2c.c
522
523 /*
524 * Validates the crc and demultiplexes the axiom reports to the appropriate
525 * report handler
526 */
> 527 void axiom_handle_events(struct axiom_data *ts)
528 {
529 char *report_data = ts->rx_buf;
530 struct device *dev = ts->dev;
531 char usage = report_data[1];
532 u16 crc_report;
533 u16 crc_calc;
534 char len;
535
536 axiom_i2c_read(ts->client, AXIOM_REPORT_USAGE_ID, 0, report_data, ts->max_report_len);
537
538 if ((report_data[0] & AXIOM_COMMS_OVERFLOW_MASK) != 0)
539 ts->report_overflow_counter++;
540
541 len = (report_data[0] & AXIOM_COMMS_REPORT_LEN_MASK) * 2;
542 if (!len) {
543 dev_err(dev, "Zero length report discarded.\n");
544 return;
545 }
546
547 dev_dbg(dev, "Payload Data %*ph\n", len, report_data);
548
549 /* Validate the report CRC */
550 crc_report = (report_data[len - 1] << 8) | (report_data[len - 2]);
551 /* Length is in 16 bit words and remove the size of the CRC16 itself */
552 crc_calc = crc16(0, report_data, (len - 2));
553
554 if (crc_calc != crc_report) {
555 dev_err(dev,
556 "CRC mismatch! Expected: %#x, Calculated CRC: %#x.\n",
557 crc_report, crc_calc);
558 return;
559 }
560
561 switch (usage) {
562 case AXIOM_USAGE_2DCTS_REPORT_ID:
563 axiom_process_u41_report(ts, &report_data[1]);
564 break;
565
566 case AXIOM_USAGE_2AUX_REPORT_ID:
567 /* This is an aux report (force) */
568 axiom_process_u46_report(ts, &report_data[1]);
569 break;
570
571 case AXIOM_USAGE_2HB_REPORT_ID:
572 /* This is a heartbeat report */
573 break;
574 }
575
576 ts->report_counter++;
577 }
578
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki