Skip to content

Commit a8a2d75

Browse files
Sakari Ailusmchehab
authored andcommitted
media: v4l: uapi: ccs: Add controls for analogue gain constants
Add V4L2 controls for analogue gain constants required to control analogue gain. The values are device specific and thus need to be obtained from the driver. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent db08f69 commit a8a2d75

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎Documentation/userspace-api/media/drivers/ccs.rst‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,29 @@ analogue data is never read from the pixel matrix that are outside the
5656
configured selection rectangle that designates crop. The difference has an
5757
effect in device timing and likely also in power consumption.
5858

59+
Private controls
60+
----------------
61+
62+
The MIPI CCS driver implements a number of private controls under
63+
``V4L2_CID_USER_BASE_CCS`` to control the MIPI CCS compliant camera sensors.
64+
65+
Analogue gain model
66+
~~~~~~~~~~~~~~~~~~~
67+
68+
The CCS defines an analogue gain model where the gain can be calculated using
69+
the following formula:
70+
71+
gain = m0 * x + c0 / (m1 * x + c1)
72+
73+
Either m0 or c0 will be zero. The constants that are device specific, can be
74+
obtained from the following controls:
75+
76+
V4L2_CID_CCS_ANALOGUE_GAIN_M0
77+
V4L2_CID_CCS_ANALOGUE_GAIN_M1
78+
V4L2_CID_CCS_ANALOGUE_GAIN_C0
79+
V4L2_CID_CCS_ANALOGUE_GAIN_C1
80+
81+
The analogue gain (``x`` in the formula) is controlled through
82+
``V4L2_CID_ANALOGUE_GAIN`` in this case.
83+
5984
**Copyright** |copy| 2020 Intel Corporation

‎MAINTAINERS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11840,6 +11840,7 @@ F: Documentation/userspace-api/media/drivers/ccs.rst
1184011840
F: drivers/media/i2c/ccs-pll.c
1184111841
F: drivers/media/i2c/ccs-pll.h
1184211842
F: drivers/media/i2c/ccs/
11843+
F: include/uapi/linux/ccs.h
1184311844
F: include/uapi/linux/smiapp.h
1184411845

1184511846
MIPS

‎include/uapi/linux/ccs.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
2+
/* Copyright (C) 2020 Intel Corporation */
3+
4+
#ifndef __UAPI_CCS_H__
5+
#define __UAPI_CCS_H__
6+
7+
#include <linux/v4l2-controls.h>
8+
9+
#define V4L2_CID_CCS_ANALOGUE_GAIN_M0 (V4L2_CID_USER_CCS_BASE + 1)
10+
#define V4L2_CID_CCS_ANALOGUE_GAIN_C0 (V4L2_CID_USER_CCS_BASE + 2)
11+
#define V4L2_CID_CCS_ANALOGUE_GAIN_M1 (V4L2_CID_USER_CCS_BASE + 3)
12+
#define V4L2_CID_CCS_ANALOGUE_GAIN_C1 (V4L2_CID_USER_CCS_BASE + 4)
13+
14+
#endif

0 commit comments

Comments
 (0)