18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci.. _touch: 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci************* 68c2ecf20Sopenharmony_ciTouch Devices 78c2ecf20Sopenharmony_ci************* 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciTouch devices are accessed through character device special files named 108c2ecf20Sopenharmony_ci``/dev/v4l-touch0`` to ``/dev/v4l-touch255`` with major number 81 and 118c2ecf20Sopenharmony_cidynamically allocated minor numbers 0 to 255. 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciOverview 148c2ecf20Sopenharmony_ci======== 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciSensors may be Optical, or Projected Capacitive touch (PCT). 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciProcessing is required to analyse the raw data and produce input events. In 198c2ecf20Sopenharmony_cisome systems, this may be performed on the ASIC and the raw data is purely a 208c2ecf20Sopenharmony_ciside-channel for diagnostics or tuning. In other systems, the ASIC is a simple 218c2ecf20Sopenharmony_cianalogue front end device which delivers touch data at high rate, and any touch 228c2ecf20Sopenharmony_ciprocessing must be done on the host. 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciFor capacitive touch sensing, the touchscreen is composed of an array of 258c2ecf20Sopenharmony_cihorizontal and vertical conductors (alternatively called rows/columns, X/Y 268c2ecf20Sopenharmony_cilines, or tx/rx). Mutual Capacitance measured is at the nodes where the 278c2ecf20Sopenharmony_ciconductors cross. Alternatively, Self Capacitance measures the signal from each 288c2ecf20Sopenharmony_cicolumn and row independently. 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciA touch input may be determined by comparing the raw capacitance measurement to 318c2ecf20Sopenharmony_cia no-touch reference (or "baseline") measurement: 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciDelta = Raw - Reference 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ciThe reference measurement takes account of variations in the capacitance across 368c2ecf20Sopenharmony_cithe touch sensor matrix, for example manufacturing irregularities, 378c2ecf20Sopenharmony_cienvironmental or edge effects. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciQuerying Capabilities 408c2ecf20Sopenharmony_ci===================== 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ciDevices supporting the touch interface set the ``V4L2_CAP_VIDEO_CAPTURE`` flag 438c2ecf20Sopenharmony_ciand the ``V4L2_CAP_TOUCH`` flag in the ``capabilities`` field of 448c2ecf20Sopenharmony_ci:c:type:`v4l2_capability` returned by the 458c2ecf20Sopenharmony_ci:ref:`VIDIOC_QUERYCAP` ioctl. 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ciAt least one of the read/write or streaming I/O methods must be 488c2ecf20Sopenharmony_cisupported. 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ciThe formats supported by touch devices are documented in 518c2ecf20Sopenharmony_ci:ref:`Touch Formats <tch-formats>`. 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ciData Format Negotiation 548c2ecf20Sopenharmony_ci======================= 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ciA touch device may support any I/O method. 57