Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2019 Microchip Technology Inc. and its subsidiaries
0004  *
0005  * Author: Eugen Hristev <eugen.hristev@microchip.com>
0006  */
0007 
0008 #ifndef __LINUX_ATMEL_ISC_MEDIA_H__
0009 #define __LINUX_ATMEL_ISC_MEDIA_H__
0010 
0011 /*
0012  * There are 8 controls available:
0013  * 4 gain controls, sliders, for each of the BAYER components: R, B, GR, GB.
0014  * These gains are multipliers for each component, in format unsigned 0:4:9 with
0015  * a default value of 512 (1.0 multiplier).
0016  * 4 offset controls, sliders, for each of the BAYER components: R, B, GR, GB.
0017  * These offsets are added/substracted from each component, in format signed
0018  * 1:12:0 with a default value of 0 (+/- 0)
0019  *
0020  * To expose this to userspace, added 8 custom controls, in an auto cluster.
0021  *
0022  * To summarize the functionality:
0023  * The auto cluster switch is the auto white balance control, and it works
0024  * like this:
0025  * AWB == 1: autowhitebalance is on, the do_white_balance button is inactive,
0026  * the gains/offsets are inactive, but volatile and readable.
0027  * Thus, the results of the whitebalance algorithm are available to userspace to
0028  * read at any time.
0029  * AWB == 0: autowhitebalance is off, cluster is in manual mode, user can
0030  * configure the gain/offsets directly.
0031  * More than that, if the do_white_balance button is
0032  * pressed, the driver will perform one-time-adjustment, (preferably with color
0033  * checker card) and the userspace can read again the new values.
0034  *
0035  * With this feature, the userspace can save the coefficients and reinstall them
0036  * for example after reboot or reprobing the driver.
0037  */
0038 
0039 enum atmel_isc_ctrl_id {
0040     /* Red component gain control */
0041     ISC_CID_R_GAIN = (V4L2_CID_USER_ATMEL_ISC_BASE + 0),
0042     /* Blue component gain control */
0043     ISC_CID_B_GAIN,
0044     /* Green Red component gain control */
0045     ISC_CID_GR_GAIN,
0046     /* Green Blue gain control */
0047     ISC_CID_GB_GAIN,
0048     /* Red component offset control */
0049     ISC_CID_R_OFFSET,
0050     /* Blue component offset control */
0051     ISC_CID_B_OFFSET,
0052     /* Green Red component offset control */
0053     ISC_CID_GR_OFFSET,
0054     /* Green Blue component offset control */
0055     ISC_CID_GB_OFFSET,
0056 };
0057 
0058 #endif