Skip to contentSkip to conversation

dt-bindings: input/touchscreen: add bindings for msg26xx

PATCH Superseded Vincent Knecht 3 participants 6 messages Jan 21, 2021 – Feb 10, 2021

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: input/touchscreen: add bindings for msg26xx

This adds dts bindings for the mstar msg26xx touchscreen.

---
Changed in v3:
- added touchscreen-size-x: true and touchscreen-size-y: true properties Changed in v2:
- changed M-Star to MStar in title line
- changed reset gpio to active-low in example section

---
 .../input/touchscreen/mstar,msg26xx.yaml      | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +69 -0
new file mode 100644
index 000000000000..5d26a1008bf1
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/mstar,msg26xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar msg26xx touchscreen controller Bindings
+
+maintainers:
+  - Vincent Knecht <[email protected]>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: mstar,msg26xx
+
+  reg:
+    const: 0x26
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  vdd-supply:
+    description: Power supply regulator for the chip
+
+  vddio-supply:
+    description: Power supply regulator for the I2C bus
+
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - reset-gpios
+  - touchscreen-size-x
+  - touchscreen-size-y
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      touchscreen@26 {
+        compatible = "mstar,msg26xx";
+        reg = <0x26>;
+        interrupt-parent = <&msmgpio>;
+        interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+        reset-gpios = <&msmgpio 100 GPIO_ACTIVE_LOW>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&ts_int_active>;
+        vdd-supply = <&pm8916_l17>;
+        vddio-supply = <&pm8916_l5>;
+        touchscreen-size-x = <720>;
+        touchscreen-size-y = <1280>;
+      };
+    };
+
+...
Signature · 1 line
2.29.2
#1 lore raw

PATCH v3 2/2 Input: add MStar msg26xx touchscreen driver

Add support for the msg26xx touchscreen IC from MStar.
This driver reuses zinitix.c structure, while the checksum and irq handler functions are based on out-of-tree driver for Alcatel Idol 3 (4.7").

---
Changed in v3:
- no change
Changed in v2:
- don't use bitfields in packet struct, to prevent endian-ness related problems (Dmitry)
- fix reset gpiod calls order in mstar_power_on() (Dmitry)

---
 drivers/input/touchscreen/Kconfig   |  12 +
 drivers/input/touchscreen/Makefile  |   1 +
 drivers/input/touchscreen/msg26xx.c | 369 ++++++++++++++++++++++++++++
 3 files changed, 382 insertions(+)
 create mode 100644 drivers/input/touchscreen/msg26xx.c
drivers/input/touchscreen/Kconfig +12 -0
index f012fe746df0..bc4f604b4841 100644
@@ -1334,4 +1334,16 @@ config TOUCHSCREEN_ZINITIX
 	  To compile this driver as a module, choose M here: the
 	  module will be called zinitix.
 
+config TOUCHSCREEN_MSG26XX
+	tristate "MStar msg26xx touchscreen support"
+	depends on I2C
+	depends on GPIOLIB || COMPILE_TEST
+	help
+	  Say Y here if you have an I2C touchscreen using MStar msg26xx.
+
+	  If unsure, say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called msg26xx.
+
 endif
drivers/input/touchscreen/Makefile +1 -0
index 6233541e9173..830ebf4973cb 100644
@@ -112,3 +112,4 @@ obj-$(CONFIG_TOUCHSCREEN_ROHM_BU21023)	+= rohm_bu21023.o
 obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW)	+= raspberrypi-ts.o
 obj-$(CONFIG_TOUCHSCREEN_IQS5XX)	+= iqs5xx.o
 obj-$(CONFIG_TOUCHSCREEN_ZINITIX)	+= zinitix.o
+obj-$(CONFIG_TOUCHSCREEN_MSG26XX)	+= msg26xx.o
drivers/input/touchscreen/msg26xx.c new file +369 -0

369 lines not on this page · raw message

Signature · 1 line
2.29.2
maintainer
#2 lore raw
In reply to Vincent Knecht
Quoted 27 lines · Vincent Knecht

This adds dts bindings for the mstar msg26xx touchscreen.

---
Changed in v3:
- added touchscreen-size-x: true and touchscreen-size-y: true properties Changed in v2:
- changed M-Star to MStar in title line
- changed reset gpio to active-low in example section

---
 .../input/touchscreen/mstar,msg26xx.yaml      | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +7 -0
new file mode 100644
index 000000000000..5d26a1008bf1
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/mstar,msg26xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar msg26xx touchscreen controller Bindings

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +10 -0
+
+maintainers:
+  - Vincent Knecht <[email protected]>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: mstar,msg26xx

Don't use wildcards in compatible strings.

#3 lore raw

Le mardi 09 février 2021 à 10:13 -0600, Rob Herring a écrit :

Quoted 33 lines · Vincent Knecht
Quoted 32 lines

This adds dts bindings for the mstar msg26xx touchscreen.

---
Changed in v3:
- added touchscreen-size-x: true and touchscreen-size-y: true properties Changed in v2:
- changed M-Star to MStar in title line
- changed reset gpio to active-low in example section
---
 .../input/touchscreen/mstar,msg26xx.yaml      | 69 +++++++++++++++++++

 1 file changed, 69 insertions(+)

 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +11 -0
