adsemi,tsm12 (on i2c bus)

Description

AD Semiconductor TSM12 12-channel capacitive touch sensor

Also covers the register- and pin-compatible Si12T from Nanjing Zhongke
Microelectronics.

Each channel with an entry in input-codes reports an INPUT_EV_KEY event,
pressed as soon as the sensor detects a touch of any strength.

Examples

#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

&i2c0 {
  touch@68 {
    compatible = "adsemi,tsm12";
    reg = <0x68>;
    int-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
    input-codes = <INPUT_BTN_LEFT INPUT_BTN_MIDDLE INPUT_BTN_RIGHT>;
    threshold-windows = "narrow", "narrow", "narrow";
  };
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

int-gpios

phandle-array

Interrupt line (open drain, active low), asserted when a channel
detects a touch. The sensor is polled when this property is absent.

input-codes

array

Input event key codes (INPUT_KEY_* or INPUT_BTN_*), one per channel
starting from channel 1. Channels without an entry are disabled.

This property is required.

Length range: 1 to 12

threshold-midpoints

array

Middle touch threshold of each channel (ChxM[2:0]), one entry per
channel starting from channel 1; entries beyond input-codes are
ignored. Higher values raise the threshold and make the channel less
sensitive. The default corresponds to the reset value of the register
field.

Default value: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]

Maximum value: 7

Length range: 1 to 12

threshold-windows

string-array

Spacing of the light and hard touch thresholds around the middle
threshold (ChxHL), one entry per channel starting from channel 1;
entries beyond input-codes are ignored. A touch is reported from the
light touch threshold on. The default corresponds to the reset value
of the register field.

- "narrow": 20% below and above the middle threshold.
- "wide": 30% below and above the middle threshold, which reports
  lighter touches.

Example thresholds (capacitance change) with "narrow":

  Midpoint | Light touch | Middle | Hard touch
  ---------|-------------|--------|-----------
      0    |    0.40%    | 0.50%  |   0.60%
      3    |    0.95%    | 1.20%  |   1.45%
      7    |    2.85%    | 3.55%  |   4.30%

Default value: [wide, wide, wide, wide, wide, wide, wide, wide, wide, wide, wide, wide]

Legal values: narrow, wide

Length range: 1 to 12

supply-gpios

phandle-array

GPIO specifier that controls power to the device.

This property should be provided when the device has a dedicated
switch that controls power to the device.  The supply state is
entirely the responsibility of the device driver.

Contrast with vin-supply.

vin-supply

phandle

Reference to the regulator that controls power to the device.
The referenced devicetree node must have a regulator compatible.

This property should be provided when device power is supplied
by a shared regulator.  The supply state is dependent on the
request status of all devices fed by the regulator.

Contrast with supply-gpios.  If both properties are provided
then the regulator must be requested before the supply GPIOS is
set to an active state, and the supply GPIOS must be set to an
inactive state before releasing the regulator.