kernel: bump 5.4 to 5.4.48
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0489-media-add-V4L2_CID_UNIT_CELL_SIZE-control.patch
1 From 12eba72027d415bb3dfd4c8124813a322b27c793 Mon Sep 17 00:00:00 2001
2 From: Ricardo Ribalda Delgado <ribalda@kernel.org>
3 Date: Mon, 7 Oct 2019 12:06:33 -0300
4 Subject: [PATCH] media: add V4L2_CID_UNIT_CELL_SIZE control
5
6 Commit 61fd036d01111679b01e4b92e6bd0cdd33809aea upstream.
7
8 This control returns the unit cell size in nanometres. The struct provides
9 the width and the height in separated fields to take into consideration
10 asymmetric pixels and/or hardware binning.
11 This control is required for automatic calibration of sensors/cameras.
12
13 Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
14 Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org>
15 Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
16 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
17 ---
18  drivers/media/v4l2-core/v4l2-ctrls.c | 5 +++++
19  include/uapi/linux/v4l2-controls.h   | 1 +
20  2 files changed, 6 insertions(+)
21
22 --- a/drivers/media/v4l2-core/v4l2-ctrls.c
23 +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
24 @@ -995,6 +995,7 @@ const char *v4l2_ctrl_get_name(u32 id)
25         case V4L2_CID_AUTO_FOCUS_RANGE:         return "Auto Focus, Range";
26         case V4L2_CID_PAN_SPEED:                return "Pan, Speed";
27         case V4L2_CID_TILT_SPEED:               return "Tilt, Speed";
28 +       case V4L2_CID_UNIT_CELL_SIZE:           return "Unit Cell Size";
29  
30         /* FM Radio Modulator controls */
31         /* Keep the order of the 'case's the same as in v4l2-controls.h! */
32 @@ -1376,6 +1377,10 @@ void v4l2_ctrl_fill(u32 id, const char *
33         case V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER:
34                 *type = V4L2_CTRL_TYPE_VP8_FRAME_HEADER;
35                 break;
36 +       case V4L2_CID_UNIT_CELL_SIZE:
37 +               *type = V4L2_CTRL_TYPE_AREA;
38 +               *flags |= V4L2_CTRL_FLAG_READ_ONLY;
39 +               break;
40         default:
41                 *type = V4L2_CTRL_TYPE_INTEGER;
42                 break;
43 --- a/include/uapi/linux/v4l2-controls.h
44 +++ b/include/uapi/linux/v4l2-controls.h
45 @@ -1035,6 +1035,7 @@ enum v4l2_jpeg_chroma_subsampling {
46  #define V4L2_CID_TEST_PATTERN_GREENR           (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
47  #define V4L2_CID_TEST_PATTERN_BLUE             (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
48  #define V4L2_CID_TEST_PATTERN_GREENB           (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
49 +#define V4L2_CID_UNIT_CELL_SIZE                        (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
50  
51  
52  /* Image processing controls */