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 #define RKCIF_CMD_SET_FPS \ 27 _IOW('V', BASE_VIDIOC_PRIVATE + 4, struct rkcif_fps) 28 29 /* cif memory mode 30 * 0: raw12/raw10/raw8 8bit memory compact 31 * 1: raw12/raw10 16bit memory one pixel 32 * low align for rv1126/rv1109/rk356x 33 * |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| 34 * | -| -| -| -|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| 35 * 2: raw12/raw10 16bit memory one pixel 36 * high align for rv1126/rv1109/rk356x 37 * |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| 38 * |11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| -| -| -| -| 39 * 40 * note: rv1109/rv1126/rk356x dvp only support uncompact mode, 41 * and can be set low align or high align 42 */ 43 44 enum cif_csi_lvds_memory { 45 CSI_LVDS_MEM_COMPACT = 0, 46 CSI_LVDS_MEM_WORD_LOW_ALIGN = 1, 47 CSI_LVDS_MEM_WORD_HIGH_ALIGN = 2, 48 }; 49 50 /* black level for scale image 51 * The sequence of pattern00~03 is the same as the output of sensor bayer 52 */ 53 54 struct bayer_blc { 55 u8 pattern00; 56 u8 pattern01; 57 u8 pattern02; 58 u8 pattern03; 59 }; 60 61 struct rkcif_fps { 62 int ch_num; 63 int fps; 64 }; 65 66 #endif 67