new file mode 100644
index 000000000000..5d26a1008bf1
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/mstar,msg26xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar msg26xx touchscreen controller Bindings
+
+maintainers:
+  - Vincent Knecht <[email protected]>
+
Quoted 8 lines

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml line 17

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +6 -0
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: mstar,msg26xx

Don't use wildcards in compatible strings.

Thank you for the input...

Let's say I set it to "mstar,msg2638", is it better to rename the driver file and functions too ? According to downstream source file naming, msg2638 is the model I have and test this driver with.

There's a possibility this driver works as-is or with minor mods for msg2633 too, and a more remote one for msg21xx and msg22xx...

#4 lore raw

Hi Vincent,

Quoted 43 lines · Vincent Knecht

Le mardi 09 février 2021 à 10:13 -0600, Rob Herring a écrit :

Quoted 33 lines · Vincent Knecht
Quoted 32 lines

This adds dts bindings for the mstar msg26xx touchscreen.

---
Changed in v3:
- added touchscreen-size-x: true and touchscreen-size-y: true properties Changed in v2:
- changed M-Star to MStar in title line
- changed reset gpio to active-low in example section
---
 .../input/touchscreen/mstar,msg26xx.yaml      | 69 +++++++++++++++++++

 1 file changed, 69 insertions(+)

 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +11 -0
new file mode 100644
index 000000000000..5d26a1008bf1
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/mstar,msg26xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar msg26xx touchscreen controller Bindings
+
+maintainers:
+  - Vincent Knecht <[email protected]>
+
Quoted 8 lines

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml line 17

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +6 -0
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: mstar,msg26xx

Don't use wildcards in compatible strings.

Quoted 4 lines

Thank you for the input...

Let's say I set it to "mstar,msg2638", is it better to rename the driver file and functions too ? According to downstream source file naming, msg2638 is the model I have and test this driver with.

This is ultimately Dmitry's call, but it's fairly common to use wildcards for driver names and function calls if the driver is known to work across all devices that fit in the wildcard (see iqs5xx and many others).

The risk with wildcards, however, is that vendors can introduce different devices later with similar part numbers. Therefore, some subsystems (e.g. iio) tend to frown upon wildcards for that reason.

You should try and make the driver cover as many devices as possible. But if the driver is only known to work for one device then I don't think you can use a wildcard in the name unless you support all other devices (just my opinion).

In either case, however, compatible strings must be unique just as with a part number in a schematic or bill of materials. As such, it is perfectly fine to have multiple compatible strings in a single driver.

Quoted 5 lines

There's a possibility this driver works as-is or with minor mods for msg2633 too, and a more remote one for msg21xx and msg22xx...

Kind regards,
Jeff LaBundy

#5 lore raw

Le mardi 09 février 2021 à 21:10 -0600, Jeff LaBundy a écrit :

Quoted 70 lines

Hi Vincent,

Quoted 43 lines · Vincent Knecht

Le mardi 09 février 2021 à 10:13 -0600, Rob Herring a écrit :

Quoted 33 lines · Vincent Knecht
Quoted 32 lines

This adds dts bindings for the mstar msg26xx touchscreen.

---
Changed in v3:
- added touchscreen-size-x: true and touchscreen-size-y: true properties Changed in v2:
- changed M-Star to MStar in title line
- changed reset gpio to active-low in example section
---
 .../input/touchscreen/mstar,msg26xx.yaml      | 69 +++++++++++++++++++

 1 file changed, 69 insertions(+)

 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +11 -0
new file mode 100644
index 000000000000..5d26a1008bf1
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/mstar,msg26xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MStar msg26xx touchscreen controller Bindings
+
+maintainers:
+  - Vincent Knecht <[email protected]>
+
Quoted 8 lines

Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml line 17

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/mstar,msg26xx.yaml new file +6 -0
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    const: mstar,msg26xx

Don't use wildcards in compatible strings.

Quoted 4 lines

Thank you for the input...

Let's say I set it to "mstar,msg2638", is it better to rename the driver file and functions too ? According to downstream source file naming, msg2638 is the model I have and test this driver with.

This is ultimately Dmitry's call, but it's fairly common to use wildcards for driver names and function calls if the driver is known to work across all devices that fit in the wildcard (see iqs5xx and many others).

The risk with wildcards, however, is that vendors can introduce different devices later with similar part numbers. Therefore, some subsystems (e.g. iio) tend to frown upon wildcards for that reason.

You should try and make the driver cover as many devices as possible. But if the driver is only known to work for one device then I don't think you can use a wildcard in the name unless you support all other devices (just my opinion).

In either case, however, compatible strings must be unique just as with a part number in a schematic or bill of materials. As such, it is perfectly fine to have multiple compatible strings in a single driver.

Quoted 2 lines
Quoted 6 lines
Quoted 3 lines

There's a possibility this driver works as-is or with minor mods for msg2633 too, and a more remote one for msg21xx and msg22xx...

Kind regards,
Jeff LaBundy

Thank you Jeff for the insight.

Since I can't test it with any other model, I've renamed it to msg2638 in v4:
https://lore.kernel.org/linux-input/[email protected]/T/#t