@@ -92,3 +92,13 @@ Image Source Control IDs
representing a gain of exactly 1.0. For example, if this default value
is reported as being (say) 128, then a value of 192 would represent
a gain of exactly 1.5.
+
+``V4L2_CID_COLOUR_PATTERN (integer)``
+ This control determines the colour components and pixel order in the
+ sensor's CFA (Colour Filter Array) when used in conjunction with
+ :ref:`luma-only mbus codes MEDIA_BUS_FMT_Yx_1Xx (where 'x' is the bit depth)
+ <v4l2-mbus-pixelcode-yuv8>` pixelformats.
+
+ This control may only be used on a V4L2 sub-device.
+
+ This is a read-only control.
@@ -1155,6 +1155,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_TEST_PATTERN_BLUE: return "Blue Pixel Value";
case V4L2_CID_TEST_PATTERN_GREENB: return "Green (Blue) Pixel Value";
case V4L2_CID_NOTIFY_GAINS: return "Notify Gains";
+ case V4L2_CID_COLOUR_PATTERN: return "Colour Pattern";
/* Image processing controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1214,6 +1214,12 @@ enum v4l2_jpeg_chroma_subsampling {
#define V4L2_CID_UNIT_CELL_SIZE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
#define V4L2_CID_NOTIFY_GAINS (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9)
+#define V4L2_CID_COLOUR_PATTERN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 10)
+#define V4L2_COLOUR_PATTERN_GRBG 0
+#define V4L2_COLOUR_PATTERN_RGGB 1
+#define V4L2_COLOUR_PATTERN_BGGR 2
+#define V4L2_COLOUR_PATTERN_GBRG 3
+
/* Image processing controls */
Add V4L2_CID_COLOUR_PATTERN to tell the camera sensor's native colour pattern. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- .../userspace-api/media/v4l/ext-ctrls-image-source.rst | 10 ++++++++++ drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + include/uapi/linux/v4l2-controls.h | 6 ++++++ 3 files changed, 17 insertions(+)