[media] v4l: Use full 32 bits for buffer flags
[firefly-linux-kernel-4.4.55.git] / include / uapi / linux / videodev2.h
index 437f1b0f8937594c67601c3a4bda4505d03826d3..cb838765dd4004c2499fce6a4e3c5c1cb9009fe1 100644 (file)
@@ -139,6 +139,7 @@ enum v4l2_buf_type {
 #endif
        V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
        V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
+       V4L2_BUF_TYPE_SDR_CAPTURE          = 11,
        /* Deprecated, do not use */
        V4L2_BUF_TYPE_PRIVATE              = 0x80,
 };
@@ -159,6 +160,8 @@ enum v4l2_tuner_type {
        V4L2_TUNER_RADIO             = 1,
        V4L2_TUNER_ANALOG_TV         = 2,
        V4L2_TUNER_DIGITAL_TV        = 3,
+       V4L2_TUNER_ADC               = 4,
+       V4L2_TUNER_RF                = 5,
 };
 
 enum v4l2_memory {
@@ -207,8 +210,8 @@ enum v4l2_priority {
 struct v4l2_rect {
        __s32   left;
        __s32   top;
-       __s32   width;
-       __s32   height;
+       __u32   width;
+       __u32   height;
 };
 
 struct v4l2_fract {
@@ -264,6 +267,8 @@ struct v4l2_capability {
 #define V4L2_CAP_RADIO                 0x00040000  /* is a radio device */
 #define V4L2_CAP_MODULATOR             0x00080000  /* has a modulator */
 
+#define V4L2_CAP_SDR_CAPTURE           0x00100000  /* Is a SDR capture device */
+
 #define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
 #define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
 #define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
@@ -669,24 +674,32 @@ struct v4l2_buffer {
 };
 
 /*  Flags for 'flags' field */
-#define V4L2_BUF_FLAG_MAPPED   0x0001  /* Buffer is mapped (flag) */
-#define V4L2_BUF_FLAG_QUEUED   0x0002  /* Buffer is queued for processing */
-#define V4L2_BUF_FLAG_DONE     0x0004  /* Buffer is ready */
-#define V4L2_BUF_FLAG_KEYFRAME 0x0008  /* Image is a keyframe (I-frame) */
-#define V4L2_BUF_FLAG_PFRAME   0x0010  /* Image is a P-frame */
-#define V4L2_BUF_FLAG_BFRAME   0x0020  /* Image is a B-frame */
+/* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_MAPPED                   0x00000001
+/* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_QUEUED                   0x00000002
+/* Buffer is ready */
+#define V4L2_BUF_FLAG_DONE                     0x00000004
+/* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_KEYFRAME                 0x00000008
+/* Image is a P-frame */
+#define V4L2_BUF_FLAG_PFRAME                   0x00000010
+/* Image is a B-frame */
+#define V4L2_BUF_FLAG_BFRAME                   0x00000020
 /* Buffer is ready, but the data contained within is corrupted. */
-#define V4L2_BUF_FLAG_ERROR    0x0040
-#define V4L2_BUF_FLAG_TIMECODE 0x0100  /* timecode field is valid */
-#define V4L2_BUF_FLAG_PREPARED 0x0400  /* Buffer is prepared for queuing */
+#define V4L2_BUF_FLAG_ERROR                    0x00000040
+/* timecode field is valid */
+#define V4L2_BUF_FLAG_TIMECODE                 0x00000100
+/* Buffer is prepared for queuing */
+#define V4L2_BUF_FLAG_PREPARED                 0x00000400
 /* Cache handling flags */
-#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE      0x0800
-#define V4L2_BUF_FLAG_NO_CACHE_CLEAN           0x1000
+#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE      0x00000800
+#define V4L2_BUF_FLAG_NO_CACHE_CLEAN           0x00001000
 /* Timestamp type */
-#define V4L2_BUF_FLAG_TIMESTAMP_MASK           0xe000
-#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN                0x0000
-#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC      0x2000
-#define V4L2_BUF_FLAG_TIMESTAMP_COPY           0x4000
+#define V4L2_BUF_FLAG_TIMESTAMP_MASK           0x0000e000
+#define V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN                0x00000000
+#define V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC      0x00002000
+#define V4L2_BUF_FLAG_TIMESTAMP_COPY           0x00004000
 
 /**
  * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
@@ -1339,6 +1352,7 @@ struct v4l2_modulator {
 #define V4L2_TUNER_CAP_RDS_CONTROLS    0x0200
 #define V4L2_TUNER_CAP_FREQ_BANDS      0x0400
 #define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
+#define V4L2_TUNER_CAP_1HZ             0x1000
 
 /*  Flags for the 'rxsubchans' field */
 #define V4L2_TUNER_SUB_MONO            0x0001
@@ -1691,6 +1705,15 @@ struct v4l2_pix_format_mplane {
        __u8                            reserved[11];
 } __attribute__ ((packed));
 
+/**
+ * struct v4l2_format_sdr - SDR format definition
+ * @pixelformat:       little endian four character code (fourcc)
+ */
+struct v4l2_format_sdr {
+       __u32                           pixelformat;
+       __u8                            reserved[28];
+} __attribute__ ((packed));
+
 /**
  * struct v4l2_format - stream data format
  * @type:      enum v4l2_buf_type; type of the data stream
@@ -1709,6 +1732,7 @@ struct v4l2_format {
                struct v4l2_window              win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
                struct v4l2_vbi_format          vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
                struct v4l2_sliced_vbi_format   sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
+               struct v4l2_format_sdr          sdr;     /* V4L2_BUF_TYPE_SDR_CAPTURE */
                __u8    raw_data[200];                   /* user-defined */
        } fmt;
 };