drivers: kscan: Add driver for XPT2046

Add driver for Xptek XPT2046 resistive touch controller on SPI.
Only interrupt driven mode supported, does not do polling.

Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
This commit is contained in:
Seppo Takalo 2023-02-13 13:24:54 +02:00 committed by Carles Cufí
commit edae1bed3d
6 changed files with 363 additions and 0 deletions

View file

@ -0,0 +1,53 @@
# Copyright (c) 2023 Seppo Takalo
# SPDX-License-Identifier: Apache-2.0
description: Driver for XPT2046 touch IC
compatible: "xptek,xpt2046"
include: [kscan.yaml, spi-device.yaml]
properties:
int-gpios:
type: phandle-array
required: true
description: Interrupt GPIO.
touchscreen-size-x:
type: int
required: true
description: horizontal resolution of screen
touchscreen-size-y:
type: int
required: true
description: vertical resolution of screen
min-x:
type: int
required: true
description: minimum raw X value reported.
min-y:
type: int
required: true
description: minimum raw Y value reported.
max-x:
type: int
required: true
description: maximum raw X value reported.
max-y:
type: int
required: true
description: maximum raw Y value reported.
z-threshold:
type: int
description: Z value threshold to trigger a touch
default: 100
reads:
type: int
description: How many reads per touch to average the value
default: 1