• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR MIT)
2  *
3  * Copyright (C) 2019 Rockchip Electronics Co., Ltd.
4  */
5 
6 #ifndef _UAPI_RKCIF_CONFIG_H
7 #define _UAPI_RKCIF_CONFIG_H
8 
9 #include <linux/types.h>
10 #include <linux/v4l2-controls.h>
11 
12 #define RKCIF_API_VERSION		KERNEL_VERSION(0, 1, 0xa)
13 
14 #define RKCIF_CMD_GET_CSI_MEMORY_MODE \
15 	_IOR('V', BASE_VIDIOC_PRIVATE + 0, int)
16 
17 #define RKCIF_CMD_SET_CSI_MEMORY_MODE \
18 	_IOW('V', BASE_VIDIOC_PRIVATE + 1, int)
19 
20 #define RKCIF_CMD_GET_SCALE_BLC \
21 	_IOR('V', BASE_VIDIOC_PRIVATE + 2, struct bayer_blc)
22 
23 #define RKCIF_CMD_SET_SCALE_BLC \
24 	_IOW('V', BASE_VIDIOC_PRIVATE + 3, struct bayer_blc)
25 
26 /* cif memory mode
27  * 0: raw12/raw10/raw8 8bit memory compact
28  * 1: raw12/raw10 16bit memory one pixel
29  *    low align for rv1126/rv1109/rk356x
30  *    |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
31  *    | -| -| -| -|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
32  * 2: raw12/raw10 16bit memory one pixel
33  *    high align for rv1126/rv1109/rk356x
34  *    |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
35  *    |11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -| -| -| -|
36  *
37  * note: rv1109/rv1126/rk356x dvp only support uncompact mode,
38  *       and can be set low align or high align
39  */
40 
41 enum cif_csi_lvds_memory {
42 	CSI_LVDS_MEM_COMPACT = 0,
43 	CSI_LVDS_MEM_WORD_LOW_ALIGN = 1,
44 	CSI_LVDS_MEM_WORD_HIGH_ALIGN = 2,
45 };
46 
47 /* black level for scale image
48  * The sequence of pattern00~03 is the same as the output of sensor bayer
49  */
50 
51 struct bayer_blc {
52 	u8 pattern00;
53 	u8 pattern01;
54 	u8 pattern02;
55 	u8 pattern03;
56 };
57 #endif
58