Skip to content

Commit 4699121

Browse files
committed
driver: video: ctrls: add VIDEO_CID_DIGITAL_GAIN
Only VIDEO_CID_ANALOGUE_GAIN and VIDEO_CID_GAIN were defined. Also add the complementary VIDEO_CID_DIGITAL_GAIN. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 98ba754 commit 4699121

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

drivers/video/video_ctrls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ static inline const char *video_get_ctrl_name(uint32_t id)
544544
return "Test Pattern";
545545
case VIDEO_CID_LINK_FREQ:
546546
return "Link Frequency";
547+
case VIDEO_CID_DIGITAL_GAIN:
548+
return "Digital Gain";
547549
default:
548550
return NULL;
549551
}

include/zephyr/drivers/video-controls.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ enum video_camera_orientation {
349349
*/
350350
#define VIDEO_CID_IMAGE_SOURCE_CLASS_BASE 0x009e0900
351351

352-
/** Analogue gain control. */
352+
/** Analogue gain is gain affecting all colour components in the pixel
353+
* matrix. The gain operation is performed in the analogue domain
354+
* before A/D conversion.
355+
*/
353356
#define VIDEO_CID_ANALOGUE_GAIN (VIDEO_CID_IMAGE_SOURCE_CLASS_BASE + 3)
354357

355358
/**
@@ -371,6 +374,14 @@ enum video_camera_orientation {
371374
/** Selection of the type of test pattern to represent */
372375
#define VIDEO_CID_TEST_PATTERN (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 3)
373376

377+
/** Digital gain is the value by which all colour components
378+
* are multiplied by. Typically the digital gain applied is the
379+
* control value divided by e.g. 0x100, meaning that to get no
380+
* digital gain the control value needs to be 0x100. The no-gain
381+
* configuration is also typically the default.
382+
*/
383+
#define VIDEO_CID_DIGITAL_GAIN (VIDEO_CID_IMAGE_PROC_CLASS_BASE + 5)
384+
374385
/**
375386
* @}
376387
*/

0 commit comments

Comments
 (0)