summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Sharma <abhishek.sharma@ti.com>2024-03-14 16:55:40 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2024-03-14 07:53:57 -0500
commit43a9172360a59bc314979be22056e9c3d23c1695 (patch)
tree7a87ffdfd82accb1b7edbba760db47d5489ed487
parent52d9c20eaefcb664425006ffe5a5733dd8153c63 (diff)
HACK: media: v4l2-core: v4l2-ctrls-defs: Add custom IR exposure/gain
The OX05B1S camera sensor supports both RGB and IR stream exposure/gain controls. The sensor has one source pad which gives out 2 streams: IR dominant (stream 0) and RGB dominant stream (stream 1). When programming the exposure/gain settings for the camera from a user space application like V4L2 user space API, we are unable to specify the stream for which the exposure/gain change is required. Hence, we have defined 3 custom control IDs for IR channel exposure, anologue and digital gain control. These custom controls added for IR channel are not an upstream acceptable solution and a better solution is required in the V4L2 framework for exposure/gain control in multistream sensors to remove this HACK. Signed-off-by: Abhishek Sharma <abhishek.sharma@ti.com>
-rw-r--r--drivers/media/v4l2-core/v4l2-ctrls-defs.c3
-rw-r--r--include/uapi/linux/v4l2-controls.h6
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
index e22921e7ea61..33c786eb1d90 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
@@ -793,6 +793,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ALPHA_COMPONENT: return "Alpha Component";
case V4L2_CID_COLORFX_CBCR: return "Color Effects, CbCr";
case V4L2_CID_COLORFX_RGB: return "Color Effects, RGB";
+ case V4L2_CID_IR_EXPOSURE: return "Exposure, IR";
/*
* Codec controls
@@ -1111,6 +1112,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_IR_ANALOGUE_GAIN: return "Analogue Gain, IR";
/* Image processing controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
@@ -1120,6 +1122,7 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_TEST_PATTERN: return "Test Pattern";
case V4L2_CID_DEINTERLACING_MODE: return "Deinterlacing Mode";
case V4L2_CID_DIGITAL_GAIN: return "Digital Gain";
+ case V4L2_CID_IR_DIGITAL_GAIN: return "Digital Gain, IR";
/* DV controls */
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index d4a4e3cab3c2..1164694b12c1 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -148,8 +148,10 @@ enum v4l2_colorfx {
#define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
#define V4L2_CID_COLORFX_RGB (V4L2_CID_BASE+43)
+#define V4L2_CID_IR_EXPOSURE (V4L2_CID_BASE+44)
+
/* last CID + 1 */
-#define V4L2_CID_LASTP1 (V4L2_CID_BASE+44)
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+45)
/* USER-class private control IDs */
@@ -1143,6 +1145,7 @@ enum v4l2_jpeg_chroma_subsampling {
#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)
#define V4L2_CID_NOTIFY_GAINS (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9)
+#define V4L2_CID_IR_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 10)
/* Image processing controls */
@@ -1155,6 +1158,7 @@ enum v4l2_jpeg_chroma_subsampling {
#define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
#define V4L2_CID_DEINTERLACING_MODE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
#define V4L2_CID_DIGITAL_GAIN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 5)
+#define V4L2_CID_IR_DIGITAL_GAIN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 6)
/* DV-class control IDs defined by V4L2 */
#define V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)