1059b1c5bSMauro Carvalho Chehab.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
254f38fcaSMauro Carvalho Chehab
354f38fcaSMauro Carvalho Chehab.. _touch:
454f38fcaSMauro Carvalho Chehab
554f38fcaSMauro Carvalho Chehab*************
654f38fcaSMauro Carvalho ChehabTouch Devices
754f38fcaSMauro Carvalho Chehab*************
854f38fcaSMauro Carvalho Chehab
954f38fcaSMauro Carvalho ChehabTouch devices are accessed through character device special files named
1054f38fcaSMauro Carvalho Chehab``/dev/v4l-touch0`` to ``/dev/v4l-touch255`` with major number 81 and
1154f38fcaSMauro Carvalho Chehabdynamically allocated minor numbers 0 to 255.
1254f38fcaSMauro Carvalho Chehab
1354f38fcaSMauro Carvalho ChehabOverview
1454f38fcaSMauro Carvalho Chehab========
1554f38fcaSMauro Carvalho Chehab
1654f38fcaSMauro Carvalho ChehabSensors may be Optical, or Projected Capacitive touch (PCT).
1754f38fcaSMauro Carvalho Chehab
1854f38fcaSMauro Carvalho ChehabProcessing is required to analyse the raw data and produce input events. In
1954f38fcaSMauro Carvalho Chehabsome systems, this may be performed on the ASIC and the raw data is purely a
2054f38fcaSMauro Carvalho Chehabside-channel for diagnostics or tuning. In other systems, the ASIC is a simple
2154f38fcaSMauro Carvalho Chehabanalogue front end device which delivers touch data at high rate, and any touch
2254f38fcaSMauro Carvalho Chehabprocessing must be done on the host.
2354f38fcaSMauro Carvalho Chehab
2454f38fcaSMauro Carvalho ChehabFor capacitive touch sensing, the touchscreen is composed of an array of
2554f38fcaSMauro Carvalho Chehabhorizontal and vertical conductors (alternatively called rows/columns, X/Y
2654f38fcaSMauro Carvalho Chehablines, or tx/rx). Mutual Capacitance measured is at the nodes where the
2754f38fcaSMauro Carvalho Chehabconductors cross. Alternatively, Self Capacitance measures the signal from each
2854f38fcaSMauro Carvalho Chehabcolumn and row independently.
2954f38fcaSMauro Carvalho Chehab
3054f38fcaSMauro Carvalho ChehabA touch input may be determined by comparing the raw capacitance measurement to
3154f38fcaSMauro Carvalho Chehaba no-touch reference (or "baseline") measurement:
3254f38fcaSMauro Carvalho Chehab
3354f38fcaSMauro Carvalho ChehabDelta = Raw - Reference
3454f38fcaSMauro Carvalho Chehab
3554f38fcaSMauro Carvalho ChehabThe reference measurement takes account of variations in the capacitance across
3654f38fcaSMauro Carvalho Chehabthe touch sensor matrix, for example manufacturing irregularities,
3754f38fcaSMauro Carvalho Chehabenvironmental or edge effects.
3854f38fcaSMauro Carvalho Chehab
3954f38fcaSMauro Carvalho ChehabQuerying Capabilities
4054f38fcaSMauro Carvalho Chehab=====================
4154f38fcaSMauro Carvalho Chehab
4254f38fcaSMauro Carvalho ChehabDevices supporting the touch interface set the ``V4L2_CAP_VIDEO_CAPTURE`` flag
4354f38fcaSMauro Carvalho Chehaband the ``V4L2_CAP_TOUCH`` flag in the ``capabilities`` field of
4454f38fcaSMauro Carvalho Chehab:c:type:`v4l2_capability` returned by the
4554f38fcaSMauro Carvalho Chehab:ref:`VIDIOC_QUERYCAP` ioctl.
4654f38fcaSMauro Carvalho Chehab
4754f38fcaSMauro Carvalho ChehabAt least one of the read/write or streaming I/O methods must be
4854f38fcaSMauro Carvalho Chehabsupported.
4954f38fcaSMauro Carvalho Chehab
5054f38fcaSMauro Carvalho ChehabThe formats supported by touch devices are documented in
5154f38fcaSMauro Carvalho Chehab:ref:`Touch Formats <tch-formats>`.
5254f38fcaSMauro Carvalho Chehab
5354f38fcaSMauro Carvalho ChehabData Format Negotiation
5454f38fcaSMauro Carvalho Chehab=======================
5554f38fcaSMauro Carvalho Chehab
5654f38fcaSMauro Carvalho ChehabA touch device may support any I/O method.
57