History

[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

Nick Dyer committed 10 years ago

Commit b2fe22d1 parent aaf578e7 files · +58 −9Browse files

Showing the changes to include/uapi/linux (2 of 7 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/media.h +1 −0
  2. include/uapi/linux/videodev2.h +9 −0
include/uapi/linux/media.h+1−0
@@ -307,6 +307,7 @@ struct media_links_enum { · 306 unmodified lines
307307 #define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2)
308308 #define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
309309 #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)
310311
311312 #define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
312313 #define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
include/uapi/linux/videodev2.h+9−0
@@ -440,6 +440,8 @@ struct v4l2_capability { · 439 unmodified lines
440440 #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
441441 #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
442442
443+#define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */
444+
443445 #define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
444446
445447 /*
@@ -635,6 +637,12 @@ struct v4l2_pix_format { · 189 unmodified lines
635637 #define V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
636638 #define V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
637639
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+
638646 /* priv field value to indicates that subsequent fields are valid. */
639647 #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe
640648
@@ -1401,6 +1409,7 @@ struct v4l2_input { · 760 unmodified lines
14011409 /* Values for the 'type' field */
14021410 #define V4L2_INPUT_TYPE_TUNER 1
14031411 #define V4L2_INPUT_TYPE_CAMERA 2
1412+#define V4L2_INPUT_TYPE_TOUCH 3
14041413
14051414 /* field 'status' - general */
14061415 #define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t