diff options
| author | Nick Dyer <nick@shmanahar.org> | 2016-07-18 17:10:30 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-08-23 15:28:04 -0400 |
| commit | b2fe22d0cf64708c50c26f11b3da8b79809c699b (patch) | |
| tree | de7ba78bc3260c2af09a9ec6a2065497e8ea3088 /include/uapi/linux | |
| parent | aaf578e12e06160792ae5dd71dee3b074e0f9475 (diff) | |
[media] v4l2-core: Add support for touch devices
Some touch controllers send out touch data in a similar way to a
greyscale frame grabber.
Add new device type VFL_TYPE_TOUCH:
- This uses a new device prefix v4l-touch for these devices, to stop
generic capture software from treating them as webcams. Otherwise,
touch is treated similarly to video capture.
- Add V4L2_INPUT_TYPE_TOUCH
- Add MEDIA_INTF_T_V4L_TOUCH
- Add V4L2_CAP_TOUCH to indicate device is a touch device
Add formats:
- V4L2_TCH_FMT_DELTA_TD16 for signed 16-bit touch deltas
- V4L2_TCH_FMT_DELTA_TD08 for signed 16-bit touch deltas
- V4L2_TCH_FMT_TU16 for unsigned 16-bit touch data
- V4L2_TCH_FMT_TU08 for unsigned 8-bit touch data
This support will be used by:
- Atmel maXTouch (atmel_mxt_ts)
- Synaptics RMI4.
- sur40
Signed-off-by: Nick Dyer <nick@shmanahar.org>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/media.h | 1 | ||||
| -rw-r--r-- | include/uapi/linux/videodev2.h | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 7acf0f634f70..4890787731b8 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h | |||
| @@ -307,6 +307,7 @@ struct media_links_enum { | |||
| 307 | #define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2) | 307 | #define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2) |
| 308 | #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3) | 308 | #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3) |
| 309 | #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4) | 309 | #define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4) |
| 310 | #define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5) | ||
| 310 | 311 | ||
| 311 | #define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE) | 312 | #define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE) |
| 312 | #define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1) | 313 | #define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1) |
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 724f43e69d03..22bad8c741fe 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -440,6 +440,8 @@ struct v4l2_capability { | |||
| 440 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 440 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| 441 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ | 441 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ |
| 442 | 442 | ||
| 443 | #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ | ||
| 444 | |||
| 443 | #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */ | 445 | #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */ |
| 444 | 446 | ||
| 445 | /* | 447 | /* |
| @@ -635,6 +637,12 @@ struct v4l2_pix_format { | |||
| 635 | #define V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */ | 637 | #define V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */ |
| 636 | #define V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */ | 638 | #define V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */ |
| 637 | 639 | ||
| 640 | /* Touch formats - used for Touch devices */ | ||
| 641 | #define V4L2_TCH_FMT_DELTA_TD16 v4l2_fourcc('T', 'D', '1', '6') /* 16-bit signed deltas */ | ||
| 642 | #define V4L2_TCH_FMT_DELTA_TD08 v4l2_fourcc('T', 'D', '0', '8') /* 8-bit signed deltas */ | ||
| 643 | #define V4L2_TCH_FMT_TU16 v4l2_fourcc('T', 'U', '1', '6') /* 16-bit unsigned touch data */ | ||
| 644 | #define V4L2_TCH_FMT_TU08 v4l2_fourcc('T', 'U', '0', '8') /* 8-bit unsigned touch data */ | ||
| 645 | |||
| 638 | /* priv field value to indicates that subsequent fields are valid. */ | 646 | /* priv field value to indicates that subsequent fields are valid. */ |
| 639 | #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe | 647 | #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe |
| 640 | 648 | ||
| @@ -1401,6 +1409,7 @@ struct v4l2_input { | |||
| 1401 | /* Values for the 'type' field */ | 1409 | /* Values for the 'type' field */ |
| 1402 | #define V4L2_INPUT_TYPE_TUNER 1 | 1410 | #define V4L2_INPUT_TYPE_TUNER 1 |
| 1403 | #define V4L2_INPUT_TYPE_CAMERA 2 | 1411 | #define V4L2_INPUT_TYPE_CAMERA 2 |
| 1412 | #define V4L2_INPUT_TYPE_TOUCH 3 | ||
| 1404 | 1413 | ||
| 1405 | /* field 'status' - general */ | 1414 | /* field 'status' - general */ |
| 1406 | #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */ | 1415 | #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */ |
