Skip to contentSkip to conversation

dt-bindings: input: touchscreen: convert ads7846.txt to yaml

PATCH Superseded Frank Li 3 participants 4 messages Aug 15, 2024

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH v2 1/1 dt-bindings: input: touchscreen: convert ads7846.txt to yaml

Convert binding doc ads7846.txt to yaml format. Additional change:
- add ref to touchscreen.yaml and spi-peripheral-props.yaml.
- use common node name touchscreen.
- sort ti properties alphabetically.
- sort common properties alphabetically.
- sort compatible string alphabetically.
- remove vcc-supply from required list.

Fix below warning: arch/arm64/boot/dts/freescale/imx8mm-var-som-symphony.dtb: touchscreen@0:

	ti,x-min: b'\x00}' is not of type 'object', 'array', 'boolean', 'null'

---
Change from v1 to v2
- sort properties, by 3 group:
1. General (compatible, reg, interrupt)
2. Common properties
3. ti properties
- sort maintainers name alphabetically.
- uint16 have to be kept because default is uint32
- remove vcc-supply from required list
- remove unfinished sentence "all mandatory properties described in" because it refer to /schemas/spi/spi-peripheral-props.yaml#
- fix make refcheckdoc error

---
 .../bindings/input/touchscreen/ads7846.txt    | 107 ------------
 .../input/touchscreen/ti,ads7843.yaml         | 165 ++++++++++++++++++
 .../bindings/power/wakeup-source.txt          |   2 +-
 3 files changed, 166 insertions(+), 108 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/ads7846.txt
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml
Documentation/devicetree/bindings/input/touchscreen/ads7846.txt deleted +0 -107
deleted file mode 100644
index 399c87782935c..0000000000000
@@ -1,107 +0,0 @@
-Device tree bindings for TI's ADS7843, ADS7845, ADS7846, ADS7873, TSC2046
-SPI driven touch screen controllers.
-
-The node for this driver must be a child node of a SPI controller, hence
-all mandatory properties described in
-
-	Documentation/devicetree/bindings/spi/spi-bus.txt
-
-must be specified.
-
-Additional required properties:
-
-	compatible		Must be one of the following, depending on the
-				model:
-					"ti,tsc2046"
-					"ti,ads7843"
-					"ti,ads7845"
-					"ti,ads7846"
-					"ti,ads7873"
-
-	interrupts		An interrupt node describing the IRQ line the chip's
-				!PENIRQ pin is connected to.
-	vcc-supply		A regulator node for the supply voltage.
-
-
-Optional properties:
-
-	ti,vref-delay-usecs		vref supply delay in usecs, 0 for
-					external vref (u16).
-	ti,vref-mv			The VREF voltage, in millivolts (u16).
-					Set to 0 to use internal references
-					(ADS7846).
-	ti,keep-vref-on			set to keep vref on for differential
-					measurements as well
-	ti,settle-delay-usec		Settling time of the analog signals;
-					a function of Vcc and the capacitance
-					on the X/Y drivers.  If set to non-zero,
-					two samples are taken with settle_delay
-					us apart, and the second one is used.
-					~150 uSec with 0.01uF caps (u16).
-	ti,penirq-recheck-delay-usecs	If set to non-zero, after samples are
-					taken this delay is applied and penirq
-					is rechecked, to help avoid false
-					events.  This value is affected by the
-					material used to build the touch layer
-					(u16).
-	ti,x-plate-ohms			Resistance of the X-plate,
-					in Ohms (u16).
-	ti,y-plate-ohms			Resistance of the Y-plate,
-					in Ohms (u16).
-	ti,x-min			Minimum value on the X axis (u16).
-	ti,y-min			Minimum value on the Y axis (u16).
-	ti,debounce-tol			Tolerance used for filtering (u16).
-	ti,debounce-rep			Additional consecutive good readings
-					required after the first two (u16).
-	ti,pendown-gpio-debounce	Platform specific debounce time for the
-					pendown-gpio (u32).
-	pendown-gpio			GPIO handle describing the pin the !PENIRQ
-					line is connected to.
-	ti,hsync-gpios			GPIO line to poll for hsync
-	wakeup-source			use any event on touchscreen as wakeup event.
-					(Legacy property support: "linux,wakeup")
-	touchscreen-size-x		General touchscreen binding, see [1].
-	touchscreen-size-y		General touchscreen binding, see [1].
-	touchscreen-max-pressure	General touchscreen binding, see [1].
-	touchscreen-min-pressure	General touchscreen binding, see [1].
-	touchscreen-average-samples	General touchscreen binding, see [1].
-	touchscreen-inverted-x		General touchscreen binding, see [1].
-	touchscreen-inverted-y		General touchscreen binding, see [1].
-	touchscreen-swapped-x-y		General touchscreen binding, see [1].
-
-[1] All general touchscreen properties are described in
-    Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt.
-
-Deprecated properties:
-
-	ti,swap-xy			swap x and y axis
-	ti,x-max			Maximum value on the X axis (u16).
-	ti,y-max			Maximum value on the Y axis (u16).
-	ti,pressure-min			Minimum reported pressure value
-					(threshold) - u16.
-	ti,pressure-max			Maximum reported pressure value (u16).
-	ti,debounce-max			Max number of additional readings per
-					sample (u16).
-
-Example for a TSC2046 chip connected to an McSPI controller of an OMAP SoC::
-
-	spi_controller {
-		tsc2046@0 {
-			reg = <0>;	/* CS0 */
-			compatible = "ti,tsc2046";
-			interrupt-parent = <&gpio1>;
-			interrupts = <8 0>;	/* BOOT6 / GPIO 8 */
-			spi-max-frequency = <1000000>;
-			pendown-gpio = <&gpio1 8 0>;
-			vcc-supply = <&reg_vcc3>;
-
-			ti,x-min = /bits/ 16 <0>;
-			ti,x-max = /bits/ 16 <8000>;
-			ti,y-min = /bits/ 16 <0>;
-			ti,y-max = /bits/ 16 <4800>;
-			ti,x-plate-ohms = /bits/ 16 <40>;
-			ti,pressure-max = /bits/ 16 <255>;
-
-			wakeup-source;
-		};
-	};
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +165 -0

