]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: add V4L2_CID_UNIT_CELL_SIZE control
authorRicardo Ribalda Delgado <ribalda@kernel.org>
Mon, 7 Oct 2019 15:06:33 +0000 (12:06 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 14:37:26 +0000 (11:37 -0300)
This control returns the unit cell size in nanometres. The struct provides
the width and the height in separated fields to take into consideration
asymmetric pixels and/or hardware binning.
This control is required for automatic calibration of sensors/cameras.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-ctrls.c
include/uapi/linux/v4l2-controls.h

index 96cab2e173d39a29e06c6665c1a9f81fb566a540..bf50d37ef6c1772365023645e1e0e53303dc6f20 100644 (file)
@@ -996,6 +996,7 @@ const char *v4l2_ctrl_get_name(u32 id)
        case V4L2_CID_AUTO_FOCUS_RANGE:         return "Auto Focus, Range";
        case V4L2_CID_PAN_SPEED:                return "Pan, Speed";
        case V4L2_CID_TILT_SPEED:               return "Tilt, Speed";
+       case V4L2_CID_UNIT_CELL_SIZE:           return "Unit Cell Size";
 
        /* FM Radio Modulator controls */
        /* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1377,6 +1378,10 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
        case V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER:
                *type = V4L2_CTRL_TYPE_VP8_FRAME_HEADER;
                break;
+       case V4L2_CID_UNIT_CELL_SIZE:
+               *type = V4L2_CTRL_TYPE_AREA;
+               *flags |= V4L2_CTRL_FLAG_READ_ONLY;
+               break;
        default:
                *type = V4L2_CTRL_TYPE_INTEGER;
                break;
index a2669b79b2949f46b61bdf4005ad1b284b076dc4..5a7bedee2b0e4b4bf82c76cb4e7cb75ecc91250b 100644 (file)
@@ -1034,6 +1034,7 @@ enum v4l2_jpeg_chroma_subsampling {
 #define V4L2_CID_TEST_PATTERN_GREENR           (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
 #define V4L2_CID_TEST_PATTERN_BLUE             (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
 #define V4L2_CID_TEST_PATTERN_GREENB           (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
+#define V4L2_CID_UNIT_CELL_SIZE                        (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
 
 
 /* Image processing controls */