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.
Unified · Split
| @@ -56,4 +56,29 @@ analogue data is never read from the pixel matrix that are outside the · 55 unmodified lines | ||
| 56 | 56 | configured selection rectangle that designates crop. The difference has an |
| 57 | 57 | effect in device timing and likely also in power consumption. |
| 58 | 58 | |
| 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 | + | |
| 59 | 84 | **Copyright** |copy| 2020 Intel Corporation |
| @@ -11840,6 +11840,7 @@ F: Documentation/userspace-api/media/drivers/ccs.rst · 11839 unmodified lines | ||
| 11840 | 11840 | F: drivers/media/i2c/ccs-pll.c |
| 11841 | 11841 | F: drivers/media/i2c/ccs-pll.h |
| 11842 | 11842 | F: drivers/media/i2c/ccs/ |
| 11843 | +F: include/uapi/linux/ccs.h | |
| 11843 | 11844 | F: include/uapi/linux/smiapp.h |
| 11844 | 11845 | |
| 11845 | 11846 | MIPS |
| @@ -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 | |