165 lines not on this page · raw message

Documentation/devicetree/bindings/power/wakeup-source.txt +1 -1
index a6c8978964aa1..9a4f8310eb67d 100644
@@ -25,7 +25,7 @@ List of legacy properties and respective binding document
 2. "has-tpo"			Documentation/devicetree/bindings/rtc/rtc-opal.txt
 3. "linux,wakeup"		Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt
 				Documentation/devicetree/bindings/mfd/tc3589x.txt
-				Documentation/devicetree/bindings/input/touchscreen/ads7846.txt
+				Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml
 4. "linux,keypad-wakeup"	Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
 5. "linux,input-wakeup"		Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml
 6. "nvidia,wakeup-source"	Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt
Signature · 1 line
2.34.1
#1 lore raw

On 8/15/24 6:14 PM, Frank Li wrote:

[...]

Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml line 42

Quoted 4 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +4 -0
+  ti,debounce-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Max number of additional readings per sample (u16).

Could you drop the (u16) which is already part of the $ref'd type ?

[...]

Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml line 114

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +6 -0
+  ti,x-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Maximum value on the X axis (u16).
+
+  ti,x-min:

Is this deprecated too, the same way as x-max above is deprecated ?

Quoted 2 lines
(quoted diff) +2 -0
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Minimum value on the X axis (u16).

[...]

author maintainer
#2 lore raw
Quoted 10 lines · Marek Vasut

On 8/15/24 6:14 PM, Frank Li wrote:

[...]

Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml line 42

Quoted 4 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +4 -0
+  ti,debounce-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Max number of additional readings per sample (u16).

Could you drop the (u16) which is already part of the $ref'd type ?

Sorry, I forget it.

Quoted 11 lines

[...]

Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml line 114

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +6 -0
+  ti,x-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Maximum value on the X axis (u16).
+
+  ti,x-min:

Is this deprecated too, the same way as x-max above is deprecated ?

I am not sure. I guest x-min and y-min is still useful becasue it may indicate invalidated touch. but x-max and y-max should not usefull because max value should be Vcc. x-min and y-min help filter out some noise.

Frank

Quoted 5 lines
Quoted 3 lines
(quoted diff) +2 -0
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Minimum value on the X axis (u16).

[...]

maintainer
#3 lore raw
Quoted 24 lines · Frank Li
Quoted 10 lines · Marek Vasut

On 8/15/24 6:14 PM, Frank Li wrote:

[...]

Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml line 42

Quoted 4 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +4 -0
+  ti,debounce-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Max number of additional readings per sample (u16).

Could you drop the (u16) which is already part of the $ref'd type ?

Sorry, I forget it.

Quoted 10 lines

[...]

Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/ti,ads7843.yaml new file +6 -0
+  ti,x-max:
+    deprecated: true
+    $ref: /schemas/types.yaml#/definitions/uint16
+    description: Maximum value on the X axis (u16).
+
+  ti,x-min:
Quoted 5 lines
Quoted 1 line

Is this deprecated too, the same way as x-max above is deprecated ?

I am not sure. I guest x-min and y-min is still useful becasue it may indicate invalidated touch. but x-max and y-max should not usefull because max value should be Vcc. x-min and y-min help filter out some noise.

There are standard properties touchscreen-min-x and touchscreen-min-y that will be used if present, so I think ti,x-min can also be marked as deprecated.

Thanks.

Signature · 1 line
Dmitry