162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci.. _touch:
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci*************
662306a36Sopenharmony_ciTouch Devices
762306a36Sopenharmony_ci*************
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciTouch devices are accessed through character device special files named
1062306a36Sopenharmony_ci``/dev/v4l-touch0`` to ``/dev/v4l-touch255`` with major number 81 and
1162306a36Sopenharmony_cidynamically allocated minor numbers 0 to 255.
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciOverview
1462306a36Sopenharmony_ci========
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciSensors may be Optical, or Projected Capacitive touch (PCT).
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciProcessing is required to analyse the raw data and produce input events. In
1962306a36Sopenharmony_cisome systems, this may be performed on the ASIC and the raw data is purely a
2062306a36Sopenharmony_ciside-channel for diagnostics or tuning. In other systems, the ASIC is a simple
2162306a36Sopenharmony_cianalogue front end device which delivers touch data at high rate, and any touch
2262306a36Sopenharmony_ciprocessing must be done on the host.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciFor capacitive touch sensing, the touchscreen is composed of an array of
2562306a36Sopenharmony_cihorizontal and vertical conductors (alternatively called rows/columns, X/Y
2662306a36Sopenharmony_cilines, or tx/rx). Mutual Capacitance measured is at the nodes where the
2762306a36Sopenharmony_ciconductors cross. Alternatively, Self Capacitance measures the signal from each
2862306a36Sopenharmony_cicolumn and row independently.
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciA touch input may be determined by comparing the raw capacitance measurement to
3162306a36Sopenharmony_cia no-touch reference (or "baseline") measurement:
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ciDelta = Raw - Reference
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciThe reference measurement takes account of variations in the capacitance across
3662306a36Sopenharmony_cithe touch sensor matrix, for example manufacturing irregularities,
3762306a36Sopenharmony_cienvironmental or edge effects.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ciQuerying Capabilities
4062306a36Sopenharmony_ci=====================
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciDevices supporting the touch interface set the ``V4L2_CAP_VIDEO_CAPTURE`` flag
4362306a36Sopenharmony_ciand the ``V4L2_CAP_TOUCH`` flag in the ``capabilities`` field of
4462306a36Sopenharmony_ci:c:type:`v4l2_capability` returned by the
4562306a36Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` ioctl.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciAt least one of the read/write or streaming I/O methods must be
4862306a36Sopenharmony_cisupported.
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciThe formats supported by touch devices are documented in
5162306a36Sopenharmony_ci:ref:`Touch Formats <tch-formats>`.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ciData Format Negotiation
5462306a36Sopenharmony_ci=======================
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ciA touch device may support any I/O method.
57