Skip to content

Commit

Permalink
dt-bindings: input: TSC2007 bindings
Browse files Browse the repository at this point in the history
Moving the bindings to yaml format and adding
the common touchscreen.yaml properties.
Old properties that are now covered via touchscreen.yaml
have been removed and replaced by the relevant properties
from touchscreen.yaml

Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
  • Loading branch information
Timon Skerutsch committed Dec 14, 2023
1 parent 6c895cc commit a4f191e
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 39 deletions.
122 changes: 122 additions & 0 deletions Documentation/devicetree/bindings/input/touchscreen/ti,tsc2007.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
* Texas Instruments tsc2007 touchscreen controller

Required properties:
- compatible: must be "ti,tsc2007".
- reg: I2C address of the chip.
- ti,x-plate-ohms: X-plate resistance in ohms.

Optional properties:
- gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
The penirq pin goes to low when the panel is touched.
(see GPIO binding[1] for more details).
- interrupts: (gpio) interrupt to which the chip is connected
(see interrupt binding[0]).
- ti,max-rt: maximum pressure.
- ti,fuzzx: specifies the absolute input fuzz x value.
If set, it will permit noise in the data up to +- the value given to the fuzz
parameter, that is used to filter noise from the event stream.
- ti,fuzzy: specifies the absolute input fuzz y value.
- ti,fuzzz: specifies the absolute input fuzz z value.
- ti,poll-period: how much time to wait (in milliseconds) before reading again the
values from the tsc2007.

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/gpio/gpio.txt

Example:
&i2c1 {
/* ... */
tsc2007@49 {
compatible = "ti,tsc2007";
reg = <0x49>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 0x8>;
gpios = <&gpio4 0 0>;
ti,x-plate-ohms = <180>;
};

/* ... */
};

# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/touchscreen/ti,tsc2007.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments TSC2007 touchscreen controller bindings

maintainers:
- Timon Skerutsch <kernel@diodes-delight.com>

allOf:
- $ref: touchscreen.yaml#

properties:
compatible:
enum:
- ti,tsc2007

reg:
maxItems: 1
description: |
I2C address of the chip.
interrupts:
maxItems: 1
description: |
(gpio) interrupt to which the chip is connected
gpios:
maxItems: 1
description: the interrupt gpio the chip is connected to (trough the penirq pin).

ti,poll-period: how much time to wait (in milliseconds) before reading again

touchscreen-fuzz-pressure: true
touchscreen-fuzz-x: true
touchscreen-fuzz-y: true
touchscreen-min-pressure: true
touchscreen-max-pressure: true
touchscreen-min-x: true
touchscreen-size-x: true
touchscreen-min-y: true
touchscreen-size-y: true
touchscreen-x-plate-ohms: true
touchscreen-inverted-x: true
touchscreen-inverted-y: true
touchscreen-swapped-x-y: true


additionalProperties: false

required:
- compatible
- reg
- touchscreen-x-plate-ohms

examples:
- |
tsc2007@48 {
compatible = "ti,tsc2007";
reg = <0x48>;
touchscreen-swapped-x-y;
touchscreen-inverted-x;
touchscreen-min-x = <350>;
touchscreen-size-x = <3700>;
touchscreen-fuzz-x = <4>;
touchscreen-min-y = <320>;
touchscreen-size-y = <3700>;
touchscreen-fuzz-y = <4>;
touchscreen-min-pressure = <1000>;
touchscreen-max-pressure = <3700>;
touchscreen-fuzz-pressure = <4>;
touchscreen-x-plate-ohms = <180>;
pinctrl-0 = <&tsc_int_pin>;
interrupt-parent = <&gpio>;
interrupts = <17 2>;
gpios = <&gpio 17 1>;
};
40 changes: 1 addition & 39 deletions Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
* Texas Instruments tsc2007 touchscreen controller

Required properties:
- compatible: must be "ti,tsc2007".
- reg: I2C address of the chip.
- ti,x-plate-ohms: X-plate resistance in ohms.

Optional properties:
- gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
The penirq pin goes to low when the panel is touched.
(see GPIO binding[1] for more details).
- interrupts: (gpio) interrupt to which the chip is connected
(see interrupt binding[0]).
- ti,max-rt: maximum pressure.
- ti,fuzzx: specifies the absolute input fuzz x value.
If set, it will permit noise in the data up to +- the value given to the fuzz
parameter, that is used to filter noise from the event stream.
- ti,fuzzy: specifies the absolute input fuzz y value.
- ti,fuzzz: specifies the absolute input fuzz z value.
- ti,poll-period: how much time to wait (in milliseconds) before reading again the
values from the tsc2007.

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/gpio/gpio.txt

Example:
&i2c1 {
/* ... */
tsc2007@49 {
compatible = "ti,tsc2007";
reg = <0x49>;
interrupt-parent = <&gpio4>;
interrupts = <0x0 0x8>;
gpios = <&gpio4 0 0>;
ti,x-plate-ohms = <180>;
};

/* ... */
};
see ti,tsc2007.yaml

0 comments on commit a4f191e

Please sign in to comment.