Browse Source

Linux_SDK_V1.0.2

thead_admin 1 year ago
parent
commit
ea52f0cb71
74 changed files with 29852 additions and 73 deletions
  1. 152 0
      Makefile
  2. 0 36
      README.en.md
  3. 1 37
      README.md
  4. 84 0
      drivers/CMakeLists.txt
  5. 518 0
      drivers/GC02M1B/3aconfig_GC02M1B.json
  6. 35 0
      drivers/GC02M1B/CMakeLists.txt
  7. 0 0
      drivers/GC02M1B/GC02M1B.c
  8. 674 0
      drivers/GC02M1B/GC02M1B_1600x1200.xml
  9. 200 0
      drivers/GC02M1B/GC02M1B_mipi1lane_1600x1200@30_mayi.txt
  10. 241 0
      drivers/GC02M1B/GC02M1B_priv.h
  11. 1377 0
      drivers/GC02M1B/gc02m1b.h
  12. 517 0
      drivers/GC5035/3aconfig_GC5035.json
  13. 35 0
      drivers/GC5035/CMakeLists.txt
  14. 0 0
      drivers/GC5035/GC5035.c
  15. 544 0
      drivers/GC5035/GC5035.xml
  16. 544 0
      drivers/GC5035/GC5035_1280x720.xml
  17. 544 0
      drivers/GC5035/GC5035_1296x972.xml
  18. 544 0
      drivers/GC5035/GC5035_1920x1080.xml
  19. 544 0
      drivers/GC5035/GC5035_2592x1944.xml
  20. 544 0
      drivers/GC5035/GC5035_640x480.xml
  21. 163 0
      drivers/GC5035/GC5035_mipi2lane_1280x720@30_gc.txt
  22. 257 0
      drivers/GC5035/GC5035_mipi2lane_1280x720@30_mayi.txt
  23. 257 0
      drivers/GC5035/GC5035_mipi2lane_1280x720@60_bitland.txt
  24. 262 0
      drivers/GC5035/GC5035_mipi2lane_1280x720@60_mayi.txt
  25. 255 0
      drivers/GC5035/GC5035_mipi2lane_1296x972@30_bitland.txt
  26. 257 0
      drivers/GC5035/GC5035_mipi2lane_1296x972@30_mayi.txt
  27. 166 0
      drivers/GC5035/GC5035_mipi2lane_1920x1080@30_gc.txt
  28. 257 0
      drivers/GC5035/GC5035_mipi2lane_2592x1922@30_bitland.txt
  29. 257 0
      drivers/GC5035/GC5035_mipi2lane_2592x1922@30_mayi.txt
  30. 166 0
      drivers/GC5035/GC5035_mipi2lane_2592x1944@30_gc.txt
  31. 166 0
      drivers/GC5035/GC5035_mipi2lane_640x480@30_gc.txt
  32. 241 0
      drivers/GC5035/GC5035_priv.h
  33. 1377 0
      drivers/GC5035/gc5035.h
  34. 517 0
      drivers/IMX219/3aconfig_IMX219.json
  35. 35 0
      drivers/IMX219/CMakeLists.txt
  36. 0 0
      drivers/IMX219/IMX219.c
  37. 674 0
      drivers/IMX219/IMX219_1640x1232.xml
  38. 674 0
      drivers/IMX219/IMX219_1920x1080.xml
  39. 674 0
      drivers/IMX219/IMX219_3280x2464.xml
  40. 674 0
      drivers/IMX219/IMX219_640x480.xml
  41. 59 0
      drivers/IMX219/IMX219_mipi4lane_1920x1080@30.txt
  42. 241 0
      drivers/IMX219/IMX219_priv.h
  43. 1377 0
      drivers/IMX219/imx219.h
  44. 35 0
      drivers/IMX334/CMakeLists.txt
  45. 2044 0
      drivers/IMX334/IMX334.c
  46. 544 0
      drivers/IMX334/IMX334.xml
  47. 674 0
      drivers/IMX334/IMX334_3864x2180.xml
  48. 102 0
      drivers/IMX334/IMX334_mipi4lane_3840_2160_raw12_800mbps_3dol_init.txt
  49. 165 0
      drivers/IMX334/IMX334_mipi4lane_3864_2180_raw12_800mbps_init.txt
  50. 207 0
      drivers/IMX334/IMX334_priv.h
  51. 518 0
      drivers/SC132GS/3aconfig_SC132GS.json
  52. 35 0
      drivers/SC132GS/CMakeLists.txt
  53. 2 0
      drivers/SC132GS/README.txt
  54. 1996 0
      drivers/SC132GS/SC132GS.c
  55. 544 0
      drivers/SC132GS/SC132GS.xml
  56. 544 0
      drivers/SC132GS/SC132GS_1080x1280.xml
  57. 101 0
      drivers/SC132GS/SC132GS_mipi2lane_1080x1280_init.txt
  58. 105 0
      drivers/SC132GS/SC132GS_mipi2lane_1080x1280_master_init.txt
  59. 112 0
      drivers/SC132GS/SC132GS_mipi2lane_1080x1280_slave_init.txt
  60. 120 0
      drivers/SC132GS/SC132GS_mipi2lane_960x1280_init.txt
  61. 125 0
      drivers/SC132GS/SC132GS_mipi2lane_960x1280_master_init.txt
  62. 131 0
      drivers/SC132GS/SC132GS_mipi2lane_960x1280_slave_init.txt
  63. 241 0
      drivers/SC132GS/SC132GS_priv.h
  64. 1377 0
      drivers/SC132GS/sc132gs.h
  65. 518 0
      drivers/SC2310/3aconfig_SC2310.json
  66. 35 0
      drivers/SC2310/CMakeLists.txt
  67. 0 0
      drivers/SC2310/SC2310.c
  68. 674 0
      drivers/SC2310/SC2310_1920x1080.xml
  69. 674 0
      drivers/SC2310/SC2310_1920x1088.xml
  70. 173 0
      drivers/SC2310/SC2310_mipi2lane_1920x1080_raw10_30fps_init.txt
  71. 166 0
      drivers/SC2310/SC2310_mipi2lane_1920x1088_raw12_30fps_init.txt
  72. 168 0
      drivers/SC2310/SC2310_mipi2lane_640x480_raw12_30fps_init.txt
  73. 241 0
      drivers/SC2310/SC2310_priv.h
  74. 1377 0
      drivers/SC2310/sc2310.h

+ 152 - 0
Makefile

@@ -0,0 +1,152 @@
+##
+ # Copyright (C) 2020 Alibaba Group Holding Limited
+##
+VERBOSE=1
+
+CONFIG_COMPILE_PLATFORM=RISCV
+
+CONFIG_ISP_BUILD_TYPE=DEBUG
+#CONFIG_ISP_BUILD_TYPE=RELEASE
+CONFIG_ISP_VERSION=ISP8000L_V2008
+CONFIG_ISP_LIB_BUILD_DIR=units/build
+CONFIG_SENSOR_LIB_BUILD_DIR=build
+CONFIG_ISP_RY_BUILD_TYPE=DEBUG
+#CONFIG_ISP_RY_BUILD_TYPE=RELEASE
+CONFIG_ISP_RY_VERSION=ISP8000_V2009
+CONFIG_ISP_RY_LIB_BUILD_DIR=units_ry/build
+
+CONFIG_DW200_CMODEL=off # on, off
+CONFIG_DW200_V4L2=off # on, off
+CONFIG_DW200_BUILD_DIR=dw200/build
+
+CONFIG_DEC400_BUILD_DIR=dec400/build
+CONFIG_VI_MONITOR_BUILD_DIR=vi_monitor/build
+CONFIG_VI_MONITOR_TRACE=MONITOR_TRACE_ON
+#CONFIG_VI_MONITOR_TRACE=MONITOR_TRACE_OFF
+
+export CONFIG_HAL_PLATFORM=HAL_ALTERA
+export COMPILE_PLATFORM=$(CONFIG_COMPILE_PLATFORM)
+
+CONFIG_CMAKE_SENSOR_LIB_CMD:= \
+    cmake -DCMAKE_BUILD_TYPE=$(CONFIG_ISP_BUILD_TYPE)       \
+      -DISP_VERSION=$(CONFIG_ISP_VERSION)                   \
+      -DSUBDEV_CHAR=1 -DHAL_PLATFORM=$(CONFIG_HAL_PLATFORM) \
+      -DUSE_3AV2=1 \
+      -DDUMMY_BUILD=0 \
+      -DVVCAM_INC_PATH=$(VVCAM_INC_PATH) \
+	  -DCMAKE_VERBOSE_MAKEFILE=ON\
+      -Wno-dev ../drivers/
+
+DIR_ISP_TARGET_BASE=bsp/isp
+DIR_ISP_TARGET_LIB =bsp/isp/lib
+DIR_ISP_TARGET_KO  =bsp/isp/ko
+DIR_ISP_TARGET_TEST=bsp/isp/test
+DIR_ISP_TARGET_SDK =bsp/isp/sdk
+
+DIR_ISP_RY_TARGET_BASE=bsp/isp_ry
+DIR_ISP_RY_TARGET_LIB =bsp/isp_ry/lib
+DIR_ISP_RY_TARGET_KO  =bsp/isp_ry/ko
+DIR_ISP_RY_TARGET_TEST=bsp/isp_ry/test
+DIR_ISP_RY_TARGET_SDK =bsp/isp_ry/sdk
+
+DIR_DW200_TARGET_BASE=bsp/dw200
+DIR_DW200_TARGET_TEST=bsp/dw200/test
+DIR_DW200_TARGET_DEMO=bsp/dw200/demo
+DIR_DW200_TARGET_LIB=bsp/dw200/lib
+
+DIR_DEC400_TARGET_BASE=bsp/dec400
+DIR_DEC400_TARGET_TEST=bsp/dec400/test
+DIR_DEC400_TARGET_LIB=bsp/dec400/lib
+
+DIR_VI_MONITOR_TARGET_BASE=bsp/vi_monitor
+DIR_VI_MONITOR_TARGET_TEST=bsp/vi_monitor/test
+DIR_VI_MONITOR_TARGET_LIB=bsp/vi_monitor/lib
+
+MODULE_NAME=ISP
+BUILD_LOG_START="\033[47;30m>>> $(MODULE_NAME) $@ begin\033[0m"
+BUILD_LOG_END  ="\033[47;30m<<< $(MODULE_NAME) $@ end\033[0m"
+
+#
+# Do a parallel build with multiple jobs, based on the number of CPUs online
+# in this system: 'make -j8' on a 8-CPU system, etc.
+#
+# (To override it, run 'make JOBS=1' and similar.)
+#
+ifeq ($(JOBS),)
+  JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
+  ifeq ($(JOBS),)
+    JOBS := 1
+  endif
+endif
+
+all:    info sensor_lib \
+		install_local_output install_rootfs
+.PHONY: info sensor_lib \
+		install_local_output install_rootfs \
+        clean_sensor_lib \
+        clean_output clean
+
+info:
+	@echo $(BUILD_LOG_START)
+	@echo $(VVCAM_INC_PATH)
+	@echo "  ====== Build Info from repo project ======"
+	@echo "    BUILDROOT_DIR="$(BUILDROOT_DIR)
+	@echo "    CROSS_COMPILE="$(CROSS_COMPILE)
+	@echo "    LINUX_DIR="$(LINUX_DIR)
+	@echo "    ARCH="$(ARCH)
+	@echo "    BOARD_NAME="$(BOARD_NAME)
+	@echo "    KERNEL_ID="$(KERNELVERSION)
+	@echo "    KERNEL_DIR="$(LINUX_DIR)
+	@echo "    INSTALL_DIR_ROOTFS="$(INSTALL_DIR_ROOTFS)
+	@echo "    INSTALL_DIR_SDK="$(INSTALL_DIR_SDK)
+	@echo "    DIR_MODULE_TOP="$(DIR_MODULE_TOP)
+	@echo "  ====== Build configuration by settings ======"
+	@echo "    COMPILE_PLATFORM="$(CONFIG_COMPILE_PLATFORM)
+	@echo "    JOBS="$(JOBS)
+	@echo "    ISP_BUILD_TYPE="$(CONFIG_ISP_BUILD_TYPE)
+	@echo "    ISP_VERSION="$(CONFIG_ISP_VERSION)
+	@echo "    ISP_LIB_BUILD_DIR="$(CONFIG_ISP_LIB_BUILD_DIR)
+	@echo "    CMAKE_SENSOR_LIB_CMD=" $(CONFIG_CMAKE_SENSOR_LIB_CMD)
+	@echo "    DW200_CMODEL="$(CONFIG_DW200_CMODEL)
+	@echo "    DW200_V4L2="$(CONFIG_DW200_V4L2)
+	@echo "    DW200_BUILD_DIR="$(CONFIG_DW200_BUILD_DIR)
+	@echo "    DW200_CMAKE_CMD="$(CONFIG_DW200_CMAKE_CMD)
+	@echo "    DEC400_BUILD_DIR="$(CONFIG_DEC400_BUILD_DIR)
+	@echo "    DEC400_CMAKE_CMD="$(CONFIG_DEC400_CMAKE_CMD)
+	@echo "    VI_MONITOR_BUILD_DIR="$(CONFIG_VI_MONITOR_BUILD_DIR)
+	@echo "    VI_MONITOR_CMAKE_CMD="$(CONFIG_VI_MONITOR_CMAKE_CMD)
+	@echo "    ISP_RY_BUILD_TYPE="$(CONFIG_ISP_RY_BUILD_TYPE)
+	@echo "    ISP_RY_VERSION="$(CONFIG_ISP_RY_VERSION)
+	@echo "    ISP_RY_LIB_BUILD_DIR="$(CONFIG_ISP_RY_LIB_BUILD_DIR)
+	@echo "    CMAKE_ISP_RY_LIB_CMD=" $(CONFIG_CMAKE_ISP_RY_LIB_CMD)
+	@echo $(BUILD_LOG_END)
+
+sensor_lib: 
+	mkdir -p $(CONFIG_SENSOR_LIB_BUILD_DIR); \
+	cd $(CONFIG_SENSOR_LIB_BUILD_DIR);       \
+	$(CONFIG_CMAKE_SENSOR_LIB_CMD);          \
+	make -j$(JOBS);                   \
+
+clean_sensor_lib:
+	@echo $(BUILD_LOG_START)
+	rm -rf $(CONFIG_SENSOR_LIB_BUILD_DIR)
+	@echo $(BUILD_LOG_END)
+
+install_local_output: sensor_lib
+	@echo $(BUILD_LOG_START)
+	@echo $(BUILD_LOG_END)
+
+install_rootfs: install_local_output
+	@echo $(BUILD_LOG_START)
+	@echo $(BUILD_LOG_END)
+
+clean_output:
+	@echo $(BUILD_LOG_START)
+	@echo $(BUILD_LOG_END)
+
+clean_proprietories_include:
+	@echo $(BUILD_LOG_START)
+	@echo $(BUILD_LOG_END)
+
+clean: clean_output clean_sensor_lib \
+	clean_proprietories_include

+ 0 - 36
README.en.md

@@ -1,36 +0,0 @@
-# vi-sensor
-
-#### Description
-camera sensor驱动
-
-#### Software Architecture
-Software architecture description
-
-#### Installation
-
-1.  xxxx
-2.  xxxx
-3.  xxxx
-
-#### Instructions
-
-1.  xxxx
-2.  xxxx
-3.  xxxx
-
-#### Contribution
-
-1.  Fork the repository
-2.  Create Feat_xxx branch
-3.  Commit your code
-4.  Create Pull Request
-
-
-#### Gitee Feature
-
-1.  You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
-2.  Gitee blog [blog.gitee.com](https://blog.gitee.com)
-3.  Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
-4.  The most valuable open source project [GVP](https://gitee.com/gvp)
-5.  The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
-6.  The most popular members  [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

+ 1 - 37
README.md

@@ -1,37 +1 @@
-# vi-sensor
-
-#### 介绍
-camera sensor驱动
-
-#### 软件架构
-软件架构说明
-
-
-#### 安装教程
-
-1.  xxxx
-2.  xxxx
-3.  xxxx
-
-#### 使用说明
-
-1.  xxxx
-2.  xxxx
-3.  xxxx
-
-#### 参与贡献
-
-1.  Fork 本仓库
-2.  新建 Feat_xxx 分支
-3.  提交代码
-4.  新建 Pull Request
-
-
-#### 特技
-
-1.  使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2.  Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
-3.  你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
-4.  [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
-5.  Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
-6.  Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+This is where customers compile their camera sensor drivers

+ 84 - 0
drivers/CMakeLists.txt

@@ -0,0 +1,84 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+project(sensor_driver)
+
+aux_source_directory(. DIR_SRCS)
+
+include_directories(${PROJECT_SOURCE_DIR}/../../recipe-sysroot/usr/include/vvcam/common)
+link_directories(
+    ${PROJECT_SOURCE_DIR}/../../recipe-sysroot/usr/lib/
+)
+
+if (NOT LIB_ROOT)
+    get_filename_component(LIB_ROOT ${PROJECT_BINARY_DIR} ABSOLUTE)
+endif (NOT LIB_ROOT)
+message ("LIB_ROOT is at: ${LIB_ROOT}")
+
+if(USE_3AV2)
+add_definitions(-DUSE_3AV2)
+endif()
+
+if (SUBDEV_CHAR)
+add_definitions(-DSUBDEV_CHAR)
+endif()
+
+add_definitions(-DHAL_ALTERA)
+add_definitions(-DAPPMODE_NATIVE)
+add_definitions(-DCAM_ENGINE_DRAW_DOM_ONLY)
+add_definitions(-DISP8000L_BASE)
+add_definitions(-DISP8000L_V2008)
+add_definitions(-DISPVI_EXPAND_CHAN)
+add_definitions(-DISP_2DNR)
+add_definitions(-DISP_2DNR_V2)
+add_definitions(-DISP_2DNR_V4)
+add_definitions(-DISP_2DNR_V5)
+add_definitions(-DISP_3DNR_V3)
+add_definitions(-DISP_AEV2)
+add_definitions(-DISP_AEV2_V2)
+add_definitions(-DISP_AE_SHADOW)
+add_definitions(-DISP_BLS)
+add_definitions(-DISP_CA)
+add_definitions(-DISP_COMPAND)
+add_definitions(-DISP_CPROC_10BIT)
+add_definitions(-DISP_CPROC_SHD)
+add_definitions(-DISP_DEMOSAIC2)
+add_definitions(-DISP_EE)
+add_definitions(-DISP_FILTER)
+add_definitions(-DISP_GREENEQUILIBRATE)
+add_definitions(-DISP_HDR_STITCH)
+add_definitions(-DISP_HIST256)
+add_definitions(-DISP_HIST64)
+add_definitions(-DISP_LSC_V2)
+add_definitions(-DISP_MIV2)
+add_definitions(-DISP_MI_BUF_DUMP)
+add_definitions(-DISP_MI_HDR)
+add_definitions(-DISP_MI_MCM_WR)
+add_definitions(-DISP_MI_PP_WRITE)
+add_definitions(-DISP_RGBGC)
+add_definitions(-DISP_RGBIR)
+add_definitions(-DISP_SP2)
+add_definitions(-DISP_TPG)
+add_definitions(-DISP_USE_AEV2)
+add_definitions(-DISP_USE_AWBV2)
+add_definitions(-DISP_VERSION=\"ISP8000L_V2008\")
+add_definitions(-DISP_VSM)
+add_definitions(-DISP_WDR_V4)
+add_definitions(-DISP_WDR_V4_20BIT)
+add_definitions(-DLINUX)
+add_definitions(-DMARVIN_HW_ALTERA -DMIPI_USE_CAMERIC)
+add_definitions(-DMRV_STITCHING_EXP_VERSION)
+add_definitions(-DMRV_STITCHING_HIST_VERSION)
+add_definitions(-DMRV_STITCHING_VERSION=2)
+
+add_compile_options(-Werror=implicit-function-declaration)
+
+add_subdirectory(IMX219)
+add_subdirectory(SC2310)
+add_subdirectory(SC132GS)
+add_subdirectory(GC5035)
+add_subdirectory(GC02M1B)
+add_subdirectory(IMX334)
+
+link_libraries(${PROJECT_NAME} isi )
+
+#target_link_libraries()

+ 518 - 0
drivers/GC02M1B/3aconfig_GC02M1B.json

@@ -0,0 +1,518 @@
+{
+    "root" : [
+        {
+            "classname" : "Aev1",
+            "enable" : false
+        },
+        {
+            "classname" : "Aev2",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roiWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 10,
+            "maxSensorDgain" : 6,
+            "maxIspDgain" : 2.5,
+            "setPoint" : 50,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5
+        },
+        {
+            "classname" : "Aehdr",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 10,
+            "maxSensorDgain" : 6,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "AdaptiveAe",
+            "enable" : true,
+            "motionThreshold" : 0.7,
+            "roi_start" : 7,
+            "roi_end" : 20,
+            "roi_weight" : 1,
+            "faceWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "targetFilter"  : 0.5,
+            "wdrContrast.min" : 150,
+            "wdrContrast.max" : 150,
+            "lowlight" : {
+                "linear_repress" : [0.8, 0.7, 0.5, 0.5, 0.4],
+                "linear_gain" : [4, 8, 16, 32, 100],
+                "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8],
+                "hdr_gain" : [4, 8, 16, 32, 100]
+            },
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 1,
+            "setPoint" : 60
+        },
+        {
+            "classname" : "Awbv2",
+            "enable" : false,
+            "illuorder" : "A, D50, D65, D75, TL84, F12, CWF",
+            "indoor" : [1, 1, 1, 1, 1, 1, 1],
+            "outdoor" : [1, 1, 1, 1, 1, 1, 1],
+            "transition" : [1, 1, 1, 1, 1, 1, 1],
+            "avg" : 0
+        },
+        {
+            "classname" : "IspController",
+            "enable" : true
+        },
+        {
+            "classname" : "AutoHdr",
+            "enable" : false
+        },
+        {
+            "classname" : "DciHist",
+            "enable" : false,
+            "gaussMeanPos" : 64,
+            "gaussSigmaPos" : 128,
+            "gaussAmpPos" : 1,
+            "gaussMeanNeg" : 0,
+            "gaussSigmaNeg" : 128,
+            "gaussAmpNeg" : 1
+        },
+        {
+            "classname" : "SensorController",
+            "enable" : true
+        },
+        {
+            "classname" : "AGamma64",
+            "forcecreate" : true,
+            "enable" : true,
+            "updateOnce" : false,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 914, 930, 945, 961, 977, 992, 1008, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ACproc",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1.2, 1.1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0, 0],
+                    "saturation" : [1.2, 1.05, 0.92, 0.80, 0.75, 0.6],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1.0, 1.0, 1.3, 1.3, 1.5, 1.85],
+                    "brightness" : [-12, -12, -24, -30, -16, 0],
+                    "saturation" : [1.25, 1.0, 0.9, 0.8, 0.7, 0.6],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                }
+            ]
+        },
+        {
+            "classname" : "Aee",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [1024, 1024, 1024, 1024, 1024, 1024],
+                    "ydown" : [1024, 1024, 1024, 1024, 1024, 1024],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [1000, 1000, 1000, 1000, 500, 200]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [8000, 8000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1500, 600, 200]
+                }
+            ]
+        },
+        {
+            "classname" : "ACa",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enableCA" : [1, 1, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enableCA" : [0, 0, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ADmsc2",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : false,
+            "demoire_enable" : true,			
+            "demoire_area_thr" : 16,
+            "demoire_sat_shrink" : 8,
+            "demoire_r2" : 256,
+            "demoire_r1" : 0,           
+		    "demoire_t2_shift" : 2,
+            "demoire_t1" : 180,
+            "demoire_edge_r2" : 256,
+            "demoire_edge_r1" : 20,
+            "demoire_edge_t2_shift" : 4,
+            "demoire_edge_t1" :20,	
+            "depurple_enable" : true,		
+            "depurple_red_sat" : true,	
+            "depurple_blue_sat" : true,	
+            "depurple_sat_shrink" : 8,				
+            "depurple_thr" : 40,
+            "skin_enable" : false,			
+            "cb_thr_max_2047" : 10,
+            "cb_thr_min_2047" : 8,
+            "cr_thr_max_2047" : 10,
+            "cr_thr_min_2047" : 8,
+            "y_thr_max_2047" : 10,
+            "y_thr_min_2047" : 8,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [1, 1, 1, 1, 1, 1],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [70, 60, 40, 20, 20, 0],
+                    "facwhite" : [70, 60, 60, 40, 20, 0],
+                    "maxblack" : [100, 100, 100, 100, 100, 100],
+                    "maxwhite" : [100, 100, 100, 100, 100, 100],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [5, 5, 5, 5, 5, 5],
+                    "gsharpen" : [8, 8, 8, 8, 8, 8],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],					
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [0, 0, 0, 0, 0, 0],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [200, 200, 100, 50, 20, 20],
+                    "facwhite" : [200, 200, 150, 80, 40, 20],
+                    "maxblack" : [200, 200, 100, 100, 100, 100],
+                    "maxwhite" : [200, 200, 200, 200, 200, 200],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],				
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                }
+            ]
+        },
+        {
+            "classname" : "AWdr4",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : true,
+            "backlight" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [24, 24, 24, 24, 12, 12],
+                    "lowStrength" : [210, 180, 180, 180, 180, 180],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [500, 500, 300, 300, 300, 300],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                }
+            ],
+            "entropy_slope" : 200,
+            "entropy_base" : 700,
+            "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0],
+            "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023],
+            "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575],
+            "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575],
+            "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575]
+        },
+        {
+            "classname" : "A3dnrv3",
+            "forcecreate" : false,
+            "enable" : false,
+	    "disable" : false,
+            "autonoiseLevel": true,
+            "tnr_en" : false,
+            "nlm_en" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                }
+            ]
+        },
+        {
+            "classname" : "A2dnrv5",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+                    "sigma" : [2, 2, 2, 5, 6, 6, 11, 11, 11, 14],
+                    "blendstatic" : [100, 100, 100, 100, 100, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 90, 90, 100, 100, 100]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [100, 100, 100, 100, 100, 100, 100, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                }
+            ]
+        },
+        {
+            "classname" : "ADpf",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16],
+                    "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
+                    "sigma_rb" : [2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16],
+                    "Div" : [64, 64, 64, 64, 64, 64, 64, 64, 64, 64],
+                    "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ABlc",
+            "forcecreate" : true,
+            "enable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                }
+            ]
+        }
+    ]
+}

+ 35 - 0
drivers/GC02M1B/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module gc02m1b)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

File diff suppressed because it is too large
+ 0 - 0
drivers/GC02M1B/GC02M1B.c


File diff suppressed because it is too large
+ 674 - 0
drivers/GC02M1B/GC02M1B_1600x1200.xml


+ 200 - 0
drivers/GC02M1B/GC02M1B_mipi1lane_1600x1200@30_mayi.txt

@@ -0,0 +1,200 @@
+0xfc 0x01
+0xf4 0x41
+0xf5 0xc0
+0xf6 0x44
+0xf8 0x38
+0xf9 0x82
+0xfa 0x00
+0xfd 0x80
+0xfc 0x81
+0xfe 0x03
+0x01 0x0b
+0xf7 0x01
+0xfc 0x80
+0xfc 0x80
+0xfc 0x80
+0xfc 0x8e
+0xfe 0x00
+0x87 0x09
+0xee 0x72
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0x90 0x00
+0x03 0x04
+0x04 0x7d
+0x41 0x04
+0x42 0xf4
+0x05 0x04
+0x06 0x48
+0x07 0x00
+0x08 0x18
+0x9d 0x18
+0x09 0x00
+0x0a 0x02
+0x0d 0x04
+0x0e 0xbc
+0x17 0x80
+0x19 0x04
+0x24 0x00
+0x56 0x20
+0x5b 0x00
+0x5e 0x01
+0x21 0x3c
+0x44 0x20
+0xcc 0x01
+0x1a 0x04
+0x1f 0x11
+0x27 0x30
+0x2b 0x00
+0x33 0x00
+0x53 0x90
+0xe6 0x50
+0x39 0x07
+0x43 0x04
+0x46 0x2a
+0x7c 0xa0
+0xd0 0xbe
+0xd1 0x60
+0xd2 0x40
+0xd3 0xf3
+0xde 0x1d
+0xcd 0x05
+0xce 0x6f
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x04
+0xe0 0x01
+0xfe 0x00
+0xfe 0x01
+0x53 0x44
+0x87 0x53
+0x89 0x03
+0xfe 0x00
+0xb0 0x74
+0xb1 0x04
+0xb2 0x00
+0xb6 0x00
+0xfe 0x04
+0xd8 0x00
+0xc0 0x40
+0xc0 0x00
+0xc0 0x00
+0xc0 0x00
+0xc0 0x60
+0xc0 0x00
+0xc0 0xc0
+0xc0 0x2a
+0xc0 0x80
+0xc0 0x00
+0xc0 0x00
+0xc0 0x40
+0xc0 0xa0
+0xc0 0x00
+0xc0 0x90
+0xc0 0x19
+0xc0 0xc0
+0xc0 0x00
+0xc0 0xD0
+0xc0 0x2F
+0xc0 0xe0
+0xc0 0x00
+0xc0 0x90
+0xc0 0x39
+0xc0 0x00
+0xc0 0x01
+0xc0 0x20
+0xc0 0x04
+0xc0 0x20
+0xc0 0x01
+0xc0 0xe0
+0xc0 0x0f
+0xc0 0x40
+0xc0 0x01
+0xc0 0xe0
+0xc0 0x1a
+0xc0 0x60
+0xc0 0x01
+0xc0 0x20
+0xc0 0x25
+0xc0 0x80
+0xc0 0x01
+0xc0 0xa0
+0xc0 0x2c
+0xc0 0xa0
+0xc0 0x01
+0xc0 0xe0
+0xc0 0x32
+0xc0 0xc0
+0xc0 0x01
+0xc0 0x20
+0xc0 0x38
+0xc0 0xe0
+0xc0 0x01
+0xc0 0x60
+0xc0 0x3c
+0xc0 0x00
+0xc0 0x02
+0xc0 0xa0
+0xc0 0x40
+0xc0 0x80
+0xc0 0x02
+0xc0 0x18
+0xc0 0x5c
+0xfe 0x00
+0x9f 0x10
+0xfe 0x00
+0x26 0x20
+0xfe 0x01
+0x40 0x22
+0x46 0x7f
+0x49 0x0f
+0x4a 0xf0
+0xfe 0x04
+0x14 0x80
+0x15 0x80
+0x16 0x80
+0x17 0x80
+0xfe 0x01
+0x41 0x20
+0x4c 0x00
+0x4d 0x0c
+0x44 0x08
+0x48 0x03
+0xfe 0x01
+0x90 0x01
+0x91 0x00
+0x92 0x06
+0x93 0x00
+0x94 0x06
+0x95 0x04
+0x96 0xb0
+0x97 0x06
+0x98 0x40
+0xfe 0x03
+0x01 0x23
+0x03 0xce
+0x04 0x48
+0x15 0x00
+0x21 0x10
+0x22 0x05
+0x23 0x20
+0x25 0x20
+0x26 0x08
+0x29 0x06
+0x2a 0x0a
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x00

+ 241 - 0
drivers/GC02M1B/GC02M1B_priv.h

@@ -0,0 +1,241 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file GC02M1B_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup GC02M1B_priv
+ * @{
+ *
+ */
+#ifndef __GC02M1B_PRIV_H__
+#define __GC02M1B_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define GC02M1B_PIDH                         (0x300A)  //R  - Product ID High Byte MSBs
+#define GC02M1B_PIDL                         (0x300B)  //R  - Product ID Low Byte LSBs
+
+/*****************************************************************************
+ * Default values
+ *****************************************************************************/
+
+ // Make sure that these static settings are reflecting the capabilities defined
+// in IsiGetCapsIss (further dynamic setup may alter these default settings but
+// often does not if there is no choice available).
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define GC02M1B_PIDH_DEFAULT                        (0x27) //read only
+#define GC02M1B_PIDL_DEFAULT                        (0x70) //read only
+
+typedef struct GC02M1B_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    uint32_t              Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurIntegrationTime;
+    float               AecCurVSIntegrationTime;
+    float               AecCurLongIntegrationTime;
+    float               AecCurGain;
+    float               AecCurVSGain;
+    float               AecCurLongGain;
+
+    uint32_t            LastExpLine;
+    uint32_t            LastVsExpLine;
+    uint32_t            LastLongExpLine;
+
+    uint32_t            LastGain;
+    uint32_t            LastVsGain;
+    uint32_t            LastLongGain;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldVsGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldVsIntegrationTime;
+    uint32_t            OldGainHcg;
+    uint32_t            OldAGainHcg;
+    uint32_t            OldGainLcg;
+    uint32_t            OldAGainLcg;
+    int                 subdev;
+    uint8_t             pattern;
+
+    float               CurHdrRatio;
+} GC02M1B_Context_t;
+
+static RESULT GC02M1B_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT GC02M1B_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT GC02M1B_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT GC02M1B_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT GC02M1B_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT GC02M1B_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT GC02M1B_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT GC02M1B_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT GC02M1B_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT GC02M1B_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT GC02M1B_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT GC02M1B_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT GC02M1B_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT GC02M1B_IsiGetVSGainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT GC02M1B_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT GC02M1B_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT GC02M1B_IsiSetVSGainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT GC02M1B_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT GC02M1B_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT GC02M1B_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT GC02M1B_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT GC02M1B_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+RESULT GC02M1B_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT GC02M1B_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} GC02M1Bpriv */
+
+#endif    /* __GC02M1BPRIV_H__ */
+

+ 1377 - 0
drivers/GC02M1B/gc02m1b.h

@@ -0,0 +1,1377 @@
+/*
+ * Support for OmniVision GC02M1B 5M camera sensor.
+ *
+ * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef __GC02M1B_H__
+#define __GC02M1B_H__
+
+#define GC02M1B_NAME		"gc02m1b"
+
+#define GC02M1B_POWER_UP_RETRY_NUM 5
+
+/* Defines for register writes and register array processing */
+#define I2C_MSG_LENGTH		0x2
+#define I2C_RETRY_COUNT		5
+
+#define GC02M1B_FOCAL_LENGTH_NUM	334	/*3.34mm*/
+#define GC02M1B_FOCAL_LENGTH_DEM	100
+#define GC02M1B_F_NUMBER_DEFAULT_NUM	24
+#define GC02M1B_F_NUMBER_DEM	10
+
+#define MAX_FMTS		1
+
+/* sensor_mode_data read_mode adaptation */
+#define GC02M1B_READ_MODE_BINNING_ON	0x0400
+#define GC02M1B_READ_MODE_BINNING_OFF	0x00
+#define GC02M1B_INTEGRATION_TIME_MARGIN	8
+
+#define GC02M1B_MAX_EXPOSURE_VALUE	0xFFF1
+#define GC02M1B_MAX_GAIN_VALUE		0xFF
+
+/*
+ * focal length bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define GC02M1B_FOCAL_LENGTH_DEFAULT 0x1B70064
+
+/*
+ * current f-number bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define GC02M1B_F_NUMBER_DEFAULT 0x18000a
+
+/*
+ * f-number range bits definition:
+ * bits 31-24: max f-number numerator
+ * bits 23-16: max f-number denominator
+ * bits 15-8: min f-number numerator
+ * bits 7-0: min f-number denominator
+ */
+#define GC02M1B_F_NUMBER_RANGE 0x180a180a
+#define GC02M1B_ID	0x5690
+
+#define GC02M1B_FINE_INTG_TIME_MIN 0
+#define GC02M1B_FINE_INTG_TIME_MAX_MARGIN 0
+#define GC02M1B_COARSE_INTG_TIME_MIN 1
+#define GC02M1B_COARSE_INTG_TIME_MAX_MARGIN 6
+
+#define GC02M1B_BIN_FACTOR_MAX 4
+/*
+ * GC02M1B System control registers
+ */
+#define GC02M1B_SW_SLEEP				0x0100
+#define GC02M1B_SW_RESET				0x0103
+#define GC02M1B_SW_STREAM			0x0100
+
+#define GC02M1B_SC_CMMN_CHIP_ID_H		0x300A
+#define GC02M1B_SC_CMMN_CHIP_ID_L		0x300B
+#define GC02M1B_SC_CMMN_SCCB_ID			0x300C
+#define GC02M1B_SC_CMMN_SUB_ID			0x302A /* process, version*/
+/*Bit[7:4] Group control, Bit[3:0] Group ID*/
+#define GC02M1B_GROUP_ACCESS			0x3208
+/*
+*Bit[3:0] Bit[19:16] of exposure,
+*remaining 16 bits lies in Reg0x3501&Reg0x3502
+*/
+#define GC02M1B_EXPOSURE_H			0x3500
+#define GC02M1B_EXPOSURE_M			0x3501
+#define GC02M1B_EXPOSURE_L			0x3502
+/*Bit[1:0] means Bit[9:8] of gain*/
+#define GC02M1B_AGC_H				0x350A
+#define GC02M1B_AGC_L				0x350B /*Bit[7:0] of gain*/
+
+#define GC02M1B_HORIZONTAL_START_H		0x3800 /*Bit[11:8]*/
+#define GC02M1B_HORIZONTAL_START_L		0x3801 /*Bit[7:0]*/
+#define GC02M1B_VERTICAL_START_H			0x3802 /*Bit[11:8]*/
+#define GC02M1B_VERTICAL_START_L			0x3803 /*Bit[7:0]*/
+#define GC02M1B_HORIZONTAL_END_H			0x3804 /*Bit[11:8]*/
+#define GC02M1B_HORIZONTAL_END_L			0x3805 /*Bit[7:0]*/
+#define GC02M1B_VERTICAL_END_H			0x3806 /*Bit[11:8]*/
+#define GC02M1B_VERTICAL_END_L			0x3807 /*Bit[7:0]*/
+#define GC02M1B_HORIZONTAL_OUTPUT_SIZE_H		0x3808 /*Bit[3:0]*/
+#define GC02M1B_HORIZONTAL_OUTPUT_SIZE_L		0x3809 /*Bit[7:0]*/
+#define GC02M1B_VERTICAL_OUTPUT_SIZE_H		0x380a /*Bit[3:0]*/
+#define GC02M1B_VERTICAL_OUTPUT_SIZE_L		0x380b /*Bit[7:0]*/
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define GC02M1B_TIMING_HTS_H			0x380C
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define GC02M1B_TIMING_HTS_L			0x380D
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define GC02M1B_TIMING_VTS_H			0x380e
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define GC02M1B_TIMING_VTS_L			0x380f
+
+#define GC02M1B_MWB_RED_GAIN_H			0x3400
+#define GC02M1B_MWB_GREEN_GAIN_H			0x3402
+#define GC02M1B_MWB_BLUE_GAIN_H			0x3404
+#define GC02M1B_MWB_GAIN_MAX			0x0fff
+
+#define GC02M1B_START_STREAMING			0x01
+#define GC02M1B_STOP_STREAMING			0x00
+
+#define VCM_ADDR           0x0c
+#define VCM_CODE_MSB       0x04
+
+#define GC02M1B_INVALID_CONFIG	0xffffffff
+
+#define GC02M1B_VCM_SLEW_STEP			0x30F0
+#define GC02M1B_VCM_SLEW_STEP_MAX		0x7
+#define GC02M1B_VCM_SLEW_STEP_MASK		0x7
+#define GC02M1B_VCM_CODE				0x30F2
+#define GC02M1B_VCM_SLEW_TIME			0x30F4
+#define GC02M1B_VCM_SLEW_TIME_MAX		0xffff
+#define GC02M1B_VCM_ENABLE			0x8000
+
+#define GC02M1B_VCM_MAX_FOCUS_NEG       -1023
+#define GC02M1B_VCM_MAX_FOCUS_POS       1023
+
+#define DLC_ENABLE 1
+#define DLC_DISABLE 0
+#define VCM_PROTECTION_OFF     0xeca3
+#define VCM_PROTECTION_ON      0xdc51
+#define VCM_DEFAULT_S 0x0
+#define vcm_step_s(a) (u8)(a & 0xf)
+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3)
+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104)
+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200)
+#define vcm_val(data, s) (u16)(data << 4 | s)
+#define DIRECT_VCM vcm_dlc_mclk(0, 0)
+
+/* Defines for OTP Data Registers */
+#define GC02M1B_FRAME_OFF_NUM		0x4202
+#define GC02M1B_OTP_BYTE_MAX		32	//change to 32 as needed by otpdata
+#define GC02M1B_OTP_SHORT_MAX		16
+#define GC02M1B_OTP_START_ADDR		0x3D00
+#define GC02M1B_OTP_END_ADDR		0x3D0F
+#define GC02M1B_OTP_DATA_SIZE		320
+#define GC02M1B_OTP_PROGRAM_REG      	0x3D80
+#define GC02M1B_OTP_READ_REG		0x3D81	// 1:Enable 0:disable
+#define GC02M1B_OTP_BANK_REG		0x3D84	//otp bank and mode
+#define GC02M1B_OTP_READY_REG_DONE	1
+#define GC02M1B_OTP_BANK_MAX		28
+#define GC02M1B_OTP_BANK_SIZE		16	//16 bytes per bank
+#define GC02M1B_OTP_READ_ONETIME		16
+#define GC02M1B_OTP_MODE_READ		1
+
+typedef enum GC02M1B_EXPOSURE_SETTING_e {
+	GC02M1B_ANALOG_GAIN = 1 << 0,
+	GC02M1B_INTEGRATION_TIME = 1 << 1,
+	GC02M1B_DIGITAL_GAIN = 1 << 2,
+}GC02M1B_EXPOSURE_SETTING_t;
+
+#if 0
+struct regval_list {
+	u16 reg_num;
+	u8 value;
+};
+
+struct gc02m1b_resolution {
+	u8 *desc;
+	const struct gc02m1b_reg *regs;
+	int res;
+	int width;
+	int height;
+	int fps;
+	int pix_clk_freq;
+	u16 pixels_per_line;
+	u16 lines_per_frame;
+	u8 bin_factor_x;
+	u8 bin_factor_y;
+	u8 bin_mode;
+	bool used;
+};
+
+struct gc02m1b_format {
+	u8 *desc;
+	u32 pixelformat;
+	struct gc02m1b_reg *regs;
+};
+
+enum vcm_type {
+	VCM_UNKNOWN,
+	VCM_AD5823,
+	VCM_DW9714,
+};
+
+/*
+ * gc02m1b device structure.
+ */
+struct gc02m1b_device {
+	struct v4l2_subdev sd;
+	struct media_pad pad;
+	struct v4l2_mbus_framefmt format;
+	struct mutex input_lock;
+	struct v4l2_ctrl_handler ctrl_handler;
+
+	struct camera_sensor_platform_data *platform_data;
+	struct timespec timestamp_t_focus_abs;
+	int vt_pix_clk_freq_mhz;
+	int fmt_idx;
+	int run_mode;
+	int otp_size;
+	u8 *otp_data;
+	u32 focus;
+	s16 number_of_steps;
+	u8 res;
+	u8 type;
+	bool vcm_update;
+	enum vcm_type vcm;
+};
+
+enum gc02m1b_tok_type {
+	GC02M1B_8BIT  = 0x0001,
+	GC02M1B_16BIT = 0x0002,
+	GC02M1B_32BIT = 0x0004,
+	GC02M1B_TOK_TERM   = 0xf000,	/* terminating token for reg list */
+	GC02M1B_TOK_DELAY  = 0xfe00,	/* delay token for reg list */
+	GC02M1B_TOK_MASK = 0xfff0
+};
+
+/**
+ * struct gc02m1b_reg - MI sensor  register format
+ * @type: type of the register
+ * @reg: 16-bit offset to register
+ * @val: 8/16/32-bit register value
+ *
+ * Define a structure for sensor register initialization values
+ */
+struct gc02m1b_reg {
+	enum gc02m1b_tok_type type;
+	u16 reg;
+	u32 val;	/* @set value for read/mod/write, @mask */
+};
+
+#define to_gc02m1b_sensor(x) container_of(x, struct gc02m1b_device, sd)
+
+#define GC02M1B_MAX_WRITE_BUF_SIZE	30
+
+struct gc02m1b_write_buffer {
+	u16 addr;
+	u8 data[GC02M1B_MAX_WRITE_BUF_SIZE];
+};
+
+struct gc02m1b_write_ctrl {
+	int index;
+	struct gc02m1b_write_buffer buffer;
+};
+
+static const struct i2c_device_id gc02m1b_id[] = {
+	{GC02M1B_NAME, 0},
+	{}
+};
+
+static struct gc02m1b_reg const gc02m1b_global_setting[] = {
+	{GC02M1B_8BIT, 0x0103, 0x01},
+	{GC02M1B_8BIT, 0x3001, 0x0a},
+	{GC02M1B_8BIT, 0x3002, 0x80},
+	{GC02M1B_8BIT, 0x3006, 0x00},
+	{GC02M1B_8BIT, 0x3011, 0x21},
+	{GC02M1B_8BIT, 0x3012, 0x09},
+	{GC02M1B_8BIT, 0x3013, 0x10},
+	{GC02M1B_8BIT, 0x3014, 0x00},
+	{GC02M1B_8BIT, 0x3015, 0x08},
+	{GC02M1B_8BIT, 0x3016, 0xf0},
+	{GC02M1B_8BIT, 0x3017, 0xf0},
+	{GC02M1B_8BIT, 0x3018, 0xf0},
+	{GC02M1B_8BIT, 0x301b, 0xb4},
+	{GC02M1B_8BIT, 0x301d, 0x02},
+	{GC02M1B_8BIT, 0x3021, 0x00},
+	{GC02M1B_8BIT, 0x3022, 0x01},
+	{GC02M1B_8BIT, 0x3028, 0x44},
+	{GC02M1B_8BIT, 0x3098, 0x02},
+	{GC02M1B_8BIT, 0x3099, 0x19},
+	{GC02M1B_8BIT, 0x309a, 0x02},
+	{GC02M1B_8BIT, 0x309b, 0x01},
+	{GC02M1B_8BIT, 0x309c, 0x00},
+	{GC02M1B_8BIT, 0x30a0, 0xd2},
+	{GC02M1B_8BIT, 0x30a2, 0x01},
+	{GC02M1B_8BIT, 0x30b2, 0x00},
+	{GC02M1B_8BIT, 0x30b3, 0x7d},
+	{GC02M1B_8BIT, 0x30b4, 0x03},
+	{GC02M1B_8BIT, 0x30b5, 0x04},
+	{GC02M1B_8BIT, 0x30b6, 0x01},
+	{GC02M1B_8BIT, 0x3104, 0x21},
+	{GC02M1B_8BIT, 0x3106, 0x00},
+	{GC02M1B_8BIT, 0x3400, 0x04},
+	{GC02M1B_8BIT, 0x3401, 0x00},
+	{GC02M1B_8BIT, 0x3402, 0x04},
+	{GC02M1B_8BIT, 0x3403, 0x00},
+	{GC02M1B_8BIT, 0x3404, 0x04},
+	{GC02M1B_8BIT, 0x3405, 0x00},
+	{GC02M1B_8BIT, 0x3406, 0x01},
+	{GC02M1B_8BIT, 0x3500, 0x00},
+	{GC02M1B_8BIT, 0x3503, 0x07},
+	{GC02M1B_8BIT, 0x3504, 0x00},
+	{GC02M1B_8BIT, 0x3505, 0x00},
+	{GC02M1B_8BIT, 0x3506, 0x00},
+	{GC02M1B_8BIT, 0x3507, 0x02},
+	{GC02M1B_8BIT, 0x3508, 0x00},
+	{GC02M1B_8BIT, 0x3509, 0x10},
+	{GC02M1B_8BIT, 0x350a, 0x00},
+	{GC02M1B_8BIT, 0x350b, 0x40},
+	{GC02M1B_8BIT, 0x3601, 0x0a},
+	{GC02M1B_8BIT, 0x3602, 0x38},
+	{GC02M1B_8BIT, 0x3612, 0x80},
+	{GC02M1B_8BIT, 0x3620, 0x54},
+	{GC02M1B_8BIT, 0x3621, 0xc7},
+	{GC02M1B_8BIT, 0x3622, 0x0f},
+	{GC02M1B_8BIT, 0x3625, 0x10},
+	{GC02M1B_8BIT, 0x3630, 0x55},
+	{GC02M1B_8BIT, 0x3631, 0xf4},
+	{GC02M1B_8BIT, 0x3632, 0x00},
+	{GC02M1B_8BIT, 0x3633, 0x34},
+	{GC02M1B_8BIT, 0x3634, 0x02},
+	{GC02M1B_8BIT, 0x364d, 0x0d},
+	{GC02M1B_8BIT, 0x364f, 0xdd},
+	{GC02M1B_8BIT, 0x3660, 0x04},
+	{GC02M1B_8BIT, 0x3662, 0x10},
+	{GC02M1B_8BIT, 0x3663, 0xf1},
+	{GC02M1B_8BIT, 0x3665, 0x00},
+	{GC02M1B_8BIT, 0x3666, 0x20},
+	{GC02M1B_8BIT, 0x3667, 0x00},
+	{GC02M1B_8BIT, 0x366a, 0x80},
+	{GC02M1B_8BIT, 0x3680, 0xe0},
+	{GC02M1B_8BIT, 0x3681, 0x00},
+	{GC02M1B_8BIT, 0x3700, 0x42},
+	{GC02M1B_8BIT, 0x3701, 0x14},
+	{GC02M1B_8BIT, 0x3702, 0xa0},
+	{GC02M1B_8BIT, 0x3703, 0xd8},
+	{GC02M1B_8BIT, 0x3704, 0x78},
+	{GC02M1B_8BIT, 0x3705, 0x02},
+	{GC02M1B_8BIT, 0x370a, 0x00},
+	{GC02M1B_8BIT, 0x370b, 0x20},
+	{GC02M1B_8BIT, 0x370c, 0x0c},
+	{GC02M1B_8BIT, 0x370d, 0x11},
+	{GC02M1B_8BIT, 0x370e, 0x00},
+	{GC02M1B_8BIT, 0x370f, 0x40},
+	{GC02M1B_8BIT, 0x3710, 0x00},
+	{GC02M1B_8BIT, 0x371a, 0x1c},
+	{GC02M1B_8BIT, 0x371b, 0x05},
+	{GC02M1B_8BIT, 0x371c, 0x01},
+	{GC02M1B_8BIT, 0x371e, 0xa1},
+	{GC02M1B_8BIT, 0x371f, 0x0c},
+	{GC02M1B_8BIT, 0x3721, 0x00},
+	{GC02M1B_8BIT, 0x3724, 0x10},
+	{GC02M1B_8BIT, 0x3726, 0x00},
+	{GC02M1B_8BIT, 0x372a, 0x01},
+	{GC02M1B_8BIT, 0x3730, 0x10},
+	{GC02M1B_8BIT, 0x3738, 0x22},
+	{GC02M1B_8BIT, 0x3739, 0xe5},
+	{GC02M1B_8BIT, 0x373a, 0x50},
+	{GC02M1B_8BIT, 0x373b, 0x02},
+	{GC02M1B_8BIT, 0x373c, 0x41},
+	{GC02M1B_8BIT, 0x373f, 0x02},
+	{GC02M1B_8BIT, 0x3740, 0x42},
+	{GC02M1B_8BIT, 0x3741, 0x02},
+	{GC02M1B_8BIT, 0x3742, 0x18},
+	{GC02M1B_8BIT, 0x3743, 0x01},
+	{GC02M1B_8BIT, 0x3744, 0x02},
+	{GC02M1B_8BIT, 0x3747, 0x10},
+	{GC02M1B_8BIT, 0x374c, 0x04},
+	{GC02M1B_8BIT, 0x3751, 0xf0},
+	{GC02M1B_8BIT, 0x3752, 0x00},
+	{GC02M1B_8BIT, 0x3753, 0x00},
+	{GC02M1B_8BIT, 0x3754, 0xc0},
+	{GC02M1B_8BIT, 0x3755, 0x00},
+	{GC02M1B_8BIT, 0x3756, 0x1a},
+	{GC02M1B_8BIT, 0x3758, 0x00},
+	{GC02M1B_8BIT, 0x3759, 0x0f},
+	{GC02M1B_8BIT, 0x376b, 0x44},
+	{GC02M1B_8BIT, 0x375c, 0x04},
+	{GC02M1B_8BIT, 0x3774, 0x10},
+	{GC02M1B_8BIT, 0x3776, 0x00},
+	{GC02M1B_8BIT, 0x377f, 0x08},
+	{GC02M1B_8BIT, 0x3780, 0x22},
+	{GC02M1B_8BIT, 0x3781, 0x0c},
+	{GC02M1B_8BIT, 0x3784, 0x2c},
+	{GC02M1B_8BIT, 0x3785, 0x1e},
+	{GC02M1B_8BIT, 0x378f, 0xf5},
+	{GC02M1B_8BIT, 0x3791, 0xb0},
+	{GC02M1B_8BIT, 0x3795, 0x00},
+	{GC02M1B_8BIT, 0x3796, 0x64},
+	{GC02M1B_8BIT, 0x3797, 0x11},
+	{GC02M1B_8BIT, 0x3798, 0x30},
+	{GC02M1B_8BIT, 0x3799, 0x41},
+	{GC02M1B_8BIT, 0x379a, 0x07},
+	{GC02M1B_8BIT, 0x379b, 0xb0},
+	{GC02M1B_8BIT, 0x379c, 0x0c},
+	{GC02M1B_8BIT, 0x37c5, 0x00},
+	{GC02M1B_8BIT, 0x37c6, 0x00},
+	{GC02M1B_8BIT, 0x37c7, 0x00},
+	{GC02M1B_8BIT, 0x37c9, 0x00},
+	{GC02M1B_8BIT, 0x37ca, 0x00},
+	{GC02M1B_8BIT, 0x37cb, 0x00},
+	{GC02M1B_8BIT, 0x37de, 0x00},
+	{GC02M1B_8BIT, 0x37df, 0x00},
+	{GC02M1B_8BIT, 0x3800, 0x00},
+	{GC02M1B_8BIT, 0x3801, 0x00},
+	{GC02M1B_8BIT, 0x3802, 0x00},
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3810, 0x00},
+	{GC02M1B_8BIT, 0x3812, 0x00},
+	{GC02M1B_8BIT, 0x3823, 0x00},
+	{GC02M1B_8BIT, 0x3824, 0x00},
+	{GC02M1B_8BIT, 0x3825, 0x00},
+	{GC02M1B_8BIT, 0x3826, 0x00},
+	{GC02M1B_8BIT, 0x3827, 0x00},
+	{GC02M1B_8BIT, 0x382a, 0x04},
+	{GC02M1B_8BIT, 0x3a04, 0x06},
+	{GC02M1B_8BIT, 0x3a05, 0x14},
+	{GC02M1B_8BIT, 0x3a06, 0x00},
+	{GC02M1B_8BIT, 0x3a07, 0xfe},
+	{GC02M1B_8BIT, 0x3b00, 0x00},
+	{GC02M1B_8BIT, 0x3b02, 0x00},
+	{GC02M1B_8BIT, 0x3b03, 0x00},
+	{GC02M1B_8BIT, 0x3b04, 0x00},
+	{GC02M1B_8BIT, 0x3b05, 0x00},
+	{GC02M1B_8BIT, 0x3e07, 0x20},
+	{GC02M1B_8BIT, 0x4000, 0x08},
+	{GC02M1B_8BIT, 0x4001, 0x04},
+	{GC02M1B_8BIT, 0x4002, 0x45},
+	{GC02M1B_8BIT, 0x4004, 0x08},
+	{GC02M1B_8BIT, 0x4005, 0x18},
+	{GC02M1B_8BIT, 0x4006, 0x20},
+	{GC02M1B_8BIT, 0x4008, 0x24},
+	{GC02M1B_8BIT, 0x4009, 0x10},
+	{GC02M1B_8BIT, 0x400c, 0x00},
+	{GC02M1B_8BIT, 0x400d, 0x00},
+	{GC02M1B_8BIT, 0x4058, 0x00},
+	{GC02M1B_8BIT, 0x404e, 0x37},
+	{GC02M1B_8BIT, 0x404f, 0x8f},
+	{GC02M1B_8BIT, 0x4058, 0x00},
+	{GC02M1B_8BIT, 0x4101, 0xb2},
+	{GC02M1B_8BIT, 0x4303, 0x00},
+	{GC02M1B_8BIT, 0x4304, 0x08},
+	{GC02M1B_8BIT, 0x4307, 0x31},
+	{GC02M1B_8BIT, 0x4311, 0x04},
+	{GC02M1B_8BIT, 0x4315, 0x01},
+	{GC02M1B_8BIT, 0x4511, 0x05},
+	{GC02M1B_8BIT, 0x4512, 0x01},
+	{GC02M1B_8BIT, 0x4806, 0x00},
+	{GC02M1B_8BIT, 0x4816, 0x52},
+	{GC02M1B_8BIT, 0x481f, 0x30},
+	{GC02M1B_8BIT, 0x4826, 0x2c},
+	{GC02M1B_8BIT, 0x4831, 0x64},
+	{GC02M1B_8BIT, 0x4d00, 0x04},
+	{GC02M1B_8BIT, 0x4d01, 0x71},
+	{GC02M1B_8BIT, 0x4d02, 0xfd},
+	{GC02M1B_8BIT, 0x4d03, 0xf5},
+	{GC02M1B_8BIT, 0x4d04, 0x0c},
+	{GC02M1B_8BIT, 0x4d05, 0xcc},
+	{GC02M1B_8BIT, 0x4837, 0x0a},
+	{GC02M1B_8BIT, 0x5000, 0x06},
+	{GC02M1B_8BIT, 0x5001, 0x01},
+	{GC02M1B_8BIT, 0x5003, 0x20},
+	{GC02M1B_8BIT, 0x5046, 0x0a},
+	{GC02M1B_8BIT, 0x5013, 0x00},
+	{GC02M1B_8BIT, 0x5046, 0x0a},
+	{GC02M1B_8BIT, 0x5780, 0x1c},
+	{GC02M1B_8BIT, 0x5786, 0x20},
+	{GC02M1B_8BIT, 0x5787, 0x10},
+	{GC02M1B_8BIT, 0x5788, 0x18},
+	{GC02M1B_8BIT, 0x578a, 0x04},
+	{GC02M1B_8BIT, 0x578b, 0x02},
+	{GC02M1B_8BIT, 0x578c, 0x02},
+	{GC02M1B_8BIT, 0x578e, 0x06},
+	{GC02M1B_8BIT, 0x578f, 0x02},
+	{GC02M1B_8BIT, 0x5790, 0x02},
+	{GC02M1B_8BIT, 0x5791, 0xff},
+	{GC02M1B_8BIT, 0x5842, 0x01},
+	{GC02M1B_8BIT, 0x5843, 0x2b},
+	{GC02M1B_8BIT, 0x5844, 0x01},
+	{GC02M1B_8BIT, 0x5845, 0x92},
+	{GC02M1B_8BIT, 0x5846, 0x01},
+	{GC02M1B_8BIT, 0x5847, 0x8f},
+	{GC02M1B_8BIT, 0x5848, 0x01},
+	{GC02M1B_8BIT, 0x5849, 0x0c},
+	{GC02M1B_8BIT, 0x5e00, 0x00},
+	{GC02M1B_8BIT, 0x5e10, 0x0c},
+	{GC02M1B_8BIT, 0x0100, 0x00},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 654x496 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct gc02m1b_reg const gc02m1b_654x496[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3d},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe6},
+	{GC02M1B_8BIT, 0x3709, 0xc7},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xa3},
+	{GC02M1B_8BIT, 0x3808, 0x02},
+	{GC02M1B_8BIT, 0x3809, 0x90},
+	{GC02M1B_8BIT, 0x380a, 0x01},
+	{GC02M1B_8BIT, 0x380b, 0xf0},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x08},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x04},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+*DS from 2592x1952
+*/
+static struct gc02m1b_reg const gc02m1b_1296x976[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+
+	{GC02M1B_8BIT, 0x3800, 0x00},
+	{GC02M1B_8BIT, 0x3801, 0x00},
+	{GC02M1B_8BIT, 0x3802, 0x00},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xA3},
+
+	{GC02M1B_8BIT, 0x3808, 0x05},
+	{GC02M1B_8BIT, 0x3809, 0x10},
+	{GC02M1B_8BIT, 0x380a, 0x03},
+	{GC02M1B_8BIT, 0x380b, 0xD0},
+
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+
+	{GC02M1B_8BIT, 0x3810, 0x00},
+	{GC02M1B_8BIT, 0x3811, 0x10},
+	{GC02M1B_8BIT, 0x3812, 0x00},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+
+	{GC02M1B_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC02M1B_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+
+};
+
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2564x1956
+ */
+static struct gc02m1b_reg const gc02m1b_336x256[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3d},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe6},
+	{GC02M1B_8BIT, 0x3709, 0xc7},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xa3},
+	{GC02M1B_8BIT, 0x3808, 0x01},
+	{GC02M1B_8BIT, 0x3809, 0x50},
+	{GC02M1B_8BIT, 0x380a, 0x01},
+	{GC02M1B_8BIT, 0x380b, 0x00},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x1E},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x04},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2368x1956
+ */
+static struct gc02m1b_reg const gc02m1b_368x304[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3d},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe6},
+	{GC02M1B_8BIT, 0x3709, 0xc7},
+	{GC02M1B_8BIT, 0x3808, 0x01},
+	{GC02M1B_8BIT, 0x3809, 0x70},
+	{GC02M1B_8BIT, 0x380a, 0x01},
+	{GC02M1B_8BIT, 0x380b, 0x30},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x80},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x04},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * gc02m1b_192x160 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2460x1956
+ */
+static struct gc02m1b_reg const gc02m1b_192x160[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x80},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xA3},
+	{GC02M1B_8BIT, 0x3808, 0x00},
+	{GC02M1B_8BIT, 0x3809, 0xC0},
+	{GC02M1B_8BIT, 0x380a, 0x00},
+	{GC02M1B_8BIT, 0x380b, 0xA0},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x40},
+	{GC02M1B_8BIT, 0x3813, 0x00},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x04},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+
+static struct gc02m1b_reg const gc02m1b_736x496[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3d},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe6},
+	{GC02M1B_8BIT, 0x3709, 0xc7},
+	{GC02M1B_8BIT, 0x3803, 0x68},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0x3b},
+	{GC02M1B_8BIT, 0x3808, 0x02},
+	{GC02M1B_8BIT, 0x3809, 0xe0},
+	{GC02M1B_8BIT, 0x380a, 0x01},
+	{GC02M1B_8BIT, 0x380b, 0xf0},
+	{GC02M1B_8BIT, 0x380c, 0x0a}, /*hts*/
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07}, /*vts*/
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x08},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x04},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+static struct gc02m1b_reg const gc02m1b_736x496[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe6},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xa3},
+	{GC02M1B_8BIT, 0x3808, 0x02},
+	{GC02M1B_8BIT, 0x3809, 0xe0},
+	{GC02M1B_8BIT, 0x380a, 0x01},
+	{GC02M1B_8BIT, 0x380b, 0xf0},
+	{GC02M1B_8BIT, 0x380c, 0x0d},
+	{GC02M1B_8BIT, 0x380d, 0xb0},
+	{GC02M1B_8BIT, 0x380e, 0x05},
+	{GC02M1B_8BIT, 0x380f, 0xf2},
+	{GC02M1B_8BIT, 0x3811, 0x08},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x31},
+	{GC02M1B_8BIT, 0x3815, 0x31},
+	{GC02M1B_8BIT, 0x3820, 0x01},
+	{GC02M1B_8BIT, 0x3821, 0x1f},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+*/
+/*
+ * 976x556 30fps 8.8ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct gc02m1b_reg const gc02m1b_976x556[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0xf0},
+	{GC02M1B_8BIT, 0x3806, 0x06},
+	{GC02M1B_8BIT, 0x3807, 0xa7},
+	{GC02M1B_8BIT, 0x3808, 0x03},
+	{GC02M1B_8BIT, 0x3809, 0xd0},
+	{GC02M1B_8BIT, 0x380a, 0x02},
+	{GC02M1B_8BIT, 0x380b, 0x2C},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x10},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*DS from 2624x1492*/
+static struct gc02m1b_reg const gc02m1b_1296x736[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+
+	{GC02M1B_8BIT, 0x3800, 0x00},
+	{GC02M1B_8BIT, 0x3801, 0x00},
+	{GC02M1B_8BIT, 0x3802, 0x00},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xA3},
+
+	{GC02M1B_8BIT, 0x3808, 0x05},
+	{GC02M1B_8BIT, 0x3809, 0x10},
+	{GC02M1B_8BIT, 0x380a, 0x02},
+	{GC02M1B_8BIT, 0x380b, 0xe0},
+
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+
+	{GC02M1B_8BIT, 0x3813, 0xE8},
+
+	{GC02M1B_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC02M1B_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+static struct gc02m1b_reg const gc02m1b_1636p_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0xf0},
+	{GC02M1B_8BIT, 0x3806, 0x06},
+	{GC02M1B_8BIT, 0x3807, 0xa7},
+	{GC02M1B_8BIT, 0x3808, 0x06},
+	{GC02M1B_8BIT, 0x3809, 0x64},
+	{GC02M1B_8BIT, 0x380a, 0x04},
+	{GC02M1B_8BIT, 0x380b, 0x48},
+	{GC02M1B_8BIT, 0x380c, 0x0a}, /*hts*/
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07}, /*vts*/
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x02},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+static struct gc02m1b_reg const gc02m1b_1616x1216_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x80},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3800, 0x00},	/*{3800,3801} Array X start*/
+	{GC02M1B_8BIT, 0x3801, 0x08},	/* 04 //{3800,3801} Array X start*/
+	{GC02M1B_8BIT, 0x3802, 0x00},	/*{3802,3803} Array Y start*/
+	{GC02M1B_8BIT, 0x3803, 0x04},	/* 00  //{3802,3803} Array Y start*/
+	{GC02M1B_8BIT, 0x3804, 0x0a},	/*{3804,3805} Array X end*/
+	{GC02M1B_8BIT, 0x3805, 0x37},	/* 3b  //{3804,3805} Array X end*/
+	{GC02M1B_8BIT, 0x3806, 0x07},	/*{3806,3807} Array Y end*/
+	{GC02M1B_8BIT, 0x3807, 0x9f},	/* a3  //{3806,3807} Array Y end*/
+	{GC02M1B_8BIT, 0x3808, 0x06},	/*{3808,3809} Final output H size*/
+	{GC02M1B_8BIT, 0x3809, 0x50},	/*{3808,3809} Final output H size*/
+	{GC02M1B_8BIT, 0x380a, 0x04},	/*{380a,380b} Final output V size*/
+	{GC02M1B_8BIT, 0x380b, 0xc0},	/*{380a,380b} Final output V size*/
+	{GC02M1B_8BIT, 0x380c, 0x0a},	/*{380c,380d} HTS*/
+	{GC02M1B_8BIT, 0x380d, 0x80},	/*{380c,380d} HTS*/
+	{GC02M1B_8BIT, 0x380e, 0x07},	/*{380e,380f} VTS*/
+	{GC02M1B_8BIT, 0x380f, 0xc0},	/* bc	//{380e,380f} VTS*/
+	{GC02M1B_8BIT, 0x3810, 0x00},	/*{3810,3811} windowing X offset*/
+	{GC02M1B_8BIT, 0x3811, 0x10},	/*{3810,3811} windowing X offset*/
+	{GC02M1B_8BIT, 0x3812, 0x00},	/*{3812,3813} windowing Y offset*/
+	{GC02M1B_8BIT, 0x3813, 0x06},	/*{3812,3813} windowing Y offset*/
+	{GC02M1B_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC02M1B_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC02M1B_8BIT, 0x3820, 0x00},	/*FLIP/Binnning control*/
+	{GC02M1B_8BIT, 0x3821, 0x1e},	/*MIRROR control*/
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x5041, 0x84},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+
+/*
+ * 1940x1096 30fps 8.8ms VBlanking 2lane 10bit (Scaling)
+ */
+static struct gc02m1b_reg const gc02m1b_1940x1096[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0xf0},
+	{GC02M1B_8BIT, 0x3806, 0x06},
+	{GC02M1B_8BIT, 0x3807, 0xa7},
+	{GC02M1B_8BIT, 0x3808, 0x07},
+	{GC02M1B_8BIT, 0x3809, 0x94},
+	{GC02M1B_8BIT, 0x380a, 0x04},
+	{GC02M1B_8BIT, 0x380b, 0x48},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x02},
+	{GC02M1B_8BIT, 0x3813, 0x02},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x80},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+static struct gc02m1b_reg const gc02m1b_2592x1456_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3800, 0x00},
+	{GC02M1B_8BIT, 0x3801, 0x00},
+	{GC02M1B_8BIT, 0x3802, 0x00},
+	{GC02M1B_8BIT, 0x3803, 0xf0},
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3806, 0x06},
+	{GC02M1B_8BIT, 0x3807, 0xa4},
+	{GC02M1B_8BIT, 0x3808, 0x0a},
+	{GC02M1B_8BIT, 0x3809, 0x20},
+	{GC02M1B_8BIT, 0x380a, 0x05},
+	{GC02M1B_8BIT, 0x380b, 0xb0},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x10},
+	{GC02M1B_8BIT, 0x3813, 0x00},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+static struct gc02m1b_reg const gc02m1b_2576x1456_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3800, 0x00},
+	{GC02M1B_8BIT, 0x3801, 0x00},
+	{GC02M1B_8BIT, 0x3802, 0x00},
+	{GC02M1B_8BIT, 0x3803, 0xf0},
+	{GC02M1B_8BIT, 0x3804, 0x0a},
+	{GC02M1B_8BIT, 0x3805, 0x3f},
+	{GC02M1B_8BIT, 0x3806, 0x06},
+	{GC02M1B_8BIT, 0x3807, 0xa4},
+	{GC02M1B_8BIT, 0x3808, 0x0a},
+	{GC02M1B_8BIT, 0x3809, 0x10},
+	{GC02M1B_8BIT, 0x380a, 0x05},
+	{GC02M1B_8BIT, 0x380b, 0xb0},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x18},
+	{GC02M1B_8BIT, 0x3813, 0x00},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 2592x1944 30fps 0.6ms VBlanking 2lane 10Bit
+ */
+static struct gc02m1b_reg const gc02m1b_2592x1944_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xa3},
+	{GC02M1B_8BIT, 0x3808, 0x0a},
+	{GC02M1B_8BIT, 0x3809, 0x20},
+	{GC02M1B_8BIT, 0x380a, 0x07},
+	{GC02M1B_8BIT, 0x380b, 0x98},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x10},
+	{GC02M1B_8BIT, 0x3813, 0x00},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 11:9 Full FOV Output, expected FOV Res: 2346x1920
+ * ISP Effect Res: 1408x1152
+ * Sensor out: 1424x1168, DS From: 2380x1952
+ *
+ * WA: Left Offset: 8, Hor scal: 64
+ */
+static struct gc02m1b_reg const gc02m1b_1424x1168_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{GC02M1B_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{GC02M1B_8BIT, 0x3801, 0x50}, /* 80 */
+	{GC02M1B_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{GC02M1B_8BIT, 0x3803, 0x02}, /* 2 */
+	{GC02M1B_8BIT, 0x3804, 0x09}, /* TIMING_X_ADDR_END */
+	{GC02M1B_8BIT, 0x3805, 0xdd}, /* 2525 */
+	{GC02M1B_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{GC02M1B_8BIT, 0x3807, 0xa1}, /* 1953 */
+	{GC02M1B_8BIT, 0x3808, 0x05}, /* TIMING_X_OUTPUT_SIZE */
+	{GC02M1B_8BIT, 0x3809, 0x90}, /* 1424 */
+	{GC02M1B_8BIT, 0x380a, 0x04}, /* TIMING_Y_OUTPUT_SIZE */
+	{GC02M1B_8BIT, 0x380b, 0x90}, /* 1168 */
+	{GC02M1B_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{GC02M1B_8BIT, 0x3811, 0x02}, /* 2 */
+	{GC02M1B_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{GC02M1B_8BIT, 0x3813, 0x00}, /* 0 */
+	{GC02M1B_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{GC02M1B_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+/*
+ * 3:2 Full FOV Output, expected FOV Res: 2560x1706
+ * ISP Effect Res: 720x480
+ * Sensor out: 736x496, DS From 2616x1764
+ */
+static struct gc02m1b_reg const gc02m1b_736x496_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{GC02M1B_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{GC02M1B_8BIT, 0x3801, 0x02}, /* 2 */
+	{GC02M1B_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{GC02M1B_8BIT, 0x3803, 0x62}, /* 98 */
+	{GC02M1B_8BIT, 0x3804, 0x0a}, /* TIMING_X_ADDR_END */
+	{GC02M1B_8BIT, 0x3805, 0x3b}, /* 2619 */
+	{GC02M1B_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{GC02M1B_8BIT, 0x3807, 0x43}, /* 1859 */
+	{GC02M1B_8BIT, 0x3808, 0x02}, /* TIMING_X_OUTPUT_SIZE */
+	{GC02M1B_8BIT, 0x3809, 0xe0}, /* 736 */
+	{GC02M1B_8BIT, 0x380a, 0x01}, /* TIMING_Y_OUTPUT_SIZE */
+	{GC02M1B_8BIT, 0x380b, 0xf0}, /* 496 */
+	{GC02M1B_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{GC02M1B_8BIT, 0x3811, 0x02}, /* 2 */
+	{GC02M1B_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{GC02M1B_8BIT, 0x3813, 0x00}, /* 0 */
+	{GC02M1B_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{GC02M1B_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+static struct gc02m1b_reg const gc02m1b_2576x1936_30fps[] = {
+	{GC02M1B_8BIT, 0x3501, 0x7b},
+	{GC02M1B_8BIT, 0x3502, 0x00},
+	{GC02M1B_8BIT, 0x3708, 0xe2},
+	{GC02M1B_8BIT, 0x3709, 0xc3},
+	{GC02M1B_8BIT, 0x3803, 0x00},
+	{GC02M1B_8BIT, 0x3806, 0x07},
+	{GC02M1B_8BIT, 0x3807, 0xa3},
+	{GC02M1B_8BIT, 0x3808, 0x0a},
+	{GC02M1B_8BIT, 0x3809, 0x10},
+	{GC02M1B_8BIT, 0x380a, 0x07},
+	{GC02M1B_8BIT, 0x380b, 0x90},
+	{GC02M1B_8BIT, 0x380c, 0x0a},
+	{GC02M1B_8BIT, 0x380d, 0x80},
+	{GC02M1B_8BIT, 0x380e, 0x07},
+	{GC02M1B_8BIT, 0x380f, 0xc0},
+	{GC02M1B_8BIT, 0x3811, 0x18},
+	{GC02M1B_8BIT, 0x3813, 0x00},
+	{GC02M1B_8BIT, 0x3814, 0x11},
+	{GC02M1B_8BIT, 0x3815, 0x11},
+	{GC02M1B_8BIT, 0x3820, 0x00},
+	{GC02M1B_8BIT, 0x3821, 0x1e},
+	{GC02M1B_8BIT, 0x5002, 0x00},
+	{GC02M1B_8BIT, 0x0100, 0x01},
+	{GC02M1B_TOK_TERM, 0, 0}
+};
+
+struct gc02m1b_resolution gc02m1b_res_preview[] = {
+	{
+		.desc = "gc02m1b_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_736x496_30fps,
+	},
+	{
+		.desc = "gc02m1b_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_1616x1216_30fps,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2576,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2576x1456_30fps,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2576,
+		.height = 1936,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2576x1936_30fps,
+	},
+};
+#define N_RES_PREVIEW (ARRAY_SIZE(gc02m1b_res_preview))
+
+struct gc02m1b_resolution gc02m1b_res_still[] = {
+	{
+		.desc = "gc02m1b_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_736x496_30fps,
+	},
+	{
+		.desc = "gc02m1b_1424x1168_30fps",
+		.width = 1424,
+		.height = 1168,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_1424x1168_30fps,
+	},
+	{
+		.desc = "gc02m1b_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_1616x1216_30fps,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2592x1456_30fps,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2592x1944_30fps,
+	},
+};
+#define N_RES_STILL (ARRAY_SIZE(gc02m1b_res_still))
+
+struct gc02m1b_resolution gc02m1b_res_video[] = {
+	{
+		.desc = "gc02m1b_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc02m1b_736x496,
+	},
+	{
+		.desc = "gc02m1b_336x256_30fps",
+		.width = 336,
+		.height = 256,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc02m1b_336x256,
+	},
+	{
+		.desc = "gc02m1b_368x304_30fps",
+		.width = 368,
+		.height = 304,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc02m1b_368x304,
+	},
+	{
+		.desc = "gc02m1b_192x160_30fps",
+		.width = 192,
+		.height = 160,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc02m1b_192x160,
+	},
+	{
+		.desc = "gc02m1b_1296x736_30fps",
+		.width = 1296,
+		.height = 736,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = gc02m1b_1296x736,
+	},
+	{
+		.desc = "gc02m1b_1296x976_30fps",
+		.width = 1296,
+		.height = 976,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = gc02m1b_1296x976,
+	},
+	{
+		.desc = "gc02m1b_1636P_30fps",
+		.width = 1636,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_1636p_30fps,
+	},
+	{
+		.desc = "gc02m1b_1080P_30fps",
+		.width = 1940,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_1940x1096,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2592x1456_30fps,
+	},
+	{
+		.desc = "gc02m1b_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc02m1b_2592x1944_30fps,
+	},
+};
+
+#define N_RES_VIDEO (ARRAY_SIZE(gc02m1b_res_video))
+
+static struct gc02m1b_resolution *gc02m1b_res = gc02m1b_res_preview;
+static unsigned long N_RES = N_RES_PREVIEW;
+#endif
+#endif

+ 517 - 0
drivers/GC5035/3aconfig_GC5035.json

@@ -0,0 +1,517 @@
+{
+    "root" : [
+        {
+            "classname" : "Aev1",
+            "enable" : false
+        },
+        {
+            "classname" : "Aev2",
+            "enable" : true,
+            "motionThreshold" : 0.5,
+            "roiWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 2.5,
+            "setPoint" : 50,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5
+        },
+        {
+            "classname" : "Aehdr",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "AdaptiveAe",
+            "enable" : false,
+            "motionThreshold" : 0.7,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "targetFilter" : 0.5,
+            "wdrContrast.min" : 10,
+            "wdrContrast.max" : 110,
+            "lowlight" : {
+                "linear_repress" : [1, 0.8, 0.6, 0.4, 0.4],
+                "linear_gain" : [4, 8, 16, 32, 100],
+                "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8],
+                "hdr_gain" : [4, 8, 16, 32, 100]
+            },
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 50
+        },
+        {
+            "classname" : "Awbv2",
+            "enable" : true,
+            "illuorder" : "A, D50, D65, D75, TL84, F12, CWF",
+            "indoor" : [1, 1, 1, 1, 1, 1, 1],
+            "outdoor" : [1, 1, 1, 1, 1, 1, 1],
+            "transition" : [1, 1, 1, 1, 1, 1, 1],
+            "avg" : 0
+        },
+        {
+            "classname" : "IspController",
+            "enable" : true
+        },
+        {
+            "classname" : "AutoHdr",
+            "enable" : false
+        },
+        {
+            "classname" : "DciHist",
+            "enable" : false,
+            "gaussMeanPos" : 64,
+            "gaussSigmaPos" : 128,
+            "gaussAmpPos" : 1,
+            "gaussMeanNeg" : 0,
+            "gaussSigmaNeg" : 128,
+            "gaussAmpNeg" : 1
+        },
+        {
+            "classname" : "SensorController",
+            "enable" : true
+        },
+        {
+            "classname" : "AGamma64",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 915, 930, 946, 961, 977, 992, 1008, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ACproc",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                }
+            ]
+        },
+        {
+            "classname" : "Aee",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1000, 500, 200]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [8000, 8000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1500, 600, 200]
+                }
+            ]
+        },
+        {
+            "classname" : "ACa",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enableCA" : [0, 0, 0, 0, 0, 0],
+                    "enableDCI" : [1, 1, 1, 1, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enableCA" : [0, 0, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ADmsc2",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "demoire_enable" : true,		
+            "demoire_area_thr" : 3,
+            "demoire_sat_shrink" : 5,
+            "demoire_r2" : 256,
+            "demoire_r1" : 0,           
+		    "demoire_t2_shift" : 2,
+            "demoire_t1" : 180,
+            "demoire_edge_r2" : 256,
+            "demoire_edge_r1" : 20,
+            "demoire_edge_t2_shift" : 4,
+            "demoire_edge_t1" :20,	
+            "depurple_enable" : true,		
+            "depurple_red_sat" : true,	
+            "depurple_blue_sat" : true,	
+            "depurple_sat_shrink" : 8,				
+            "depurple_thr" : 8,
+            "skin_enable" : false,			
+            "cb_thr_max_2047" : 10,
+            "cb_thr_min_2047" : 8,
+            "cr_thr_max_2047" : 10,
+            "cr_thr_min_2047" : 8,
+            "y_thr_max_2047" : 10,
+            "y_thr_min_2047" : 8,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [1, 1, 1, 1, 1, 1],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [10, 10, 10, 10, 10, 10],
+                    "facwhite" : [10, 10, 10, 10, 10, 10],
+                    "maxblack" : [20, 20, 20, 20, 20, 20],
+                    "maxwhite" : [20, 20, 20, 20, 20, 20],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],					
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [0, 0, 0, 0, 0, 0],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [200, 200, 100, 50, 20, 20],
+                    "facwhite" : [200, 200, 150, 80, 40, 20],
+                    "maxblack" : [200, 200, 100, 100, 100, 100],
+                    "maxwhite" : [200, 200, 200, 200, 200, 200],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],				
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                }
+            ]
+        },
+        {
+            "classname" : "AWdr4",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : true,
+            "backlight" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                }
+            ],
+            "entropy_slope" : 200,
+            "entropy_base" : 700,
+            "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0],
+            "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023],
+            "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575],
+            "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575],
+            "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575]
+        },
+        {
+            "classname" : "A3dnrv3",
+            "forcecreate" : false,
+            "enable" : false,
+	    "disable" : false,
+            "autonoiseLevel": true,
+            "tnr_en" : false,
+            "nlm_en" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                }
+            ]
+        },
+        {
+            "classname" : "A2dnrv5",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                }
+            ]
+        },
+        {
+            "classname" : "ADpf",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16],
+                    "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16],
+                    "Div" : [65, 65, 65, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ABlc",
+            "forcecreate" : true,
+            "enable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                }
+            ]
+        }
+    ]
+}

+ 35 - 0
drivers/GC5035/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module gc5035)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

File diff suppressed because it is too large
+ 0 - 0
drivers/GC5035/GC5035.c


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035_1280x720.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035_1296x972.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035_1920x1080.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035_2592x1944.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/GC5035/GC5035_640x480.xml


+ 163 - 0
drivers/GC5035/GC5035_mipi2lane_1280x720@30_gc.txt

@@ -0,0 +1,163 @@
+0xfc 0x01 
+0xf4 0x40 
+0xf5 0xe4 
+0xf6 0x14 
+0xf8 0x49 
+0xf9 0x12 
+0xfa 0x01 
+0xfc 0x81 
+0xfe 0x00 
+0x36 0x01 
+0xd3 0x87 
+0x36 0x00 
+0x33 0x20 
+0xfe 0x03 
+0x01 0x87 
+0xf7 0x11 
+0xfc 0x8f 
+0xfc 0x8f 
+0xfc 0x8e 
+0xfe 0x00 
+0xee 0x30 
+0x87 0x18 
+0xfe 0x01 
+0x8c 0x90 
+0xfe 0x00 
+0x03 0x02
+0x04 0x58 
+0x41 0x07
+0x42 0xcc
+0x05 0x02 
+0x06 0xda 
+0x9d 0x0c 
+0x09 0x00
+0x0a 0x04 
+0x0b 0x00
+0x0c 0x03 
+0x0d 0x07 
+0x0e 0xa8 
+0x0f 0x0a 
+0x10 0x30 
+0x11 0x02 
+0x17 0x80 
+0x19 0x05 
+0xfe 0x02
+0x30 0x03 
+0x31 0x03 
+0xfe 0x00
+0xd9 0xc0 
+0x1b 0x20 
+0x21 0x60 
+0x28 0x22 
+0x29 0x30 
+0x44 0x18 
+0x4b 0x10 
+0x4e 0x20 
+0x50 0x11 
+0x52 0x33 
+0x53 0x44 
+0x55 0x10 
+0x5b 0x11 
+0xc5 0x02 
+0x8c 0x20 
+0xfe 0x02
+0x33 0x05 
+0x32 0x38 
+0xfe 0x00
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x16 0x0c
+0x1a 0x1a 
+0x1f 0x19 
+0x20 0x10 
+0x46 0x83 
+0x4a 0x04 
+0x54 0x02 
+0x62 0x00 
+0x72 0x8f 
+0x73 0x89 
+0x7a 0x05 
+0x7d 0xcc 
+0x90 0x00 
+0xce 0x18 
+0xd0 0xb3 
+0xd2 0x40 
+0xe6 0xe0 
+0xfe 0x02
+0x12 0x01 
+0x13 0x01 
+0x14 0x02
+0x15 0x00 
+0x22 0x7c 
+0xfe 0x00
+0xfc 0x88 
+0xfe 0x10 
+0xfe 0x00 
+0xfc 0x8e 
+0xfe 0x00 
+0xfe 0x00 
+0xfe 0x00 
+0xfc 0x88 
+0xfe 0x10 
+0xfe 0x00 
+0xfc 0x8e 
+/*GAIN*/
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+/*ISP*/
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40 
+/*BLK*/
+0xfe 0x01
+0x42 0x21 
+0x49 0x00 
+0x4a 0x01 
+0x4b 0xf8 
+0x55 0x00 
+0xfe 0x01
+0x41 0x28 
+0x4c 0x00 
+0x4d 0x00 
+0x4e 0x06 
+0x44 0x02 
+0x48 0x02 
+0xfe 0x01
+0x91 0x00 
+0x92 0x82 
+0x93 0x00 
+0x94 0x0b 
+0x95 0x02 
+0x96 0xd0 
+0x97 0x05 
+0x98 0x00
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x03
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x06
+0x29 0x03
+0x2a 0x58
+0x2b 0x06
+0xfe 0x01 
+0x8c 0x10 
+0xfe 0x00 
+0x3e 0x91 

+ 257 - 0
drivers/GC5035/GC5035_mipi2lane_1280x720@30_mayi.txt

@@ -0,0 +1,257 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe4
+0xf6 0x14
+0xf8 0x49
+0xf9 0x12
+0xfa 0x01
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x20
+0xfe 0x03
+0x01 0x87
+0xf7 0x11
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x60
+0x29 0x30
+0x44 0x18
+0x4e 0x20
+0x8c 0x20
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x1f 0x19
+0xce 0x18
+0xd0 0xb3
+0xfe 0x02
+0x14 0x02
+0x15 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x00
+0x4a 0x01
+0x4b 0xf8
+0xfe 0x01
+0x4e 0x06
+0x44 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x0a
+0x93 0x00
+0x94 0x0b
+0x95 0x02
+0x96 0xd0
+0x97 0x05
+0x98 0x00
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x22 0x03
+0x26 0x06
+0x29 0x03
+0x2b 0x06
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 257 - 0
drivers/GC5035/GC5035_mipi2lane_1280x720@60_bitland.txt

@@ -0,0 +1,257 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe4
+0xf6 0x14
+0xf8 0x49
+0xf9 0x12
+0xfa 0x01
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x20
+0xfe 0x03
+0x01 0x87
+0xf7 0x11
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x60
+0x29 0x30
+0x44 0x18
+0x4e 0x20
+0x8c 0x20
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x1f 0x19
+0xce 0x18
+0xd0 0xb3
+0xfe 0x02
+0x14 0x02
+0x15 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x00
+0x4a 0x01
+0x4b 0xf8
+0xfe 0x01
+0x4e 0x06
+0x44 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x0a
+0x93 0x00
+0x94 0x0b
+0x95 0x02
+0x96 0xd0
+0x97 0x05
+0x98 0x00
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x22 0x03
+0x26 0x06
+0x29 0x03
+0x2b 0x06
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 262 - 0
drivers/GC5035/GC5035_mipi2lane_1280x720@60_mayi.txt

@@ -0,0 +1,262 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x20
+0xfe 0x03
+0x01 0x87
+0xf7 0x11
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x03
+0x06 0xb4
+0x9d 0x20
+0x09 0x00
+0x0a 0xf4
+0x0b 0x00
+0x0c 0x03
+0x0d 0x05
+0x0e 0xc8
+0x0f 0x0a
+0x10 0x30
+0xd9 0xf8
+0x21 0xe0
+0x29 0x40
+0x44 0x30
+0x4e 0x20
+0x8c 0x20
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x1f 0x19
+0xce 0x18
+0xd0 0xb3
+0xfe 0x02
+0x14 0x02
+0x15 0x00
+0x91 0x00
+0x92 0xf0
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x00
+0x4a 0x01
+0x4b 0xf8
+0xfe 0x01
+0x4e 0x06
+0x44 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x0a
+0x93 0x00
+0x94 0x0b
+0x95 0x02
+0x96 0xd0
+0x97 0x05
+0x98 0x00
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x22 0x03
+0x26 0x06
+0x29 0x03
+0x2b 0x06
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 255 - 0
drivers/GC5035/GC5035_mipi2lane_1296x972@30_bitland.txt

@@ -0,0 +1,255 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe4
+0xf6 0x14
+0xf8 0x49
+0xf9 0x12
+0xfa 0x01
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x20
+0xfe 0x03
+0x01 0x87
+0xf7 0x11
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x60
+0x29 0x30
+0x44 0x18
+0x4e 0x20
+0x8c 0x20
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x1f 0x19
+0xce 0x18
+0xd0 0xb3
+0xfe 0x02
+0x14 0x02
+0x15 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x00
+0x4a 0x01
+0x4b 0xf8
+0xfe 0x01
+0x4e 0x06
+0x44 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x04
+0x93 0x00
+0x94 0x03
+0x95 0x03
+0x96 0xcc
+0x97 0x05
+0x98 0x10
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x22 0x03
+0x26 0x06
+0x29 0x03
+0x2b 0x06
+0xfe 0x01
+0x8c 0x10

+ 257 - 0
drivers/GC5035/GC5035_mipi2lane_1296x972@30_mayi.txt

@@ -0,0 +1,257 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe4
+0xf6 0x14
+0xf8 0x49
+0xf9 0x12
+0xfa 0x01
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x20
+0xfe 0x03
+0x01 0x87
+0xf7 0x11
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x60
+0x29 0x30
+0x44 0x18
+0x4e 0x20
+0x8c 0x20
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x1f 0x19
+0xce 0x18
+0xd0 0xb3
+0xfe 0x02
+0x14 0x02
+0x15 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x00
+0x4a 0x01
+0x4b 0xf8
+0xfe 0x01
+0x4e 0x06
+0x44 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x04
+0x93 0x00
+0x94 0x03
+0x95 0x03
+0x96 0xcc
+0x97 0x05
+0x98 0x10
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x22 0x03
+0x26 0x06
+0x29 0x03
+0x2b 0x06
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 166 - 0
drivers/GC5035/GC5035_mipi2lane_1920x1080@30_gc.txt

@@ -0,0 +1,166 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0x03 0x0b 
+0x04 0xb8 
+0x41 0x07 
+0x42 0xd8 
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0 
+0x1b 0x20 
+0x21 0x48 
+0x28 0x22 
+0x29 0x58 
+0x44 0x20 
+0x4b 0x10 
+0x4e 0x1a 
+0x50 0x11 
+0x52 0x33 
+0x53 0x44 
+0x55 0x10 
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a 
+0xfe 0x02
+0x33 0x05 
+0x32 0x38 
+0xfe 0x00
+0x91 0x80 
+0x92 0x28 
+0x93 0x20 
+0x95 0xa0 
+0x96 0xe0 
+0xd5 0xfc 
+0x97 0x28 
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x01
+0x92 0xb0
+0x93 0x01
+0x94 0x5f
+0x95 0x04
+0x96 0x38
+0x97 0x07
+0x98 0x80
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x03 0x07
+0x04 0x04
+0x41 0x07
+0x42 0xd8
+0xb6 0x11
+0xb1 0x01
+0xb2 0x07

+ 257 - 0
drivers/GC5035/GC5035_mipi2lane_2592x1922@30_bitland.txt

@@ -0,0 +1,257 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x48
+0x29 0x58
+0x44 0x20
+0x4e 0x1a
+0x8c 0x1a
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x1f 0x11
+0xce 0x18
+0xd0 0xb2
+0xfe 0x02
+0x14 0x01
+0x15 0x02
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0xfe 0x01
+0x4e 0x3c
+0x44 0x08
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x22 0x06
+0x26 0x08
+0x29 0x06
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 257 - 0
drivers/GC5035/GC5035_mipi2lane_2592x1922@30_mayi.txt

@@ -0,0 +1,257 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0
+0x1b 0x20
+0x21 0x48
+0x28 0x22
+0x29 0x58
+0x44 0x20
+0x4b 0x10
+0x4e 0x1a
+0x50 0x11
+0x52 0x33
+0x53 0x44
+0x55 0x10
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a
+0xfe 0x02
+0x33 0x05
+0x32 0x38
+0xfe 0x00
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0x91 0x00
+0x92 0x00
+0x93 0x00
+0x94 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x01
+0xfe 0x00
+0x3e 0x01
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0xfe 0x00
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x21 0x48
+0x29 0x58
+0x44 0x20
+0x4e 0x1a
+0x8c 0x1a
+0x91 0x80
+0x92 0x28
+0x93 0x20
+0x95 0xa0
+0x96 0xe0
+0xd5 0xfc
+0x97 0x28
+0x1f 0x11
+0xce 0x18
+0xd0 0xb2
+0xfe 0x02
+0x14 0x01
+0x15 0x02
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x01
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0xfe 0x01
+0x4e 0x3c
+0x44 0x08
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x22 0x06
+0x26 0x08
+0x29 0x06
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x3e 0x91

+ 166 - 0
drivers/GC5035/GC5035_mipi2lane_2592x1944@30_gc.txt

@@ -0,0 +1,166 @@
+0xfc 0x01
+0xf4 0x40
+0xf5 0xe9
+0xf6 0x14
+0xf8 0x49
+0xf9 0x82
+0xfa 0x00
+0xfc 0x81
+0xfe 0x00
+0x36 0x01
+0xd3 0x87
+0x36 0x00
+0x33 0x00
+0xfe 0x03
+0x01 0xe7
+0xf7 0x01
+0xfc 0x8f
+0xfc 0x8f
+0xfc 0x8e
+0xfe 0x00
+0xee 0x30
+0x87 0x18
+0xfe 0x01
+0x8c 0x90
+0xfe 0x00
+0x03 0x0b 
+0x04 0xb8 
+0x41 0x07 
+0x42 0xd8 
+0x05 0x02
+0x06 0xda
+0x9d 0x0c
+0x09 0x00
+0x0a 0x04
+0x0b 0x00
+0x0c 0x03
+0x0d 0x07
+0x0e 0xa8
+0x0f 0x0a
+0x10 0x30
+0x11 0x02
+0x17 0x80
+0x19 0x05
+0xfe 0x02
+0x30 0x03
+0x31 0x03
+0xfe 0x00
+0xd9 0xc0 
+0x1b 0x20 
+0x21 0x48 
+0x28 0x22 
+0x29 0x58 
+0x44 0x20 
+0x4b 0x10 
+0x4e 0x1a 
+0x50 0x11 
+0x52 0x33 
+0x53 0x44 
+0x55 0x10 
+0x5b 0x11
+0xc5 0x02
+0x8c 0x1a 
+0xfe 0x02
+0x33 0x05 
+0x32 0x38 
+0xfe 0x00
+0x91 0x80 
+0x92 0x28 
+0x93 0x20 
+0x95 0xa0 
+0x96 0xe0 
+0xd5 0xfc 
+0x97 0x28 
+0x16 0x0c
+0x1a 0x1a
+0x1f 0x11
+0x20 0x10
+0x46 0x83
+0x4a 0x04
+0x54 0x02
+0x62 0x00
+0x72 0x8f
+0x73 0x89
+0x7a 0x05
+0x7d 0xcc
+0x90 0x00
+0xce 0x18
+0xd0 0xb2
+0xd2 0x40
+0xe6 0xe0
+0xfe 0x02
+0x12 0x01
+0x13 0x01
+0x14 0x01
+0x15 0x02
+0x22 0x7c
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xfe 0x00
+0xfe 0x00
+0xfc 0x88
+0xfe 0x10
+0xfe 0x00
+0xfc 0x8e
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40
+0xfe 0x01
+0x42 0x21
+0x49 0x03
+0x4a 0xff
+0x4b 0xc0
+0x55 0x00
+0xfe 0x01
+0x41 0x28
+0x4c 0x00
+0x4d 0x00
+0x4e 0x3c
+0x44 0x08
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0x08
+0x93 0x00
+0x94 0x07
+0x95 0x07
+0x96 0x98
+0x97 0x0a
+0x98 0x20
+0x99 0x00
+0xfe 0x03
+0x02 0x57
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x06
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x08
+0x29 0x06
+0x2a 0x58
+0x2b 0x08
+0xfe 0x01
+0x8c 0x10
+0xfe 0x00
+0x03 0x07
+0x04 0x04
+0x41 0x07
+0x42 0xd8
+0xb6 0x11
+0xb1 0x01
+0xb2 0x02

+ 166 - 0
drivers/GC5035/GC5035_mipi2lane_640x480@30_gc.txt

@@ -0,0 +1,166 @@
+0xfc 0x01 
+0xf4 0x40 
+0xf5 0xe4 
+0xf6 0x14 
+0xf8 0x49 
+0xf9 0x12 
+0xfa 0x01 
+0xfc 0x81 
+0xfe 0x00 
+0x36 0x01 
+0xd3 0x87 
+0x36 0x00 
+0x33 0x20 
+0xfe 0x03 
+0x01 0x87 
+0xf7 0x11 
+0xfc 0x8f 
+0xfc 0x8f 
+0xfc 0x8e 
+0xfe 0x00 
+0xee 0x30 
+0x87 0x18 
+0xfe 0x01 
+0x8c 0x90 
+0xfe 0x00 
+0x03 0x02
+0x04 0x58 
+0x41 0x07
+0x42 0xcc
+0x05 0x02 
+0x06 0xda 
+0x9d 0x0c 
+0x09 0x00
+0x0a 0x04 
+0x0b 0x00
+0x0c 0x03 
+0x0d 0x07 
+0x0e 0xa8 
+0x0f 0x0a 
+0x10 0x30 
+0x11 0x02 
+0x17 0x80 
+0x19 0x05 
+0xfe 0x02
+0x30 0x03 
+0x31 0x03 
+0xfe 0x00
+0xd9 0xc0 
+0x1b 0x20 
+0x21 0x60 
+0x28 0x22 
+0x29 0x30 
+0x44 0x18 
+0x4b 0x10 
+0x4e 0x20 
+0x50 0x11 
+0x52 0x33 
+0x53 0x44 
+0x55 0x10 
+0x5b 0x11 
+0xc5 0x02 
+0x8c 0x20 
+0xfe 0x02
+0x33 0x05 
+0x32 0x38 
+0xfe 0x00
+0x91 0x15
+0x92 0x3a
+0x93 0x20
+0x95 0x45
+0x96 0x35
+0xd5 0xf0
+0x97 0x20
+0x16 0x0c
+0x1a 0x1a 
+0x1f 0x19 
+0x20 0x10 
+0x46 0x83
+0x4a 0x04 
+0x54 0x02 
+0x62 0x00 
+0x72 0x8f
+0x73 0x89
+0x7a 0x05 
+0x7d 0xcc 
+0x90 0x00 
+0xce 0x18
+0xd0 0xb3 
+0xd2 0x40 
+0xe6 0xe0 
+0xfe 0x02
+0x12 0x01 
+0x13 0x01 
+0x14 0x02
+0x15 0x00 
+0x22 0x7c 
+0xfe 0x00
+0xfc 0x88 
+0xfe 0x10 
+0xfe 0x00 
+0xfc 0x8e 
+0xfe 0x00 
+0xfe 0x00 
+0xfe 0x00 
+0xfc 0x88 
+0xfe 0x10 
+0xfe 0x00 
+0xfc 0x8e 
+0xfe 0x00
+0xb0 0x6e
+0xb1 0x01
+0xb2 0x00
+0xb3 0x00
+0xb4 0x00
+0xb6 0x00
+0xfe 0x01
+0x53 0x00
+0x89 0x03
+0x60 0x40 
+0xfe 0x01
+0x42 0x21 
+0x49 0x00 
+0x4a 0x01 
+0x4b 0xf8 
+0x55 0x00 
+0xfe 0x01
+0x41 0x28 
+0x4c 0x00 
+0x4d 0x00 
+0x4e 0x06 
+0x44 0x02 
+0x48 0x02
+0xfe 0x01
+0x91 0x00
+0x92 0xF6
+0x93 0x01
+0x94 0x48
+0x95 0x01
+0x96 0xe0
+0x97 0x02
+0x98 0x80
+0x99 0x00
+0xfe 0x03
+0x02 0x58
+0x03 0xb7
+0x15 0x14
+0x18 0x0f
+0x21 0x22
+0x22 0x03
+0x23 0x48
+0x24 0x12
+0x25 0x28
+0x26 0x06
+0x29 0x03
+0x2a 0x58
+0x2b 0x06
+0xfe 0x01 
+0x8c 0x10
+0xfe 0x00
+0x03 0x07
+0x04 0x04
+0x41 0x07
+0x42 0xd8
+0xb6 0x0e
+0xb1 0x01
+0xb2 0x02

+ 241 - 0
drivers/GC5035/GC5035_priv.h

@@ -0,0 +1,241 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file GC5035_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup gc5035_priv
+ * @{
+ *
+ */
+#ifndef __GC5035_PRIV_H__
+#define __GC5035_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define GC5035_PIDH                         (0x300A)  //R  - Product ID High Byte MSBs
+#define GC5035_PIDL                         (0x300B)  //R  - Product ID Low Byte LSBs
+
+/*****************************************************************************
+ * Default values
+ *****************************************************************************/
+
+ // Make sure that these static settings are reflecting the capabilities defined
+// in IsiGetCapsIss (further dynamic setup may alter these default settings but
+// often does not if there is no choice available).
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define GC5035_PIDH_DEFAULT                        (0x27) //read only
+#define GC5035_PIDL_DEFAULT                        (0x70) //read only
+
+typedef struct GC5035_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    uint32_t              Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurIntegrationTime;
+    float               AecCurVSIntegrationTime;
+    float               AecCurLongIntegrationTime;
+    float               AecCurGain;
+    float               AecCurVSGain;
+    float               AecCurLongGain;
+
+    uint32_t            LastExpLine;
+    uint32_t            LastVsExpLine;
+    uint32_t            LastLongExpLine;
+
+    uint32_t            LastGain;
+    uint32_t            LastVsGain;
+    uint32_t            LastLongGain;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldVsGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldVsIntegrationTime;
+    uint32_t            OldGainHcg;
+    uint32_t            OldAGainHcg;
+    uint32_t            OldGainLcg;
+    uint32_t            OldAGainLcg;
+    int                 subdev;
+    uint8_t             pattern;
+
+    float               CurHdrRatio;
+} GC5035_Context_t;
+
+static RESULT GC5035_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT GC5035_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT GC5035_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT GC5035_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT GC5035_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT GC5035_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT GC5035_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT GC5035_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT GC5035_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT GC5035_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT GC5035_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT GC5035_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT GC5035_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT GC5035_IsiGetVSGainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT GC5035_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT GC5035_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT GC5035_IsiSetVSGainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT GC5035_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT GC5035_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT GC5035_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT GC5035_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT GC5035_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+RESULT GC5035_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT GC5035_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} gc5035priv */
+
+#endif    /* __GC5035PRIV_H__ */
+

+ 1377 - 0
drivers/GC5035/gc5035.h

@@ -0,0 +1,1377 @@
+/*
+ * Support for OmniVision GC5035 5M camera sensor.
+ *
+ * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef __GC5035_H__
+#define __GC5035_H__
+
+#define GC5035_NAME		"gc5035"
+
+#define GC5035_POWER_UP_RETRY_NUM 5
+
+/* Defines for register writes and register array processing */
+#define I2C_MSG_LENGTH		0x2
+#define I2C_RETRY_COUNT		5
+
+#define GC5035_FOCAL_LENGTH_NUM	334	/*3.34mm*/
+#define GC5035_FOCAL_LENGTH_DEM	100
+#define GC5035_F_NUMBER_DEFAULT_NUM	24
+#define GC5035_F_NUMBER_DEM	10
+
+#define MAX_FMTS		1
+
+/* sensor_mode_data read_mode adaptation */
+#define GC5035_READ_MODE_BINNING_ON	0x0400
+#define GC5035_READ_MODE_BINNING_OFF	0x00
+#define GC5035_INTEGRATION_TIME_MARGIN	8
+
+#define GC5035_MAX_EXPOSURE_VALUE	0xFFF1
+#define GC5035_MAX_GAIN_VALUE		0xFF
+
+/*
+ * focal length bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define GC5035_FOCAL_LENGTH_DEFAULT 0x1B70064
+
+/*
+ * current f-number bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define GC5035_F_NUMBER_DEFAULT 0x18000a
+
+/*
+ * f-number range bits definition:
+ * bits 31-24: max f-number numerator
+ * bits 23-16: max f-number denominator
+ * bits 15-8: min f-number numerator
+ * bits 7-0: min f-number denominator
+ */
+#define GC5035_F_NUMBER_RANGE 0x180a180a
+#define GC5035_ID	0x5690
+
+#define GC5035_FINE_INTG_TIME_MIN 0
+#define GC5035_FINE_INTG_TIME_MAX_MARGIN 0
+#define GC5035_COARSE_INTG_TIME_MIN 1
+#define GC5035_COARSE_INTG_TIME_MAX_MARGIN 6
+
+#define GC5035_BIN_FACTOR_MAX 4
+/*
+ * GC5035 System control registers
+ */
+#define GC5035_SW_SLEEP				0x0100
+#define GC5035_SW_RESET				0x0103
+#define GC5035_SW_STREAM			0x0100
+
+#define GC5035_SC_CMMN_CHIP_ID_H		0x300A
+#define GC5035_SC_CMMN_CHIP_ID_L		0x300B
+#define GC5035_SC_CMMN_SCCB_ID			0x300C
+#define GC5035_SC_CMMN_SUB_ID			0x302A /* process, version*/
+/*Bit[7:4] Group control, Bit[3:0] Group ID*/
+#define GC5035_GROUP_ACCESS			0x3208
+/*
+*Bit[3:0] Bit[19:16] of exposure,
+*remaining 16 bits lies in Reg0x3501&Reg0x3502
+*/
+#define GC5035_EXPOSURE_H			0x3500
+#define GC5035_EXPOSURE_M			0x3501
+#define GC5035_EXPOSURE_L			0x3502
+/*Bit[1:0] means Bit[9:8] of gain*/
+#define GC5035_AGC_H				0x350A
+#define GC5035_AGC_L				0x350B /*Bit[7:0] of gain*/
+
+#define GC5035_HORIZONTAL_START_H		0x3800 /*Bit[11:8]*/
+#define GC5035_HORIZONTAL_START_L		0x3801 /*Bit[7:0]*/
+#define GC5035_VERTICAL_START_H			0x3802 /*Bit[11:8]*/
+#define GC5035_VERTICAL_START_L			0x3803 /*Bit[7:0]*/
+#define GC5035_HORIZONTAL_END_H			0x3804 /*Bit[11:8]*/
+#define GC5035_HORIZONTAL_END_L			0x3805 /*Bit[7:0]*/
+#define GC5035_VERTICAL_END_H			0x3806 /*Bit[11:8]*/
+#define GC5035_VERTICAL_END_L			0x3807 /*Bit[7:0]*/
+#define GC5035_HORIZONTAL_OUTPUT_SIZE_H		0x3808 /*Bit[3:0]*/
+#define GC5035_HORIZONTAL_OUTPUT_SIZE_L		0x3809 /*Bit[7:0]*/
+#define GC5035_VERTICAL_OUTPUT_SIZE_H		0x380a /*Bit[3:0]*/
+#define GC5035_VERTICAL_OUTPUT_SIZE_L		0x380b /*Bit[7:0]*/
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define GC5035_TIMING_HTS_H			0x380C
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define GC5035_TIMING_HTS_L			0x380D
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define GC5035_TIMING_VTS_H			0x380e
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define GC5035_TIMING_VTS_L			0x380f
+
+#define GC5035_MWB_RED_GAIN_H			0x3400
+#define GC5035_MWB_GREEN_GAIN_H			0x3402
+#define GC5035_MWB_BLUE_GAIN_H			0x3404
+#define GC5035_MWB_GAIN_MAX			0x0fff
+
+#define GC5035_START_STREAMING			0x01
+#define GC5035_STOP_STREAMING			0x00
+
+#define VCM_ADDR           0x0c
+#define VCM_CODE_MSB       0x04
+
+#define GC5035_INVALID_CONFIG	0xffffffff
+
+#define GC5035_VCM_SLEW_STEP			0x30F0
+#define GC5035_VCM_SLEW_STEP_MAX		0x7
+#define GC5035_VCM_SLEW_STEP_MASK		0x7
+#define GC5035_VCM_CODE				0x30F2
+#define GC5035_VCM_SLEW_TIME			0x30F4
+#define GC5035_VCM_SLEW_TIME_MAX		0xffff
+#define GC5035_VCM_ENABLE			0x8000
+
+#define GC5035_VCM_MAX_FOCUS_NEG       -1023
+#define GC5035_VCM_MAX_FOCUS_POS       1023
+
+#define DLC_ENABLE 1
+#define DLC_DISABLE 0
+#define VCM_PROTECTION_OFF     0xeca3
+#define VCM_PROTECTION_ON      0xdc51
+#define VCM_DEFAULT_S 0x0
+#define vcm_step_s(a) (u8)(a & 0xf)
+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3)
+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104)
+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200)
+#define vcm_val(data, s) (u16)(data << 4 | s)
+#define DIRECT_VCM vcm_dlc_mclk(0, 0)
+
+/* Defines for OTP Data Registers */
+#define GC5035_FRAME_OFF_NUM		0x4202
+#define GC5035_OTP_BYTE_MAX		32	//change to 32 as needed by otpdata
+#define GC5035_OTP_SHORT_MAX		16
+#define GC5035_OTP_START_ADDR		0x3D00
+#define GC5035_OTP_END_ADDR		0x3D0F
+#define GC5035_OTP_DATA_SIZE		320
+#define GC5035_OTP_PROGRAM_REG      	0x3D80
+#define GC5035_OTP_READ_REG		0x3D81	// 1:Enable 0:disable
+#define GC5035_OTP_BANK_REG		0x3D84	//otp bank and mode
+#define GC5035_OTP_READY_REG_DONE	1
+#define GC5035_OTP_BANK_MAX		28
+#define GC5035_OTP_BANK_SIZE		16	//16 bytes per bank
+#define GC5035_OTP_READ_ONETIME		16
+#define GC5035_OTP_MODE_READ		1
+
+typedef enum GC5035_EXPOSURE_SETTING_e {
+	GC5035_ANALOG_GAIN = 1 << 0,
+	GC5035_INTEGRATION_TIME = 1 << 1,
+	GC5035_DIGITAL_GAIN = 1 << 2,
+}GC5035_EXPOSURE_SETTING_t;
+
+#if 0
+struct regval_list {
+	u16 reg_num;
+	u8 value;
+};
+
+struct gc5035_resolution {
+	u8 *desc;
+	const struct gc5035_reg *regs;
+	int res;
+	int width;
+	int height;
+	int fps;
+	int pix_clk_freq;
+	u16 pixels_per_line;
+	u16 lines_per_frame;
+	u8 bin_factor_x;
+	u8 bin_factor_y;
+	u8 bin_mode;
+	bool used;
+};
+
+struct gc5035_format {
+	u8 *desc;
+	u32 pixelformat;
+	struct gc5035_reg *regs;
+};
+
+enum vcm_type {
+	VCM_UNKNOWN,
+	VCM_AD5823,
+	VCM_DW9714,
+};
+
+/*
+ * gc5035 device structure.
+ */
+struct gc5035_device {
+	struct v4l2_subdev sd;
+	struct media_pad pad;
+	struct v4l2_mbus_framefmt format;
+	struct mutex input_lock;
+	struct v4l2_ctrl_handler ctrl_handler;
+
+	struct camera_sensor_platform_data *platform_data;
+	struct timespec timestamp_t_focus_abs;
+	int vt_pix_clk_freq_mhz;
+	int fmt_idx;
+	int run_mode;
+	int otp_size;
+	u8 *otp_data;
+	u32 focus;
+	s16 number_of_steps;
+	u8 res;
+	u8 type;
+	bool vcm_update;
+	enum vcm_type vcm;
+};
+
+enum gc5035_tok_type {
+	GC5035_8BIT  = 0x0001,
+	GC5035_16BIT = 0x0002,
+	GC5035_32BIT = 0x0004,
+	GC5035_TOK_TERM   = 0xf000,	/* terminating token for reg list */
+	GC5035_TOK_DELAY  = 0xfe00,	/* delay token for reg list */
+	GC5035_TOK_MASK = 0xfff0
+};
+
+/**
+ * struct gc5035_reg - MI sensor  register format
+ * @type: type of the register
+ * @reg: 16-bit offset to register
+ * @val: 8/16/32-bit register value
+ *
+ * Define a structure for sensor register initialization values
+ */
+struct gc5035_reg {
+	enum gc5035_tok_type type;
+	u16 reg;
+	u32 val;	/* @set value for read/mod/write, @mask */
+};
+
+#define to_gc5035_sensor(x) container_of(x, struct gc5035_device, sd)
+
+#define GC5035_MAX_WRITE_BUF_SIZE	30
+
+struct gc5035_write_buffer {
+	u16 addr;
+	u8 data[GC5035_MAX_WRITE_BUF_SIZE];
+};
+
+struct gc5035_write_ctrl {
+	int index;
+	struct gc5035_write_buffer buffer;
+};
+
+static const struct i2c_device_id gc5035_id[] = {
+	{GC5035_NAME, 0},
+	{}
+};
+
+static struct gc5035_reg const gc5035_global_setting[] = {
+	{GC5035_8BIT, 0x0103, 0x01},
+	{GC5035_8BIT, 0x3001, 0x0a},
+	{GC5035_8BIT, 0x3002, 0x80},
+	{GC5035_8BIT, 0x3006, 0x00},
+	{GC5035_8BIT, 0x3011, 0x21},
+	{GC5035_8BIT, 0x3012, 0x09},
+	{GC5035_8BIT, 0x3013, 0x10},
+	{GC5035_8BIT, 0x3014, 0x00},
+	{GC5035_8BIT, 0x3015, 0x08},
+	{GC5035_8BIT, 0x3016, 0xf0},
+	{GC5035_8BIT, 0x3017, 0xf0},
+	{GC5035_8BIT, 0x3018, 0xf0},
+	{GC5035_8BIT, 0x301b, 0xb4},
+	{GC5035_8BIT, 0x301d, 0x02},
+	{GC5035_8BIT, 0x3021, 0x00},
+	{GC5035_8BIT, 0x3022, 0x01},
+	{GC5035_8BIT, 0x3028, 0x44},
+	{GC5035_8BIT, 0x3098, 0x02},
+	{GC5035_8BIT, 0x3099, 0x19},
+	{GC5035_8BIT, 0x309a, 0x02},
+	{GC5035_8BIT, 0x309b, 0x01},
+	{GC5035_8BIT, 0x309c, 0x00},
+	{GC5035_8BIT, 0x30a0, 0xd2},
+	{GC5035_8BIT, 0x30a2, 0x01},
+	{GC5035_8BIT, 0x30b2, 0x00},
+	{GC5035_8BIT, 0x30b3, 0x7d},
+	{GC5035_8BIT, 0x30b4, 0x03},
+	{GC5035_8BIT, 0x30b5, 0x04},
+	{GC5035_8BIT, 0x30b6, 0x01},
+	{GC5035_8BIT, 0x3104, 0x21},
+	{GC5035_8BIT, 0x3106, 0x00},
+	{GC5035_8BIT, 0x3400, 0x04},
+	{GC5035_8BIT, 0x3401, 0x00},
+	{GC5035_8BIT, 0x3402, 0x04},
+	{GC5035_8BIT, 0x3403, 0x00},
+	{GC5035_8BIT, 0x3404, 0x04},
+	{GC5035_8BIT, 0x3405, 0x00},
+	{GC5035_8BIT, 0x3406, 0x01},
+	{GC5035_8BIT, 0x3500, 0x00},
+	{GC5035_8BIT, 0x3503, 0x07},
+	{GC5035_8BIT, 0x3504, 0x00},
+	{GC5035_8BIT, 0x3505, 0x00},
+	{GC5035_8BIT, 0x3506, 0x00},
+	{GC5035_8BIT, 0x3507, 0x02},
+	{GC5035_8BIT, 0x3508, 0x00},
+	{GC5035_8BIT, 0x3509, 0x10},
+	{GC5035_8BIT, 0x350a, 0x00},
+	{GC5035_8BIT, 0x350b, 0x40},
+	{GC5035_8BIT, 0x3601, 0x0a},
+	{GC5035_8BIT, 0x3602, 0x38},
+	{GC5035_8BIT, 0x3612, 0x80},
+	{GC5035_8BIT, 0x3620, 0x54},
+	{GC5035_8BIT, 0x3621, 0xc7},
+	{GC5035_8BIT, 0x3622, 0x0f},
+	{GC5035_8BIT, 0x3625, 0x10},
+	{GC5035_8BIT, 0x3630, 0x55},
+	{GC5035_8BIT, 0x3631, 0xf4},
+	{GC5035_8BIT, 0x3632, 0x00},
+	{GC5035_8BIT, 0x3633, 0x34},
+	{GC5035_8BIT, 0x3634, 0x02},
+	{GC5035_8BIT, 0x364d, 0x0d},
+	{GC5035_8BIT, 0x364f, 0xdd},
+	{GC5035_8BIT, 0x3660, 0x04},
+	{GC5035_8BIT, 0x3662, 0x10},
+	{GC5035_8BIT, 0x3663, 0xf1},
+	{GC5035_8BIT, 0x3665, 0x00},
+	{GC5035_8BIT, 0x3666, 0x20},
+	{GC5035_8BIT, 0x3667, 0x00},
+	{GC5035_8BIT, 0x366a, 0x80},
+	{GC5035_8BIT, 0x3680, 0xe0},
+	{GC5035_8BIT, 0x3681, 0x00},
+	{GC5035_8BIT, 0x3700, 0x42},
+	{GC5035_8BIT, 0x3701, 0x14},
+	{GC5035_8BIT, 0x3702, 0xa0},
+	{GC5035_8BIT, 0x3703, 0xd8},
+	{GC5035_8BIT, 0x3704, 0x78},
+	{GC5035_8BIT, 0x3705, 0x02},
+	{GC5035_8BIT, 0x370a, 0x00},
+	{GC5035_8BIT, 0x370b, 0x20},
+	{GC5035_8BIT, 0x370c, 0x0c},
+	{GC5035_8BIT, 0x370d, 0x11},
+	{GC5035_8BIT, 0x370e, 0x00},
+	{GC5035_8BIT, 0x370f, 0x40},
+	{GC5035_8BIT, 0x3710, 0x00},
+	{GC5035_8BIT, 0x371a, 0x1c},
+	{GC5035_8BIT, 0x371b, 0x05},
+	{GC5035_8BIT, 0x371c, 0x01},
+	{GC5035_8BIT, 0x371e, 0xa1},
+	{GC5035_8BIT, 0x371f, 0x0c},
+	{GC5035_8BIT, 0x3721, 0x00},
+	{GC5035_8BIT, 0x3724, 0x10},
+	{GC5035_8BIT, 0x3726, 0x00},
+	{GC5035_8BIT, 0x372a, 0x01},
+	{GC5035_8BIT, 0x3730, 0x10},
+	{GC5035_8BIT, 0x3738, 0x22},
+	{GC5035_8BIT, 0x3739, 0xe5},
+	{GC5035_8BIT, 0x373a, 0x50},
+	{GC5035_8BIT, 0x373b, 0x02},
+	{GC5035_8BIT, 0x373c, 0x41},
+	{GC5035_8BIT, 0x373f, 0x02},
+	{GC5035_8BIT, 0x3740, 0x42},
+	{GC5035_8BIT, 0x3741, 0x02},
+	{GC5035_8BIT, 0x3742, 0x18},
+	{GC5035_8BIT, 0x3743, 0x01},
+	{GC5035_8BIT, 0x3744, 0x02},
+	{GC5035_8BIT, 0x3747, 0x10},
+	{GC5035_8BIT, 0x374c, 0x04},
+	{GC5035_8BIT, 0x3751, 0xf0},
+	{GC5035_8BIT, 0x3752, 0x00},
+	{GC5035_8BIT, 0x3753, 0x00},
+	{GC5035_8BIT, 0x3754, 0xc0},
+	{GC5035_8BIT, 0x3755, 0x00},
+	{GC5035_8BIT, 0x3756, 0x1a},
+	{GC5035_8BIT, 0x3758, 0x00},
+	{GC5035_8BIT, 0x3759, 0x0f},
+	{GC5035_8BIT, 0x376b, 0x44},
+	{GC5035_8BIT, 0x375c, 0x04},
+	{GC5035_8BIT, 0x3774, 0x10},
+	{GC5035_8BIT, 0x3776, 0x00},
+	{GC5035_8BIT, 0x377f, 0x08},
+	{GC5035_8BIT, 0x3780, 0x22},
+	{GC5035_8BIT, 0x3781, 0x0c},
+	{GC5035_8BIT, 0x3784, 0x2c},
+	{GC5035_8BIT, 0x3785, 0x1e},
+	{GC5035_8BIT, 0x378f, 0xf5},
+	{GC5035_8BIT, 0x3791, 0xb0},
+	{GC5035_8BIT, 0x3795, 0x00},
+	{GC5035_8BIT, 0x3796, 0x64},
+	{GC5035_8BIT, 0x3797, 0x11},
+	{GC5035_8BIT, 0x3798, 0x30},
+	{GC5035_8BIT, 0x3799, 0x41},
+	{GC5035_8BIT, 0x379a, 0x07},
+	{GC5035_8BIT, 0x379b, 0xb0},
+	{GC5035_8BIT, 0x379c, 0x0c},
+	{GC5035_8BIT, 0x37c5, 0x00},
+	{GC5035_8BIT, 0x37c6, 0x00},
+	{GC5035_8BIT, 0x37c7, 0x00},
+	{GC5035_8BIT, 0x37c9, 0x00},
+	{GC5035_8BIT, 0x37ca, 0x00},
+	{GC5035_8BIT, 0x37cb, 0x00},
+	{GC5035_8BIT, 0x37de, 0x00},
+	{GC5035_8BIT, 0x37df, 0x00},
+	{GC5035_8BIT, 0x3800, 0x00},
+	{GC5035_8BIT, 0x3801, 0x00},
+	{GC5035_8BIT, 0x3802, 0x00},
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3810, 0x00},
+	{GC5035_8BIT, 0x3812, 0x00},
+	{GC5035_8BIT, 0x3823, 0x00},
+	{GC5035_8BIT, 0x3824, 0x00},
+	{GC5035_8BIT, 0x3825, 0x00},
+	{GC5035_8BIT, 0x3826, 0x00},
+	{GC5035_8BIT, 0x3827, 0x00},
+	{GC5035_8BIT, 0x382a, 0x04},
+	{GC5035_8BIT, 0x3a04, 0x06},
+	{GC5035_8BIT, 0x3a05, 0x14},
+	{GC5035_8BIT, 0x3a06, 0x00},
+	{GC5035_8BIT, 0x3a07, 0xfe},
+	{GC5035_8BIT, 0x3b00, 0x00},
+	{GC5035_8BIT, 0x3b02, 0x00},
+	{GC5035_8BIT, 0x3b03, 0x00},
+	{GC5035_8BIT, 0x3b04, 0x00},
+	{GC5035_8BIT, 0x3b05, 0x00},
+	{GC5035_8BIT, 0x3e07, 0x20},
+	{GC5035_8BIT, 0x4000, 0x08},
+	{GC5035_8BIT, 0x4001, 0x04},
+	{GC5035_8BIT, 0x4002, 0x45},
+	{GC5035_8BIT, 0x4004, 0x08},
+	{GC5035_8BIT, 0x4005, 0x18},
+	{GC5035_8BIT, 0x4006, 0x20},
+	{GC5035_8BIT, 0x4008, 0x24},
+	{GC5035_8BIT, 0x4009, 0x10},
+	{GC5035_8BIT, 0x400c, 0x00},
+	{GC5035_8BIT, 0x400d, 0x00},
+	{GC5035_8BIT, 0x4058, 0x00},
+	{GC5035_8BIT, 0x404e, 0x37},
+	{GC5035_8BIT, 0x404f, 0x8f},
+	{GC5035_8BIT, 0x4058, 0x00},
+	{GC5035_8BIT, 0x4101, 0xb2},
+	{GC5035_8BIT, 0x4303, 0x00},
+	{GC5035_8BIT, 0x4304, 0x08},
+	{GC5035_8BIT, 0x4307, 0x31},
+	{GC5035_8BIT, 0x4311, 0x04},
+	{GC5035_8BIT, 0x4315, 0x01},
+	{GC5035_8BIT, 0x4511, 0x05},
+	{GC5035_8BIT, 0x4512, 0x01},
+	{GC5035_8BIT, 0x4806, 0x00},
+	{GC5035_8BIT, 0x4816, 0x52},
+	{GC5035_8BIT, 0x481f, 0x30},
+	{GC5035_8BIT, 0x4826, 0x2c},
+	{GC5035_8BIT, 0x4831, 0x64},
+	{GC5035_8BIT, 0x4d00, 0x04},
+	{GC5035_8BIT, 0x4d01, 0x71},
+	{GC5035_8BIT, 0x4d02, 0xfd},
+	{GC5035_8BIT, 0x4d03, 0xf5},
+	{GC5035_8BIT, 0x4d04, 0x0c},
+	{GC5035_8BIT, 0x4d05, 0xcc},
+	{GC5035_8BIT, 0x4837, 0x0a},
+	{GC5035_8BIT, 0x5000, 0x06},
+	{GC5035_8BIT, 0x5001, 0x01},
+	{GC5035_8BIT, 0x5003, 0x20},
+	{GC5035_8BIT, 0x5046, 0x0a},
+	{GC5035_8BIT, 0x5013, 0x00},
+	{GC5035_8BIT, 0x5046, 0x0a},
+	{GC5035_8BIT, 0x5780, 0x1c},
+	{GC5035_8BIT, 0x5786, 0x20},
+	{GC5035_8BIT, 0x5787, 0x10},
+	{GC5035_8BIT, 0x5788, 0x18},
+	{GC5035_8BIT, 0x578a, 0x04},
+	{GC5035_8BIT, 0x578b, 0x02},
+	{GC5035_8BIT, 0x578c, 0x02},
+	{GC5035_8BIT, 0x578e, 0x06},
+	{GC5035_8BIT, 0x578f, 0x02},
+	{GC5035_8BIT, 0x5790, 0x02},
+	{GC5035_8BIT, 0x5791, 0xff},
+	{GC5035_8BIT, 0x5842, 0x01},
+	{GC5035_8BIT, 0x5843, 0x2b},
+	{GC5035_8BIT, 0x5844, 0x01},
+	{GC5035_8BIT, 0x5845, 0x92},
+	{GC5035_8BIT, 0x5846, 0x01},
+	{GC5035_8BIT, 0x5847, 0x8f},
+	{GC5035_8BIT, 0x5848, 0x01},
+	{GC5035_8BIT, 0x5849, 0x0c},
+	{GC5035_8BIT, 0x5e00, 0x00},
+	{GC5035_8BIT, 0x5e10, 0x0c},
+	{GC5035_8BIT, 0x0100, 0x00},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 654x496 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct gc5035_reg const gc5035_654x496[] = {
+	{GC5035_8BIT, 0x3501, 0x3d},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe6},
+	{GC5035_8BIT, 0x3709, 0xc7},
+	{GC5035_8BIT, 0x3803, 0x00},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xa3},
+	{GC5035_8BIT, 0x3808, 0x02},
+	{GC5035_8BIT, 0x3809, 0x90},
+	{GC5035_8BIT, 0x380a, 0x01},
+	{GC5035_8BIT, 0x380b, 0xf0},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x08},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x04},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+*DS from 2592x1952
+*/
+static struct gc5035_reg const gc5035_1296x976[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+
+	{GC5035_8BIT, 0x3800, 0x00},
+	{GC5035_8BIT, 0x3801, 0x00},
+	{GC5035_8BIT, 0x3802, 0x00},
+	{GC5035_8BIT, 0x3803, 0x00},
+
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xA3},
+
+	{GC5035_8BIT, 0x3808, 0x05},
+	{GC5035_8BIT, 0x3809, 0x10},
+	{GC5035_8BIT, 0x380a, 0x03},
+	{GC5035_8BIT, 0x380b, 0xD0},
+
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+
+	{GC5035_8BIT, 0x3810, 0x00},
+	{GC5035_8BIT, 0x3811, 0x10},
+	{GC5035_8BIT, 0x3812, 0x00},
+	{GC5035_8BIT, 0x3813, 0x02},
+
+	{GC5035_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC5035_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+
+};
+
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2564x1956
+ */
+static struct gc5035_reg const gc5035_336x256[] = {
+	{GC5035_8BIT, 0x3501, 0x3d},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe6},
+	{GC5035_8BIT, 0x3709, 0xc7},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xa3},
+	{GC5035_8BIT, 0x3808, 0x01},
+	{GC5035_8BIT, 0x3809, 0x50},
+	{GC5035_8BIT, 0x380a, 0x01},
+	{GC5035_8BIT, 0x380b, 0x00},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x1E},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x04},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2368x1956
+ */
+static struct gc5035_reg const gc5035_368x304[] = {
+	{GC5035_8BIT, 0x3501, 0x3d},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe6},
+	{GC5035_8BIT, 0x3709, 0xc7},
+	{GC5035_8BIT, 0x3808, 0x01},
+	{GC5035_8BIT, 0x3809, 0x70},
+	{GC5035_8BIT, 0x380a, 0x01},
+	{GC5035_8BIT, 0x380b, 0x30},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x80},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x04},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * gc5035_192x160 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2460x1956
+ */
+static struct gc5035_reg const gc5035_192x160[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x80},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xA3},
+	{GC5035_8BIT, 0x3808, 0x00},
+	{GC5035_8BIT, 0x3809, 0xC0},
+	{GC5035_8BIT, 0x380a, 0x00},
+	{GC5035_8BIT, 0x380b, 0xA0},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x40},
+	{GC5035_8BIT, 0x3813, 0x00},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x04},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+
+static struct gc5035_reg const gc5035_736x496[] = {
+	{GC5035_8BIT, 0x3501, 0x3d},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe6},
+	{GC5035_8BIT, 0x3709, 0xc7},
+	{GC5035_8BIT, 0x3803, 0x68},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0x3b},
+	{GC5035_8BIT, 0x3808, 0x02},
+	{GC5035_8BIT, 0x3809, 0xe0},
+	{GC5035_8BIT, 0x380a, 0x01},
+	{GC5035_8BIT, 0x380b, 0xf0},
+	{GC5035_8BIT, 0x380c, 0x0a}, /*hts*/
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07}, /*vts*/
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x08},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x04},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+static struct gc5035_reg const gc5035_736x496[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe6},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0x00},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xa3},
+	{GC5035_8BIT, 0x3808, 0x02},
+	{GC5035_8BIT, 0x3809, 0xe0},
+	{GC5035_8BIT, 0x380a, 0x01},
+	{GC5035_8BIT, 0x380b, 0xf0},
+	{GC5035_8BIT, 0x380c, 0x0d},
+	{GC5035_8BIT, 0x380d, 0xb0},
+	{GC5035_8BIT, 0x380e, 0x05},
+	{GC5035_8BIT, 0x380f, 0xf2},
+	{GC5035_8BIT, 0x3811, 0x08},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x31},
+	{GC5035_8BIT, 0x3815, 0x31},
+	{GC5035_8BIT, 0x3820, 0x01},
+	{GC5035_8BIT, 0x3821, 0x1f},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+*/
+/*
+ * 976x556 30fps 8.8ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct gc5035_reg const gc5035_976x556[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0xf0},
+	{GC5035_8BIT, 0x3806, 0x06},
+	{GC5035_8BIT, 0x3807, 0xa7},
+	{GC5035_8BIT, 0x3808, 0x03},
+	{GC5035_8BIT, 0x3809, 0xd0},
+	{GC5035_8BIT, 0x380a, 0x02},
+	{GC5035_8BIT, 0x380b, 0x2C},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x10},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*DS from 2624x1492*/
+static struct gc5035_reg const gc5035_1296x736[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+
+	{GC5035_8BIT, 0x3800, 0x00},
+	{GC5035_8BIT, 0x3801, 0x00},
+	{GC5035_8BIT, 0x3802, 0x00},
+	{GC5035_8BIT, 0x3803, 0x00},
+
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xA3},
+
+	{GC5035_8BIT, 0x3808, 0x05},
+	{GC5035_8BIT, 0x3809, 0x10},
+	{GC5035_8BIT, 0x380a, 0x02},
+	{GC5035_8BIT, 0x380b, 0xe0},
+
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+
+	{GC5035_8BIT, 0x3813, 0xE8},
+
+	{GC5035_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC5035_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+static struct gc5035_reg const gc5035_1636p_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0xf0},
+	{GC5035_8BIT, 0x3806, 0x06},
+	{GC5035_8BIT, 0x3807, 0xa7},
+	{GC5035_8BIT, 0x3808, 0x06},
+	{GC5035_8BIT, 0x3809, 0x64},
+	{GC5035_8BIT, 0x380a, 0x04},
+	{GC5035_8BIT, 0x380b, 0x48},
+	{GC5035_8BIT, 0x380c, 0x0a}, /*hts*/
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07}, /*vts*/
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x02},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+static struct gc5035_reg const gc5035_1616x1216_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x80},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3800, 0x00},	/*{3800,3801} Array X start*/
+	{GC5035_8BIT, 0x3801, 0x08},	/* 04 //{3800,3801} Array X start*/
+	{GC5035_8BIT, 0x3802, 0x00},	/*{3802,3803} Array Y start*/
+	{GC5035_8BIT, 0x3803, 0x04},	/* 00  //{3802,3803} Array Y start*/
+	{GC5035_8BIT, 0x3804, 0x0a},	/*{3804,3805} Array X end*/
+	{GC5035_8BIT, 0x3805, 0x37},	/* 3b  //{3804,3805} Array X end*/
+	{GC5035_8BIT, 0x3806, 0x07},	/*{3806,3807} Array Y end*/
+	{GC5035_8BIT, 0x3807, 0x9f},	/* a3  //{3806,3807} Array Y end*/
+	{GC5035_8BIT, 0x3808, 0x06},	/*{3808,3809} Final output H size*/
+	{GC5035_8BIT, 0x3809, 0x50},	/*{3808,3809} Final output H size*/
+	{GC5035_8BIT, 0x380a, 0x04},	/*{380a,380b} Final output V size*/
+	{GC5035_8BIT, 0x380b, 0xc0},	/*{380a,380b} Final output V size*/
+	{GC5035_8BIT, 0x380c, 0x0a},	/*{380c,380d} HTS*/
+	{GC5035_8BIT, 0x380d, 0x80},	/*{380c,380d} HTS*/
+	{GC5035_8BIT, 0x380e, 0x07},	/*{380e,380f} VTS*/
+	{GC5035_8BIT, 0x380f, 0xc0},	/* bc	//{380e,380f} VTS*/
+	{GC5035_8BIT, 0x3810, 0x00},	/*{3810,3811} windowing X offset*/
+	{GC5035_8BIT, 0x3811, 0x10},	/*{3810,3811} windowing X offset*/
+	{GC5035_8BIT, 0x3812, 0x00},	/*{3812,3813} windowing Y offset*/
+	{GC5035_8BIT, 0x3813, 0x06},	/*{3812,3813} windowing Y offset*/
+	{GC5035_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{GC5035_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{GC5035_8BIT, 0x3820, 0x00},	/*FLIP/Binnning control*/
+	{GC5035_8BIT, 0x3821, 0x1e},	/*MIRROR control*/
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x5041, 0x84},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+
+/*
+ * 1940x1096 30fps 8.8ms VBlanking 2lane 10bit (Scaling)
+ */
+static struct gc5035_reg const gc5035_1940x1096[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0xf0},
+	{GC5035_8BIT, 0x3806, 0x06},
+	{GC5035_8BIT, 0x3807, 0xa7},
+	{GC5035_8BIT, 0x3808, 0x07},
+	{GC5035_8BIT, 0x3809, 0x94},
+	{GC5035_8BIT, 0x380a, 0x04},
+	{GC5035_8BIT, 0x380b, 0x48},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x02},
+	{GC5035_8BIT, 0x3813, 0x02},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x80},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+static struct gc5035_reg const gc5035_2592x1456_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3800, 0x00},
+	{GC5035_8BIT, 0x3801, 0x00},
+	{GC5035_8BIT, 0x3802, 0x00},
+	{GC5035_8BIT, 0x3803, 0xf0},
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3806, 0x06},
+	{GC5035_8BIT, 0x3807, 0xa4},
+	{GC5035_8BIT, 0x3808, 0x0a},
+	{GC5035_8BIT, 0x3809, 0x20},
+	{GC5035_8BIT, 0x380a, 0x05},
+	{GC5035_8BIT, 0x380b, 0xb0},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x10},
+	{GC5035_8BIT, 0x3813, 0x00},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+static struct gc5035_reg const gc5035_2576x1456_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3800, 0x00},
+	{GC5035_8BIT, 0x3801, 0x00},
+	{GC5035_8BIT, 0x3802, 0x00},
+	{GC5035_8BIT, 0x3803, 0xf0},
+	{GC5035_8BIT, 0x3804, 0x0a},
+	{GC5035_8BIT, 0x3805, 0x3f},
+	{GC5035_8BIT, 0x3806, 0x06},
+	{GC5035_8BIT, 0x3807, 0xa4},
+	{GC5035_8BIT, 0x3808, 0x0a},
+	{GC5035_8BIT, 0x3809, 0x10},
+	{GC5035_8BIT, 0x380a, 0x05},
+	{GC5035_8BIT, 0x380b, 0xb0},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x18},
+	{GC5035_8BIT, 0x3813, 0x00},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 2592x1944 30fps 0.6ms VBlanking 2lane 10Bit
+ */
+static struct gc5035_reg const gc5035_2592x1944_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0x00},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xa3},
+	{GC5035_8BIT, 0x3808, 0x0a},
+	{GC5035_8BIT, 0x3809, 0x20},
+	{GC5035_8BIT, 0x380a, 0x07},
+	{GC5035_8BIT, 0x380b, 0x98},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x10},
+	{GC5035_8BIT, 0x3813, 0x00},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 11:9 Full FOV Output, expected FOV Res: 2346x1920
+ * ISP Effect Res: 1408x1152
+ * Sensor out: 1424x1168, DS From: 2380x1952
+ *
+ * WA: Left Offset: 8, Hor scal: 64
+ */
+static struct gc5035_reg const gc5035_1424x1168_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{GC5035_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{GC5035_8BIT, 0x3801, 0x50}, /* 80 */
+	{GC5035_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{GC5035_8BIT, 0x3803, 0x02}, /* 2 */
+	{GC5035_8BIT, 0x3804, 0x09}, /* TIMING_X_ADDR_END */
+	{GC5035_8BIT, 0x3805, 0xdd}, /* 2525 */
+	{GC5035_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{GC5035_8BIT, 0x3807, 0xa1}, /* 1953 */
+	{GC5035_8BIT, 0x3808, 0x05}, /* TIMING_X_OUTPUT_SIZE */
+	{GC5035_8BIT, 0x3809, 0x90}, /* 1424 */
+	{GC5035_8BIT, 0x380a, 0x04}, /* TIMING_Y_OUTPUT_SIZE */
+	{GC5035_8BIT, 0x380b, 0x90}, /* 1168 */
+	{GC5035_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{GC5035_8BIT, 0x3811, 0x02}, /* 2 */
+	{GC5035_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{GC5035_8BIT, 0x3813, 0x00}, /* 0 */
+	{GC5035_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{GC5035_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+/*
+ * 3:2 Full FOV Output, expected FOV Res: 2560x1706
+ * ISP Effect Res: 720x480
+ * Sensor out: 736x496, DS From 2616x1764
+ */
+static struct gc5035_reg const gc5035_736x496_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{GC5035_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{GC5035_8BIT, 0x3801, 0x02}, /* 2 */
+	{GC5035_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{GC5035_8BIT, 0x3803, 0x62}, /* 98 */
+	{GC5035_8BIT, 0x3804, 0x0a}, /* TIMING_X_ADDR_END */
+	{GC5035_8BIT, 0x3805, 0x3b}, /* 2619 */
+	{GC5035_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{GC5035_8BIT, 0x3807, 0x43}, /* 1859 */
+	{GC5035_8BIT, 0x3808, 0x02}, /* TIMING_X_OUTPUT_SIZE */
+	{GC5035_8BIT, 0x3809, 0xe0}, /* 736 */
+	{GC5035_8BIT, 0x380a, 0x01}, /* TIMING_Y_OUTPUT_SIZE */
+	{GC5035_8BIT, 0x380b, 0xf0}, /* 496 */
+	{GC5035_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{GC5035_8BIT, 0x3811, 0x02}, /* 2 */
+	{GC5035_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{GC5035_8BIT, 0x3813, 0x00}, /* 0 */
+	{GC5035_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{GC5035_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+static struct gc5035_reg const gc5035_2576x1936_30fps[] = {
+	{GC5035_8BIT, 0x3501, 0x7b},
+	{GC5035_8BIT, 0x3502, 0x00},
+	{GC5035_8BIT, 0x3708, 0xe2},
+	{GC5035_8BIT, 0x3709, 0xc3},
+	{GC5035_8BIT, 0x3803, 0x00},
+	{GC5035_8BIT, 0x3806, 0x07},
+	{GC5035_8BIT, 0x3807, 0xa3},
+	{GC5035_8BIT, 0x3808, 0x0a},
+	{GC5035_8BIT, 0x3809, 0x10},
+	{GC5035_8BIT, 0x380a, 0x07},
+	{GC5035_8BIT, 0x380b, 0x90},
+	{GC5035_8BIT, 0x380c, 0x0a},
+	{GC5035_8BIT, 0x380d, 0x80},
+	{GC5035_8BIT, 0x380e, 0x07},
+	{GC5035_8BIT, 0x380f, 0xc0},
+	{GC5035_8BIT, 0x3811, 0x18},
+	{GC5035_8BIT, 0x3813, 0x00},
+	{GC5035_8BIT, 0x3814, 0x11},
+	{GC5035_8BIT, 0x3815, 0x11},
+	{GC5035_8BIT, 0x3820, 0x00},
+	{GC5035_8BIT, 0x3821, 0x1e},
+	{GC5035_8BIT, 0x5002, 0x00},
+	{GC5035_8BIT, 0x0100, 0x01},
+	{GC5035_TOK_TERM, 0, 0}
+};
+
+struct gc5035_resolution gc5035_res_preview[] = {
+	{
+		.desc = "gc5035_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_736x496_30fps,
+	},
+	{
+		.desc = "gc5035_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_1616x1216_30fps,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2576,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2576x1456_30fps,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2576,
+		.height = 1936,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2576x1936_30fps,
+	},
+};
+#define N_RES_PREVIEW (ARRAY_SIZE(gc5035_res_preview))
+
+struct gc5035_resolution gc5035_res_still[] = {
+	{
+		.desc = "gc5035_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_736x496_30fps,
+	},
+	{
+		.desc = "gc5035_1424x1168_30fps",
+		.width = 1424,
+		.height = 1168,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_1424x1168_30fps,
+	},
+	{
+		.desc = "gc5035_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_1616x1216_30fps,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2592x1456_30fps,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2592x1944_30fps,
+	},
+};
+#define N_RES_STILL (ARRAY_SIZE(gc5035_res_still))
+
+struct gc5035_resolution gc5035_res_video[] = {
+	{
+		.desc = "gc5035_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc5035_736x496,
+	},
+	{
+		.desc = "gc5035_336x256_30fps",
+		.width = 336,
+		.height = 256,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc5035_336x256,
+	},
+	{
+		.desc = "gc5035_368x304_30fps",
+		.width = 368,
+		.height = 304,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc5035_368x304,
+	},
+	{
+		.desc = "gc5035_192x160_30fps",
+		.width = 192,
+		.height = 160,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = gc5035_192x160,
+	},
+	{
+		.desc = "gc5035_1296x736_30fps",
+		.width = 1296,
+		.height = 736,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = gc5035_1296x736,
+	},
+	{
+		.desc = "gc5035_1296x976_30fps",
+		.width = 1296,
+		.height = 976,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = gc5035_1296x976,
+	},
+	{
+		.desc = "gc5035_1636P_30fps",
+		.width = 1636,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_1636p_30fps,
+	},
+	{
+		.desc = "gc5035_1080P_30fps",
+		.width = 1940,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_1940x1096,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2592x1456_30fps,
+	},
+	{
+		.desc = "gc5035_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = gc5035_2592x1944_30fps,
+	},
+};
+
+#define N_RES_VIDEO (ARRAY_SIZE(gc5035_res_video))
+
+static struct gc5035_resolution *gc5035_res = gc5035_res_preview;
+static unsigned long N_RES = N_RES_PREVIEW;
+#endif
+#endif

+ 517 - 0
drivers/IMX219/3aconfig_IMX219.json

@@ -0,0 +1,517 @@
+{
+    "root" : [
+        {
+            "classname" : "Aev1",
+            "enable" : false
+        },
+        {
+            "classname" : "Aev2",
+            "enable" : true,
+            "motionThreshold" : 0.5,
+            "roiWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 10.66,
+            "maxSensorDgain" : 15.85,
+            "maxIspDgain" : 2.5,
+            "setPoint" : 50,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5
+        },
+        {
+            "classname" : "Aehdr",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "AdaptiveAe",
+            "enable" : false,
+            "motionThreshold" : 0.7,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter" : 0.5,
+            "targetFilter" : 0.5,
+            "wdrContrast.min" : 10,
+            "wdrContrast.max" : 110,
+            "lowlight" : {
+                "linear_repress" : [1, 0.8, 0.6, 0.4, 0.4],
+                "linear_gain" : [4, 8, 16, 32, 100],
+                "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8],
+                "hdr_gain" : [4, 8, 16, 32, 100]
+            },
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 50
+        },
+        {
+            "classname" : "Awbv2",
+            "enable" : true,
+            "illuorder" : "A, D50, D65, D75, TL84, F12, CWF",
+            "indoor" : [1, 1, 1, 1, 1, 1, 1],
+            "outdoor" : [1, 1, 1, 1, 1, 1, 1],
+            "transition" : [1, 1, 1, 1, 1, 1, 1],
+            "avg" : 0
+        },
+        {
+            "classname" : "IspController",
+            "enable" : true
+        },
+        {
+            "classname" : "AutoHdr",
+            "enable" : false
+        },
+        {
+            "classname" : "DciHist",
+            "enable" : false,
+            "gaussMeanPos" : 64,
+            "gaussSigmaPos" : 128,
+            "gaussAmpPos" : 1,
+            "gaussMeanNeg" : 0,
+            "gaussSigmaNeg" : 128,
+            "gaussAmpNeg" : 1
+        },
+        {
+            "classname" : "SensorController",
+            "enable" : true
+        },
+        {
+            "classname" : "AGamma64",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 915, 930, 946, 961, 977, 992, 1008, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ACproc",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                }
+            ]
+        },
+        {
+            "classname" : "Aee",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1000, 500, 200]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [8000, 8000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1500, 600, 200]
+                }
+            ]
+        },
+        {
+            "classname" : "ACa",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enableCA" : [0, 0, 0, 0, 0, 0],
+                    "enableDCI" : [1, 1, 1, 1, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enableCA" : [0, 0, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ADmsc2",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "demoire_enable" : true,		
+            "demoire_area_thr" : 3,
+            "demoire_sat_shrink" : 5,
+            "demoire_r2" : 256,
+            "demoire_r1" : 0,           
+		    "demoire_t2_shift" : 2,
+            "demoire_t1" : 180,
+            "demoire_edge_r2" : 256,
+            "demoire_edge_r1" : 20,
+            "demoire_edge_t2_shift" : 4,
+            "demoire_edge_t1" :20,	
+            "depurple_enable" : true,		
+            "depurple_red_sat" : true,	
+            "depurple_blue_sat" : true,	
+            "depurple_sat_shrink" : 8,				
+            "depurple_thr" : 8,
+            "skin_enable" : false,			
+            "cb_thr_max_2047" : 10,
+            "cb_thr_min_2047" : 8,
+            "cr_thr_max_2047" : 10,
+            "cr_thr_min_2047" : 8,
+            "y_thr_max_2047" : 10,
+            "y_thr_min_2047" : 8,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [1, 1, 1, 1, 1, 1],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [10, 10, 10, 10, 10, 10],
+                    "facwhite" : [10, 10, 10, 10, 10, 10],
+                    "maxblack" : [20, 20, 20, 20, 20, 20],
+                    "maxwhite" : [20, 20, 20, 20, 20, 20],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],					
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [0, 0, 0, 0, 0, 0],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [200, 200, 100, 50, 20, 20],
+                    "facwhite" : [200, 200, 150, 80, 40, 20],
+                    "maxblack" : [200, 200, 100, 100, 100, 100],
+                    "maxwhite" : [200, 200, 200, 200, 200, 200],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],				
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                }
+            ]
+        },
+        {
+            "classname" : "AWdr4",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : true,
+            "backlight" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                }
+            ],
+            "entropy_slope" : 200,
+            "entropy_base" : 700,
+            "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0],
+            "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023],
+            "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575],
+            "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575],
+            "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575]
+        },
+        {
+            "classname" : "A3dnrv3",
+            "forcecreate" : false,
+            "enable" : false,
+	    "disable" : false,
+            "autonoiseLevel": true,
+            "tnr_en" : false,
+            "nlm_en" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                }
+            ]
+        },
+        {
+            "classname" : "A2dnrv5",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                }
+            ]
+        },
+        {
+            "classname" : "ADpf",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16],
+                    "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16],
+                    "Div" : [65, 65, 65, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ABlc",
+            "forcecreate" : true,
+            "enable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 16],
+                    "blc" : [64, 64]
+                }
+            ]
+        }
+    ]
+}

+ 35 - 0
drivers/IMX219/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module imx219)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

File diff suppressed because it is too large
+ 0 - 0
drivers/IMX219/IMX219.c


File diff suppressed because it is too large
+ 674 - 0
drivers/IMX219/IMX219_1640x1232.xml


File diff suppressed because it is too large
+ 674 - 0
drivers/IMX219/IMX219_1920x1080.xml


File diff suppressed because it is too large
+ 674 - 0
drivers/IMX219/IMX219_3280x2464.xml


File diff suppressed because it is too large
+ 674 - 0
drivers/IMX219/IMX219_640x480.xml


+ 59 - 0
drivers/IMX219/IMX219_mipi4lane_1920x1080@30.txt

@@ -0,0 +1,59 @@
+0x0100 0x00
+0x30eb 0x05
+0x30eb 0x0c
+0x300a 0xff
+0x300b 0xff
+0x30eb 0x05
+0x30eb 0x09
+0x0114 0x01
+0x0128 0x00
+0x012a 0x18
+0x012b 0x00
+0x0162 0x0d
+0x0163 0x78
+0x0164 0x02
+0x0165 0xa8
+0x0166 0x0a
+0x0167 0x27
+0x0168 0x02
+0x0169 0xb4
+0x016a 0x06
+0x016b 0xeb
+0x016c 0x07
+0x016d 0x80
+0x016e 0x04
+0x016f 0x38
+0x0170 0x01
+0x0171 0x01
+0x0174 0x00
+0x0175 0x00
+0x0301 0x05
+0x0303 0x01
+0x0304 0x03
+0x0305 0x03
+0x0306 0x00
+0x0307 0x39
+0x030b 0x01
+0x030c 0x00
+0x030d 0x72
+0x0624 0x07
+0x0625 0x80
+0x0626 0x04
+0x0627 0x38
+0x455e 0x00
+0x471e 0x4b
+0x4767 0x0f
+0x4750 0x14
+0x4540 0x00
+0x47b4 0x14
+0x4713 0x30
+0x478b 0x10
+0x478f 0x10
+0x4793 0x10
+0x4797 0x0e
+0x479b 0x0e
+0x0162 0x0d
+0x0163 0x78
+0x018c 0x0a
+0x018d 0x0a
+0x0309 0x0a

+ 241 - 0
drivers/IMX219/IMX219_priv.h

@@ -0,0 +1,241 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file IMX219_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup IMX219_priv
+ * @{
+ *
+ */
+#ifndef __IMX219_PRIV_H__
+#define __IMX219_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define IMX219_PIDH                         (0x300A)  //R  - Product ID High Byte MSBs
+#define IMX219_PIDL                         (0x300B)  //R  - Product ID Low Byte LSBs
+
+/*****************************************************************************
+ * Default values
+ *****************************************************************************/
+
+ // Make sure that these static settings are reflecting the capabilities defined
+// in IsiGetCapsIss (further dynamic setup may alter these default settings but
+// often does not if there is no choice available).
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define IMX219_PIDH_DEFAULT                        (0x27) //read only
+#define IMX219_PIDL_DEFAULT                        (0x70) //read only
+
+typedef struct IMX219_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    uint32_t              Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurIntegrationTime;
+    float               AecCurVSIntegrationTime;
+    float               AecCurLongIntegrationTime;
+    float               AecCurGain;
+    float               AecCurVSGain;
+    float               AecCurLongGain;
+
+    uint32_t            LastExpLine;
+    uint32_t            LastVsExpLine;
+    uint32_t            LastLongExpLine;
+
+    uint32_t            LastGain;
+    uint32_t            LastVsGain;
+    uint32_t            LastLongGain;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldVsGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldVsIntegrationTime;
+    uint32_t            OldGainHcg;
+    uint32_t            OldAGainHcg;
+    uint32_t            OldGainLcg;
+    uint32_t            OldAGainLcg;
+    int                 subdev;
+    uint8_t             pattern;
+
+    float               CurHdrRatio;
+} IMX219_Context_t;
+
+static RESULT IMX219_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT IMX219_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT IMX219_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT IMX219_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT IMX219_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT IMX219_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT IMX219_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT IMX219_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT IMX219_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT IMX219_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT IMX219_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT IMX219_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT IMX219_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT IMX219_IsiGetVSGainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT IMX219_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT IMX219_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT IMX219_IsiSetVSGainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT IMX219_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT IMX219_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT IMX219_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT IMX219_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT IMX219_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+RESULT IMX219_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT IMX219_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} IMX219priv */
+
+#endif    /* __IMX219PRIV_H__ */
+

+ 1377 - 0
drivers/IMX219/imx219.h

@@ -0,0 +1,1377 @@
+/*
+ * Support for OmniVision IMX219 5M camera sensor.
+ *
+ * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef __IMX219_H__
+#define __IMX219_H__
+
+#define IMX219_NAME		"imx219"
+
+#define IMX219_POWER_UP_RETRY_NUM 5
+
+/* Defines for register writes and register array processing */
+#define I2C_MSG_LENGTH		0x2
+#define I2C_RETRY_COUNT		5
+
+#define IMX219_FOCAL_LENGTH_NUM	334	/*3.34mm*/
+#define IMX219_FOCAL_LENGTH_DEM	100
+#define IMX219_F_NUMBER_DEFAULT_NUM	24
+#define IMX219_F_NUMBER_DEM	10
+
+#define MAX_FMTS		1
+
+/* sensor_mode_data read_mode adaptation */
+#define IMX219_READ_MODE_BINNING_ON	0x0400
+#define IMX219_READ_MODE_BINNING_OFF	0x00
+#define IMX219_INTEGRATION_TIME_MARGIN	8
+
+#define IMX219_MAX_EXPOSURE_VALUE	0xFFF1
+#define IMX219_MAX_GAIN_VALUE		0xFF
+
+/*
+ * focal length bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define IMX219_FOCAL_LENGTH_DEFAULT 0x1B70064
+
+/*
+ * current f-number bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define IMX219_F_NUMBER_DEFAULT 0x18000a
+
+/*
+ * f-number range bits definition:
+ * bits 31-24: max f-number numerator
+ * bits 23-16: max f-number denominator
+ * bits 15-8: min f-number numerator
+ * bits 7-0: min f-number denominator
+ */
+#define IMX219_F_NUMBER_RANGE 0x180a180a
+#define IMX219_ID	0x5690
+
+#define IMX219_FINE_INTG_TIME_MIN 0
+#define IMX219_FINE_INTG_TIME_MAX_MARGIN 0
+#define IMX219_COARSE_INTG_TIME_MIN 1
+#define IMX219_COARSE_INTG_TIME_MAX_MARGIN 6
+
+#define IMX219_BIN_FACTOR_MAX 4
+/*
+ * IMX219 System control registers
+ */
+#define IMX219_SW_SLEEP				0x0100
+#define IMX219_SW_RESET				0x0103
+#define IMX219_SW_STREAM			0x0100
+
+#define IMX219_SC_CMMN_CHIP_ID_H		0x300A
+#define IMX219_SC_CMMN_CHIP_ID_L		0x300B
+#define IMX219_SC_CMMN_SCCB_ID			0x300C
+#define IMX219_SC_CMMN_SUB_ID			0x302A /* process, version*/
+/*Bit[7:4] Group control, Bit[3:0] Group ID*/
+#define IMX219_GROUP_ACCESS			0x3208
+/*
+*Bit[3:0] Bit[19:16] of exposure,
+*remaining 16 bits lies in Reg0x3501&Reg0x3502
+*/
+#define IMX219_EXPOSURE_H			0x3500
+#define IMX219_EXPOSURE_M			0x3501
+#define IMX219_EXPOSURE_L			0x3502
+/*Bit[1:0] means Bit[9:8] of gain*/
+#define IMX219_AGC_H				0x350A
+#define IMX219_AGC_L				0x350B /*Bit[7:0] of gain*/
+
+#define IMX219_HORIZONTAL_START_H		0x3800 /*Bit[11:8]*/
+#define IMX219_HORIZONTAL_START_L		0x3801 /*Bit[7:0]*/
+#define IMX219_VERTICAL_START_H			0x3802 /*Bit[11:8]*/
+#define IMX219_VERTICAL_START_L			0x3803 /*Bit[7:0]*/
+#define IMX219_HORIZONTAL_END_H			0x3804 /*Bit[11:8]*/
+#define IMX219_HORIZONTAL_END_L			0x3805 /*Bit[7:0]*/
+#define IMX219_VERTICAL_END_H			0x3806 /*Bit[11:8]*/
+#define IMX219_VERTICAL_END_L			0x3807 /*Bit[7:0]*/
+#define IMX219_HORIZONTAL_OUTPUT_SIZE_H		0x3808 /*Bit[3:0]*/
+#define IMX219_HORIZONTAL_OUTPUT_SIZE_L		0x3809 /*Bit[7:0]*/
+#define IMX219_VERTICAL_OUTPUT_SIZE_H		0x380a /*Bit[3:0]*/
+#define IMX219_VERTICAL_OUTPUT_SIZE_L		0x380b /*Bit[7:0]*/
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define IMX219_TIMING_HTS_H			0x380C
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define IMX219_TIMING_HTS_L			0x380D
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define IMX219_TIMING_VTS_H			0x380e
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define IMX219_TIMING_VTS_L			0x380f
+
+#define IMX219_MWB_RED_GAIN_H			0x3400
+#define IMX219_MWB_GREEN_GAIN_H			0x3402
+#define IMX219_MWB_BLUE_GAIN_H			0x3404
+#define IMX219_MWB_GAIN_MAX			0x0fff
+
+#define IMX219_START_STREAMING			0x01
+#define IMX219_STOP_STREAMING			0x00
+
+#define VCM_ADDR           0x0c
+#define VCM_CODE_MSB       0x04
+
+#define IMX219_INVALID_CONFIG	0xffffffff
+
+#define IMX219_VCM_SLEW_STEP			0x30F0
+#define IMX219_VCM_SLEW_STEP_MAX		0x7
+#define IMX219_VCM_SLEW_STEP_MASK		0x7
+#define IMX219_VCM_CODE				0x30F2
+#define IMX219_VCM_SLEW_TIME			0x30F4
+#define IMX219_VCM_SLEW_TIME_MAX		0xffff
+#define IMX219_VCM_ENABLE			0x8000
+
+#define IMX219_VCM_MAX_FOCUS_NEG       -1023
+#define IMX219_VCM_MAX_FOCUS_POS       1023
+
+#define DLC_ENABLE 1
+#define DLC_DISABLE 0
+#define VCM_PROTECTION_OFF     0xeca3
+#define VCM_PROTECTION_ON      0xdc51
+#define VCM_DEFAULT_S 0x0
+#define vcm_step_s(a) (u8)(a & 0xf)
+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3)
+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104)
+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200)
+#define vcm_val(data, s) (u16)(data << 4 | s)
+#define DIRECT_VCM vcm_dlc_mclk(0, 0)
+
+/* Defines for OTP Data Registers */
+#define IMX219_FRAME_OFF_NUM		0x4202
+#define IMX219_OTP_BYTE_MAX		32	//change to 32 as needed by otpdata
+#define IMX219_OTP_SHORT_MAX		16
+#define IMX219_OTP_START_ADDR		0x3D00
+#define IMX219_OTP_END_ADDR		0x3D0F
+#define IMX219_OTP_DATA_SIZE		320
+#define IMX219_OTP_PROGRAM_REG      	0x3D80
+#define IMX219_OTP_READ_REG		0x3D81	// 1:Enable 0:disable
+#define IMX219_OTP_BANK_REG		0x3D84	//otp bank and mode
+#define IMX219_OTP_READY_REG_DONE	1
+#define IMX219_OTP_BANK_MAX		28
+#define IMX219_OTP_BANK_SIZE		16	//16 bytes per bank
+#define IMX219_OTP_READ_ONETIME		16
+#define IMX219_OTP_MODE_READ		1
+
+typedef enum IMX219_EXPOSURE_SETTING_e {
+	IMX219_ANALOG_GAIN = 1 << 0,
+	IMX219_INTEGRATION_TIME = 1 << 1,
+	IMX219_DIGITAL_GAIN = 1 << 2,
+}IMX219_EXPOSURE_SETTING_t;
+
+#if 0
+struct regval_list {
+	u16 reg_num;
+	u8 value;
+};
+
+struct imx219_resolution {
+	u8 *desc;
+	const struct imx219_reg *regs;
+	int res;
+	int width;
+	int height;
+	int fps;
+	int pix_clk_freq;
+	u16 pixels_per_line;
+	u16 lines_per_frame;
+	u8 bin_factor_x;
+	u8 bin_factor_y;
+	u8 bin_mode;
+	bool used;
+};
+
+struct imx219_format {
+	u8 *desc;
+	u32 pixelformat;
+	struct imx219_reg *regs;
+};
+
+enum vcm_type {
+	VCM_UNKNOWN,
+	VCM_AD5823,
+	VCM_DW9714,
+};
+
+/*
+ * imx219 device structure.
+ */
+struct imx219_device {
+	struct v4l2_subdev sd;
+	struct media_pad pad;
+	struct v4l2_mbus_framefmt format;
+	struct mutex input_lock;
+	struct v4l2_ctrl_handler ctrl_handler;
+
+	struct camera_sensor_platform_data *platform_data;
+	struct timespec timestamp_t_focus_abs;
+	int vt_pix_clk_freq_mhz;
+	int fmt_idx;
+	int run_mode;
+	int otp_size;
+	u8 *otp_data;
+	u32 focus;
+	s16 number_of_steps;
+	u8 res;
+	u8 type;
+	bool vcm_update;
+	enum vcm_type vcm;
+};
+
+enum imx219_tok_type {
+	IMX219_8BIT  = 0x0001,
+	IMX219_16BIT = 0x0002,
+	IMX219_32BIT = 0x0004,
+	IMX219_TOK_TERM   = 0xf000,	/* terminating token for reg list */
+	IMX219_TOK_DELAY  = 0xfe00,	/* delay token for reg list */
+	IMX219_TOK_MASK = 0xfff0
+};
+
+/**
+ * struct imx219_reg - MI sensor  register format
+ * @type: type of the register
+ * @reg: 16-bit offset to register
+ * @val: 8/16/32-bit register value
+ *
+ * Define a structure for sensor register initialization values
+ */
+struct imx219_reg {
+	enum imx219_tok_type type;
+	u16 reg;
+	u32 val;	/* @set value for read/mod/write, @mask */
+};
+
+#define to_imx219_sensor(x) container_of(x, struct imx219_device, sd)
+
+#define IMX219_MAX_WRITE_BUF_SIZE	30
+
+struct imx219_write_buffer {
+	u16 addr;
+	u8 data[IMX219_MAX_WRITE_BUF_SIZE];
+};
+
+struct imx219_write_ctrl {
+	int index;
+	struct imx219_write_buffer buffer;
+};
+
+static const struct i2c_device_id imx219_id[] = {
+	{IMX219_NAME, 0},
+	{}
+};
+
+static struct imx219_reg const imx219_global_setting[] = {
+	{IMX219_8BIT, 0x0103, 0x01},
+	{IMX219_8BIT, 0x3001, 0x0a},
+	{IMX219_8BIT, 0x3002, 0x80},
+	{IMX219_8BIT, 0x3006, 0x00},
+	{IMX219_8BIT, 0x3011, 0x21},
+	{IMX219_8BIT, 0x3012, 0x09},
+	{IMX219_8BIT, 0x3013, 0x10},
+	{IMX219_8BIT, 0x3014, 0x00},
+	{IMX219_8BIT, 0x3015, 0x08},
+	{IMX219_8BIT, 0x3016, 0xf0},
+	{IMX219_8BIT, 0x3017, 0xf0},
+	{IMX219_8BIT, 0x3018, 0xf0},
+	{IMX219_8BIT, 0x301b, 0xb4},
+	{IMX219_8BIT, 0x301d, 0x02},
+	{IMX219_8BIT, 0x3021, 0x00},
+	{IMX219_8BIT, 0x3022, 0x01},
+	{IMX219_8BIT, 0x3028, 0x44},
+	{IMX219_8BIT, 0x3098, 0x02},
+	{IMX219_8BIT, 0x3099, 0x19},
+	{IMX219_8BIT, 0x309a, 0x02},
+	{IMX219_8BIT, 0x309b, 0x01},
+	{IMX219_8BIT, 0x309c, 0x00},
+	{IMX219_8BIT, 0x30a0, 0xd2},
+	{IMX219_8BIT, 0x30a2, 0x01},
+	{IMX219_8BIT, 0x30b2, 0x00},
+	{IMX219_8BIT, 0x30b3, 0x7d},
+	{IMX219_8BIT, 0x30b4, 0x03},
+	{IMX219_8BIT, 0x30b5, 0x04},
+	{IMX219_8BIT, 0x30b6, 0x01},
+	{IMX219_8BIT, 0x3104, 0x21},
+	{IMX219_8BIT, 0x3106, 0x00},
+	{IMX219_8BIT, 0x3400, 0x04},
+	{IMX219_8BIT, 0x3401, 0x00},
+	{IMX219_8BIT, 0x3402, 0x04},
+	{IMX219_8BIT, 0x3403, 0x00},
+	{IMX219_8BIT, 0x3404, 0x04},
+	{IMX219_8BIT, 0x3405, 0x00},
+	{IMX219_8BIT, 0x3406, 0x01},
+	{IMX219_8BIT, 0x3500, 0x00},
+	{IMX219_8BIT, 0x3503, 0x07},
+	{IMX219_8BIT, 0x3504, 0x00},
+	{IMX219_8BIT, 0x3505, 0x00},
+	{IMX219_8BIT, 0x3506, 0x00},
+	{IMX219_8BIT, 0x3507, 0x02},
+	{IMX219_8BIT, 0x3508, 0x00},
+	{IMX219_8BIT, 0x3509, 0x10},
+	{IMX219_8BIT, 0x350a, 0x00},
+	{IMX219_8BIT, 0x350b, 0x40},
+	{IMX219_8BIT, 0x3601, 0x0a},
+	{IMX219_8BIT, 0x3602, 0x38},
+	{IMX219_8BIT, 0x3612, 0x80},
+	{IMX219_8BIT, 0x3620, 0x54},
+	{IMX219_8BIT, 0x3621, 0xc7},
+	{IMX219_8BIT, 0x3622, 0x0f},
+	{IMX219_8BIT, 0x3625, 0x10},
+	{IMX219_8BIT, 0x3630, 0x55},
+	{IMX219_8BIT, 0x3631, 0xf4},
+	{IMX219_8BIT, 0x3632, 0x00},
+	{IMX219_8BIT, 0x3633, 0x34},
+	{IMX219_8BIT, 0x3634, 0x02},
+	{IMX219_8BIT, 0x364d, 0x0d},
+	{IMX219_8BIT, 0x364f, 0xdd},
+	{IMX219_8BIT, 0x3660, 0x04},
+	{IMX219_8BIT, 0x3662, 0x10},
+	{IMX219_8BIT, 0x3663, 0xf1},
+	{IMX219_8BIT, 0x3665, 0x00},
+	{IMX219_8BIT, 0x3666, 0x20},
+	{IMX219_8BIT, 0x3667, 0x00},
+	{IMX219_8BIT, 0x366a, 0x80},
+	{IMX219_8BIT, 0x3680, 0xe0},
+	{IMX219_8BIT, 0x3681, 0x00},
+	{IMX219_8BIT, 0x3700, 0x42},
+	{IMX219_8BIT, 0x3701, 0x14},
+	{IMX219_8BIT, 0x3702, 0xa0},
+	{IMX219_8BIT, 0x3703, 0xd8},
+	{IMX219_8BIT, 0x3704, 0x78},
+	{IMX219_8BIT, 0x3705, 0x02},
+	{IMX219_8BIT, 0x370a, 0x00},
+	{IMX219_8BIT, 0x370b, 0x20},
+	{IMX219_8BIT, 0x370c, 0x0c},
+	{IMX219_8BIT, 0x370d, 0x11},
+	{IMX219_8BIT, 0x370e, 0x00},
+	{IMX219_8BIT, 0x370f, 0x40},
+	{IMX219_8BIT, 0x3710, 0x00},
+	{IMX219_8BIT, 0x371a, 0x1c},
+	{IMX219_8BIT, 0x371b, 0x05},
+	{IMX219_8BIT, 0x371c, 0x01},
+	{IMX219_8BIT, 0x371e, 0xa1},
+	{IMX219_8BIT, 0x371f, 0x0c},
+	{IMX219_8BIT, 0x3721, 0x00},
+	{IMX219_8BIT, 0x3724, 0x10},
+	{IMX219_8BIT, 0x3726, 0x00},
+	{IMX219_8BIT, 0x372a, 0x01},
+	{IMX219_8BIT, 0x3730, 0x10},
+	{IMX219_8BIT, 0x3738, 0x22},
+	{IMX219_8BIT, 0x3739, 0xe5},
+	{IMX219_8BIT, 0x373a, 0x50},
+	{IMX219_8BIT, 0x373b, 0x02},
+	{IMX219_8BIT, 0x373c, 0x41},
+	{IMX219_8BIT, 0x373f, 0x02},
+	{IMX219_8BIT, 0x3740, 0x42},
+	{IMX219_8BIT, 0x3741, 0x02},
+	{IMX219_8BIT, 0x3742, 0x18},
+	{IMX219_8BIT, 0x3743, 0x01},
+	{IMX219_8BIT, 0x3744, 0x02},
+	{IMX219_8BIT, 0x3747, 0x10},
+	{IMX219_8BIT, 0x374c, 0x04},
+	{IMX219_8BIT, 0x3751, 0xf0},
+	{IMX219_8BIT, 0x3752, 0x00},
+	{IMX219_8BIT, 0x3753, 0x00},
+	{IMX219_8BIT, 0x3754, 0xc0},
+	{IMX219_8BIT, 0x3755, 0x00},
+	{IMX219_8BIT, 0x3756, 0x1a},
+	{IMX219_8BIT, 0x3758, 0x00},
+	{IMX219_8BIT, 0x3759, 0x0f},
+	{IMX219_8BIT, 0x376b, 0x44},
+	{IMX219_8BIT, 0x375c, 0x04},
+	{IMX219_8BIT, 0x3774, 0x10},
+	{IMX219_8BIT, 0x3776, 0x00},
+	{IMX219_8BIT, 0x377f, 0x08},
+	{IMX219_8BIT, 0x3780, 0x22},
+	{IMX219_8BIT, 0x3781, 0x0c},
+	{IMX219_8BIT, 0x3784, 0x2c},
+	{IMX219_8BIT, 0x3785, 0x1e},
+	{IMX219_8BIT, 0x378f, 0xf5},
+	{IMX219_8BIT, 0x3791, 0xb0},
+	{IMX219_8BIT, 0x3795, 0x00},
+	{IMX219_8BIT, 0x3796, 0x64},
+	{IMX219_8BIT, 0x3797, 0x11},
+	{IMX219_8BIT, 0x3798, 0x30},
+	{IMX219_8BIT, 0x3799, 0x41},
+	{IMX219_8BIT, 0x379a, 0x07},
+	{IMX219_8BIT, 0x379b, 0xb0},
+	{IMX219_8BIT, 0x379c, 0x0c},
+	{IMX219_8BIT, 0x37c5, 0x00},
+	{IMX219_8BIT, 0x37c6, 0x00},
+	{IMX219_8BIT, 0x37c7, 0x00},
+	{IMX219_8BIT, 0x37c9, 0x00},
+	{IMX219_8BIT, 0x37ca, 0x00},
+	{IMX219_8BIT, 0x37cb, 0x00},
+	{IMX219_8BIT, 0x37de, 0x00},
+	{IMX219_8BIT, 0x37df, 0x00},
+	{IMX219_8BIT, 0x3800, 0x00},
+	{IMX219_8BIT, 0x3801, 0x00},
+	{IMX219_8BIT, 0x3802, 0x00},
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3810, 0x00},
+	{IMX219_8BIT, 0x3812, 0x00},
+	{IMX219_8BIT, 0x3823, 0x00},
+	{IMX219_8BIT, 0x3824, 0x00},
+	{IMX219_8BIT, 0x3825, 0x00},
+	{IMX219_8BIT, 0x3826, 0x00},
+	{IMX219_8BIT, 0x3827, 0x00},
+	{IMX219_8BIT, 0x382a, 0x04},
+	{IMX219_8BIT, 0x3a04, 0x06},
+	{IMX219_8BIT, 0x3a05, 0x14},
+	{IMX219_8BIT, 0x3a06, 0x00},
+	{IMX219_8BIT, 0x3a07, 0xfe},
+	{IMX219_8BIT, 0x3b00, 0x00},
+	{IMX219_8BIT, 0x3b02, 0x00},
+	{IMX219_8BIT, 0x3b03, 0x00},
+	{IMX219_8BIT, 0x3b04, 0x00},
+	{IMX219_8BIT, 0x3b05, 0x00},
+	{IMX219_8BIT, 0x3e07, 0x20},
+	{IMX219_8BIT, 0x4000, 0x08},
+	{IMX219_8BIT, 0x4001, 0x04},
+	{IMX219_8BIT, 0x4002, 0x45},
+	{IMX219_8BIT, 0x4004, 0x08},
+	{IMX219_8BIT, 0x4005, 0x18},
+	{IMX219_8BIT, 0x4006, 0x20},
+	{IMX219_8BIT, 0x4008, 0x24},
+	{IMX219_8BIT, 0x4009, 0x10},
+	{IMX219_8BIT, 0x400c, 0x00},
+	{IMX219_8BIT, 0x400d, 0x00},
+	{IMX219_8BIT, 0x4058, 0x00},
+	{IMX219_8BIT, 0x404e, 0x37},
+	{IMX219_8BIT, 0x404f, 0x8f},
+	{IMX219_8BIT, 0x4058, 0x00},
+	{IMX219_8BIT, 0x4101, 0xb2},
+	{IMX219_8BIT, 0x4303, 0x00},
+	{IMX219_8BIT, 0x4304, 0x08},
+	{IMX219_8BIT, 0x4307, 0x31},
+	{IMX219_8BIT, 0x4311, 0x04},
+	{IMX219_8BIT, 0x4315, 0x01},
+	{IMX219_8BIT, 0x4511, 0x05},
+	{IMX219_8BIT, 0x4512, 0x01},
+	{IMX219_8BIT, 0x4806, 0x00},
+	{IMX219_8BIT, 0x4816, 0x52},
+	{IMX219_8BIT, 0x481f, 0x30},
+	{IMX219_8BIT, 0x4826, 0x2c},
+	{IMX219_8BIT, 0x4831, 0x64},
+	{IMX219_8BIT, 0x4d00, 0x04},
+	{IMX219_8BIT, 0x4d01, 0x71},
+	{IMX219_8BIT, 0x4d02, 0xfd},
+	{IMX219_8BIT, 0x4d03, 0xf5},
+	{IMX219_8BIT, 0x4d04, 0x0c},
+	{IMX219_8BIT, 0x4d05, 0xcc},
+	{IMX219_8BIT, 0x4837, 0x0a},
+	{IMX219_8BIT, 0x5000, 0x06},
+	{IMX219_8BIT, 0x5001, 0x01},
+	{IMX219_8BIT, 0x5003, 0x20},
+	{IMX219_8BIT, 0x5046, 0x0a},
+	{IMX219_8BIT, 0x5013, 0x00},
+	{IMX219_8BIT, 0x5046, 0x0a},
+	{IMX219_8BIT, 0x5780, 0x1c},
+	{IMX219_8BIT, 0x5786, 0x20},
+	{IMX219_8BIT, 0x5787, 0x10},
+	{IMX219_8BIT, 0x5788, 0x18},
+	{IMX219_8BIT, 0x578a, 0x04},
+	{IMX219_8BIT, 0x578b, 0x02},
+	{IMX219_8BIT, 0x578c, 0x02},
+	{IMX219_8BIT, 0x578e, 0x06},
+	{IMX219_8BIT, 0x578f, 0x02},
+	{IMX219_8BIT, 0x5790, 0x02},
+	{IMX219_8BIT, 0x5791, 0xff},
+	{IMX219_8BIT, 0x5842, 0x01},
+	{IMX219_8BIT, 0x5843, 0x2b},
+	{IMX219_8BIT, 0x5844, 0x01},
+	{IMX219_8BIT, 0x5845, 0x92},
+	{IMX219_8BIT, 0x5846, 0x01},
+	{IMX219_8BIT, 0x5847, 0x8f},
+	{IMX219_8BIT, 0x5848, 0x01},
+	{IMX219_8BIT, 0x5849, 0x0c},
+	{IMX219_8BIT, 0x5e00, 0x00},
+	{IMX219_8BIT, 0x5e10, 0x0c},
+	{IMX219_8BIT, 0x0100, 0x00},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 654x496 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct imx219_reg const imx219_654x496[] = {
+	{IMX219_8BIT, 0x3501, 0x3d},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe6},
+	{IMX219_8BIT, 0x3709, 0xc7},
+	{IMX219_8BIT, 0x3803, 0x00},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xa3},
+	{IMX219_8BIT, 0x3808, 0x02},
+	{IMX219_8BIT, 0x3809, 0x90},
+	{IMX219_8BIT, 0x380a, 0x01},
+	{IMX219_8BIT, 0x380b, 0xf0},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x08},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x04},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+*DS from 2592x1952
+*/
+static struct imx219_reg const imx219_1296x976[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+
+	{IMX219_8BIT, 0x3800, 0x00},
+	{IMX219_8BIT, 0x3801, 0x00},
+	{IMX219_8BIT, 0x3802, 0x00},
+	{IMX219_8BIT, 0x3803, 0x00},
+
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xA3},
+
+	{IMX219_8BIT, 0x3808, 0x05},
+	{IMX219_8BIT, 0x3809, 0x10},
+	{IMX219_8BIT, 0x380a, 0x03},
+	{IMX219_8BIT, 0x380b, 0xD0},
+
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+
+	{IMX219_8BIT, 0x3810, 0x00},
+	{IMX219_8BIT, 0x3811, 0x10},
+	{IMX219_8BIT, 0x3812, 0x00},
+	{IMX219_8BIT, 0x3813, 0x02},
+
+	{IMX219_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{IMX219_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+
+};
+
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2564x1956
+ */
+static struct imx219_reg const imx219_336x256[] = {
+	{IMX219_8BIT, 0x3501, 0x3d},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe6},
+	{IMX219_8BIT, 0x3709, 0xc7},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xa3},
+	{IMX219_8BIT, 0x3808, 0x01},
+	{IMX219_8BIT, 0x3809, 0x50},
+	{IMX219_8BIT, 0x380a, 0x01},
+	{IMX219_8BIT, 0x380b, 0x00},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x1E},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x04},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2368x1956
+ */
+static struct imx219_reg const imx219_368x304[] = {
+	{IMX219_8BIT, 0x3501, 0x3d},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe6},
+	{IMX219_8BIT, 0x3709, 0xc7},
+	{IMX219_8BIT, 0x3808, 0x01},
+	{IMX219_8BIT, 0x3809, 0x70},
+	{IMX219_8BIT, 0x380a, 0x01},
+	{IMX219_8BIT, 0x380b, 0x30},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x80},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x04},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * imx219_192x160 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2460x1956
+ */
+static struct imx219_reg const imx219_192x160[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x80},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xA3},
+	{IMX219_8BIT, 0x3808, 0x00},
+	{IMX219_8BIT, 0x3809, 0xC0},
+	{IMX219_8BIT, 0x380a, 0x00},
+	{IMX219_8BIT, 0x380b, 0xA0},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x40},
+	{IMX219_8BIT, 0x3813, 0x00},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x04},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+
+static struct imx219_reg const imx219_736x496[] = {
+	{IMX219_8BIT, 0x3501, 0x3d},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe6},
+	{IMX219_8BIT, 0x3709, 0xc7},
+	{IMX219_8BIT, 0x3803, 0x68},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0x3b},
+	{IMX219_8BIT, 0x3808, 0x02},
+	{IMX219_8BIT, 0x3809, 0xe0},
+	{IMX219_8BIT, 0x380a, 0x01},
+	{IMX219_8BIT, 0x380b, 0xf0},
+	{IMX219_8BIT, 0x380c, 0x0a}, /*hts*/
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07}, /*vts*/
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x08},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x04},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+static struct imx219_reg const imx219_736x496[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe6},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0x00},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xa3},
+	{IMX219_8BIT, 0x3808, 0x02},
+	{IMX219_8BIT, 0x3809, 0xe0},
+	{IMX219_8BIT, 0x380a, 0x01},
+	{IMX219_8BIT, 0x380b, 0xf0},
+	{IMX219_8BIT, 0x380c, 0x0d},
+	{IMX219_8BIT, 0x380d, 0xb0},
+	{IMX219_8BIT, 0x380e, 0x05},
+	{IMX219_8BIT, 0x380f, 0xf2},
+	{IMX219_8BIT, 0x3811, 0x08},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x31},
+	{IMX219_8BIT, 0x3815, 0x31},
+	{IMX219_8BIT, 0x3820, 0x01},
+	{IMX219_8BIT, 0x3821, 0x1f},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+*/
+/*
+ * 976x556 30fps 8.8ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct imx219_reg const imx219_976x556[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0xf0},
+	{IMX219_8BIT, 0x3806, 0x06},
+	{IMX219_8BIT, 0x3807, 0xa7},
+	{IMX219_8BIT, 0x3808, 0x03},
+	{IMX219_8BIT, 0x3809, 0xd0},
+	{IMX219_8BIT, 0x380a, 0x02},
+	{IMX219_8BIT, 0x380b, 0x2C},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x10},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*DS from 2624x1492*/
+static struct imx219_reg const imx219_1296x736[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+
+	{IMX219_8BIT, 0x3800, 0x00},
+	{IMX219_8BIT, 0x3801, 0x00},
+	{IMX219_8BIT, 0x3802, 0x00},
+	{IMX219_8BIT, 0x3803, 0x00},
+
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xA3},
+
+	{IMX219_8BIT, 0x3808, 0x05},
+	{IMX219_8BIT, 0x3809, 0x10},
+	{IMX219_8BIT, 0x380a, 0x02},
+	{IMX219_8BIT, 0x380b, 0xe0},
+
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+
+	{IMX219_8BIT, 0x3813, 0xE8},
+
+	{IMX219_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{IMX219_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+static struct imx219_reg const imx219_1636p_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0xf0},
+	{IMX219_8BIT, 0x3806, 0x06},
+	{IMX219_8BIT, 0x3807, 0xa7},
+	{IMX219_8BIT, 0x3808, 0x06},
+	{IMX219_8BIT, 0x3809, 0x64},
+	{IMX219_8BIT, 0x380a, 0x04},
+	{IMX219_8BIT, 0x380b, 0x48},
+	{IMX219_8BIT, 0x380c, 0x0a}, /*hts*/
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07}, /*vts*/
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x02},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+static struct imx219_reg const imx219_1616x1216_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x80},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3800, 0x00},	/*{3800,3801} Array X start*/
+	{IMX219_8BIT, 0x3801, 0x08},	/* 04 //{3800,3801} Array X start*/
+	{IMX219_8BIT, 0x3802, 0x00},	/*{3802,3803} Array Y start*/
+	{IMX219_8BIT, 0x3803, 0x04},	/* 00  //{3802,3803} Array Y start*/
+	{IMX219_8BIT, 0x3804, 0x0a},	/*{3804,3805} Array X end*/
+	{IMX219_8BIT, 0x3805, 0x37},	/* 3b  //{3804,3805} Array X end*/
+	{IMX219_8BIT, 0x3806, 0x07},	/*{3806,3807} Array Y end*/
+	{IMX219_8BIT, 0x3807, 0x9f},	/* a3  //{3806,3807} Array Y end*/
+	{IMX219_8BIT, 0x3808, 0x06},	/*{3808,3809} Final output H size*/
+	{IMX219_8BIT, 0x3809, 0x50},	/*{3808,3809} Final output H size*/
+	{IMX219_8BIT, 0x380a, 0x04},	/*{380a,380b} Final output V size*/
+	{IMX219_8BIT, 0x380b, 0xc0},	/*{380a,380b} Final output V size*/
+	{IMX219_8BIT, 0x380c, 0x0a},	/*{380c,380d} HTS*/
+	{IMX219_8BIT, 0x380d, 0x80},	/*{380c,380d} HTS*/
+	{IMX219_8BIT, 0x380e, 0x07},	/*{380e,380f} VTS*/
+	{IMX219_8BIT, 0x380f, 0xc0},	/* bc	//{380e,380f} VTS*/
+	{IMX219_8BIT, 0x3810, 0x00},	/*{3810,3811} windowing X offset*/
+	{IMX219_8BIT, 0x3811, 0x10},	/*{3810,3811} windowing X offset*/
+	{IMX219_8BIT, 0x3812, 0x00},	/*{3812,3813} windowing Y offset*/
+	{IMX219_8BIT, 0x3813, 0x06},	/*{3812,3813} windowing Y offset*/
+	{IMX219_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{IMX219_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{IMX219_8BIT, 0x3820, 0x00},	/*FLIP/Binnning control*/
+	{IMX219_8BIT, 0x3821, 0x1e},	/*MIRROR control*/
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x5041, 0x84},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+
+/*
+ * 1940x1096 30fps 8.8ms VBlanking 2lane 10bit (Scaling)
+ */
+static struct imx219_reg const imx219_1940x1096[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0xf0},
+	{IMX219_8BIT, 0x3806, 0x06},
+	{IMX219_8BIT, 0x3807, 0xa7},
+	{IMX219_8BIT, 0x3808, 0x07},
+	{IMX219_8BIT, 0x3809, 0x94},
+	{IMX219_8BIT, 0x380a, 0x04},
+	{IMX219_8BIT, 0x380b, 0x48},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x02},
+	{IMX219_8BIT, 0x3813, 0x02},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x80},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+static struct imx219_reg const imx219_2592x1456_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3800, 0x00},
+	{IMX219_8BIT, 0x3801, 0x00},
+	{IMX219_8BIT, 0x3802, 0x00},
+	{IMX219_8BIT, 0x3803, 0xf0},
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3806, 0x06},
+	{IMX219_8BIT, 0x3807, 0xa4},
+	{IMX219_8BIT, 0x3808, 0x0a},
+	{IMX219_8BIT, 0x3809, 0x20},
+	{IMX219_8BIT, 0x380a, 0x05},
+	{IMX219_8BIT, 0x380b, 0xb0},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x10},
+	{IMX219_8BIT, 0x3813, 0x00},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+static struct imx219_reg const imx219_2576x1456_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3800, 0x00},
+	{IMX219_8BIT, 0x3801, 0x00},
+	{IMX219_8BIT, 0x3802, 0x00},
+	{IMX219_8BIT, 0x3803, 0xf0},
+	{IMX219_8BIT, 0x3804, 0x0a},
+	{IMX219_8BIT, 0x3805, 0x3f},
+	{IMX219_8BIT, 0x3806, 0x06},
+	{IMX219_8BIT, 0x3807, 0xa4},
+	{IMX219_8BIT, 0x3808, 0x0a},
+	{IMX219_8BIT, 0x3809, 0x10},
+	{IMX219_8BIT, 0x380a, 0x05},
+	{IMX219_8BIT, 0x380b, 0xb0},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x18},
+	{IMX219_8BIT, 0x3813, 0x00},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 2592x1944 30fps 0.6ms VBlanking 2lane 10Bit
+ */
+static struct imx219_reg const imx219_2592x1944_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0x00},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xa3},
+	{IMX219_8BIT, 0x3808, 0x0a},
+	{IMX219_8BIT, 0x3809, 0x20},
+	{IMX219_8BIT, 0x380a, 0x07},
+	{IMX219_8BIT, 0x380b, 0x98},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x10},
+	{IMX219_8BIT, 0x3813, 0x00},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 11:9 Full FOV Output, expected FOV Res: 2346x1920
+ * ISP Effect Res: 1408x1152
+ * Sensor out: 1424x1168, DS From: 2380x1952
+ *
+ * WA: Left Offset: 8, Hor scal: 64
+ */
+static struct imx219_reg const imx219_1424x1168_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{IMX219_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{IMX219_8BIT, 0x3801, 0x50}, /* 80 */
+	{IMX219_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{IMX219_8BIT, 0x3803, 0x02}, /* 2 */
+	{IMX219_8BIT, 0x3804, 0x09}, /* TIMING_X_ADDR_END */
+	{IMX219_8BIT, 0x3805, 0xdd}, /* 2525 */
+	{IMX219_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{IMX219_8BIT, 0x3807, 0xa1}, /* 1953 */
+	{IMX219_8BIT, 0x3808, 0x05}, /* TIMING_X_OUTPUT_SIZE */
+	{IMX219_8BIT, 0x3809, 0x90}, /* 1424 */
+	{IMX219_8BIT, 0x380a, 0x04}, /* TIMING_Y_OUTPUT_SIZE */
+	{IMX219_8BIT, 0x380b, 0x90}, /* 1168 */
+	{IMX219_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{IMX219_8BIT, 0x3811, 0x02}, /* 2 */
+	{IMX219_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{IMX219_8BIT, 0x3813, 0x00}, /* 0 */
+	{IMX219_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{IMX219_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+/*
+ * 3:2 Full FOV Output, expected FOV Res: 2560x1706
+ * ISP Effect Res: 720x480
+ * Sensor out: 736x496, DS From 2616x1764
+ */
+static struct imx219_reg const imx219_736x496_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{IMX219_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{IMX219_8BIT, 0x3801, 0x02}, /* 2 */
+	{IMX219_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{IMX219_8BIT, 0x3803, 0x62}, /* 98 */
+	{IMX219_8BIT, 0x3804, 0x0a}, /* TIMING_X_ADDR_END */
+	{IMX219_8BIT, 0x3805, 0x3b}, /* 2619 */
+	{IMX219_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{IMX219_8BIT, 0x3807, 0x43}, /* 1859 */
+	{IMX219_8BIT, 0x3808, 0x02}, /* TIMING_X_OUTPUT_SIZE */
+	{IMX219_8BIT, 0x3809, 0xe0}, /* 736 */
+	{IMX219_8BIT, 0x380a, 0x01}, /* TIMING_Y_OUTPUT_SIZE */
+	{IMX219_8BIT, 0x380b, 0xf0}, /* 496 */
+	{IMX219_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{IMX219_8BIT, 0x3811, 0x02}, /* 2 */
+	{IMX219_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{IMX219_8BIT, 0x3813, 0x00}, /* 0 */
+	{IMX219_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{IMX219_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+static struct imx219_reg const imx219_2576x1936_30fps[] = {
+	{IMX219_8BIT, 0x3501, 0x7b},
+	{IMX219_8BIT, 0x3502, 0x00},
+	{IMX219_8BIT, 0x3708, 0xe2},
+	{IMX219_8BIT, 0x3709, 0xc3},
+	{IMX219_8BIT, 0x3803, 0x00},
+	{IMX219_8BIT, 0x3806, 0x07},
+	{IMX219_8BIT, 0x3807, 0xa3},
+	{IMX219_8BIT, 0x3808, 0x0a},
+	{IMX219_8BIT, 0x3809, 0x10},
+	{IMX219_8BIT, 0x380a, 0x07},
+	{IMX219_8BIT, 0x380b, 0x90},
+	{IMX219_8BIT, 0x380c, 0x0a},
+	{IMX219_8BIT, 0x380d, 0x80},
+	{IMX219_8BIT, 0x380e, 0x07},
+	{IMX219_8BIT, 0x380f, 0xc0},
+	{IMX219_8BIT, 0x3811, 0x18},
+	{IMX219_8BIT, 0x3813, 0x00},
+	{IMX219_8BIT, 0x3814, 0x11},
+	{IMX219_8BIT, 0x3815, 0x11},
+	{IMX219_8BIT, 0x3820, 0x00},
+	{IMX219_8BIT, 0x3821, 0x1e},
+	{IMX219_8BIT, 0x5002, 0x00},
+	{IMX219_8BIT, 0x0100, 0x01},
+	{IMX219_TOK_TERM, 0, 0}
+};
+
+struct imx219_resolution imx219_res_preview[] = {
+	{
+		.desc = "imx219_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_736x496_30fps,
+	},
+	{
+		.desc = "imx219_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_1616x1216_30fps,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2576,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2576x1456_30fps,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2576,
+		.height = 1936,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2576x1936_30fps,
+	},
+};
+#define N_RES_PREVIEW (ARRAY_SIZE(imx219_res_preview))
+
+struct imx219_resolution imx219_res_still[] = {
+	{
+		.desc = "imx219_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_736x496_30fps,
+	},
+	{
+		.desc = "imx219_1424x1168_30fps",
+		.width = 1424,
+		.height = 1168,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_1424x1168_30fps,
+	},
+	{
+		.desc = "imx219_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_1616x1216_30fps,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2592x1456_30fps,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2592x1944_30fps,
+	},
+};
+#define N_RES_STILL (ARRAY_SIZE(imx219_res_still))
+
+struct imx219_resolution imx219_res_video[] = {
+	{
+		.desc = "imx219_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = imx219_736x496,
+	},
+	{
+		.desc = "imx219_336x256_30fps",
+		.width = 336,
+		.height = 256,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = imx219_336x256,
+	},
+	{
+		.desc = "imx219_368x304_30fps",
+		.width = 368,
+		.height = 304,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = imx219_368x304,
+	},
+	{
+		.desc = "imx219_192x160_30fps",
+		.width = 192,
+		.height = 160,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = imx219_192x160,
+	},
+	{
+		.desc = "imx219_1296x736_30fps",
+		.width = 1296,
+		.height = 736,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = imx219_1296x736,
+	},
+	{
+		.desc = "imx219_1296x976_30fps",
+		.width = 1296,
+		.height = 976,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = imx219_1296x976,
+	},
+	{
+		.desc = "imx219_1636P_30fps",
+		.width = 1636,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_1636p_30fps,
+	},
+	{
+		.desc = "imx219_1080P_30fps",
+		.width = 1940,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_1940x1096,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2592x1456_30fps,
+	},
+	{
+		.desc = "imx219_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = imx219_2592x1944_30fps,
+	},
+};
+
+#define N_RES_VIDEO (ARRAY_SIZE(imx219_res_video))
+
+static struct imx219_resolution *imx219_res = imx219_res_preview;
+static unsigned long N_RES = N_RES_PREVIEW;
+#endif
+#endif

+ 35 - 0
drivers/IMX334/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module imx334)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  #COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  #COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

+ 2044 - 0
drivers/IMX334/IMX334.c

@@ -0,0 +1,2044 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+
+#include <ebase/types.h>
+#include <ebase/trace.h>
+#include <ebase/builtins.h>
+#include <common/return_codes.h>
+#include <common/misc.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <math.h>
+#include <isi/isi.h>
+#include <isi/isi_iss.h>
+#include <isi/isi_priv.h>
+#include <vvsensor.h>
+#include "IMX334_priv.h"
+
+CREATE_TRACER( IMX334_INFO , "IMX334: ", INFO,    1);
+CREATE_TRACER( IMX334_WARN , "IMX334: ", WARNING, 1);
+CREATE_TRACER( IMX334_ERROR, "IMX334: ", ERROR,   1);
+CREATE_TRACER( IMX334_DEBUG,     "IMX334: ", INFO, 1);
+CREATE_TRACER( IMX334_REG_INFO , "IMX334: ", INFO, 1);
+CREATE_TRACER( IMX334_REG_DEBUG, "IMX334: ", INFO, 1);
+
+#ifdef SUBDEV_V4L2
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <linux/videodev2.h>
+#include <linux/v4l2-subdev.h>
+#undef TRACE
+#define TRACE(x, ...)
+#endif
+
+#define IMX334_MIN_GAIN_STEP    ( 1.0f/16.0f )  /**< min gain step size used by GUI (hardware min = 1/16; 1/16..32/16 depending on actual gain ) */
+#define IMX334_MAX_GAIN_AEC     ( 32.0f )       /**< max. gain used by the AEC (arbitrarily chosen, hardware limit = 62.0, driver limit = 32.0 ) */
+#define IMX334_PLL_PCLK         74250000
+#define IMX334_HMAX             0xaec
+#define IMX334_VMAX             0xac4
+
+extern const IsiRegDescription_t IMX334_g_aRegDescription[];
+//const IsiSensorCaps_t IMX334_g_IsiSensorDefaultConfig;
+
+/*****************************************************************************
+ *Sensor Info
+*****************************************************************************/
+static const char SensorName[16] = "IMX334";
+
+static struct vvcam_mode_info pIMX334_mode_info[] = {
+	{
+		.index     = 0,
+		.width     = 3864,
+		.height    = 2180,
+		.fps       = 30,
+		.hdr_mode  = SENSOR_MODE_LINEAR,
+		.bit_width = 12,
+		.bayer_pattern = 3,
+        .mipi_phy_freq = 800, //mbps
+        .mipi_line_num = 4,
+        .preg_data = (void *)"imx334 3864x2180",
+	},
+    /*
+     {
+		.index     = 0,
+		.width     = 3840,
+		.height    = 2160,
+		.fps       = 30,
+		.hdr_mode  = SENSOR_MODE_LINEAR,
+		.bit_width = 12,
+		.bayer_pattern = 3,
+        .mipi_phy_freq = 900, //mbps
+        .mipi_line_num = 4,
+        .preg_data = (void *)"imx334 3840x2160",
+	},
+    */
+    /*
+	{
+		.index     = 1,
+		.width     = 3840,
+		.height    = 2160,
+		.fps      = 30,
+		.hdr_mode = SENSOR_MODE_HDR_STITCH,
+		.stitching_mode = SENSOR_STITCHING_3DOL,
+		.bit_width = 12,
+		.bayer_pattern = BAYER_GBRG,
+        .mipi_phy_freq = 800, //mbps
+        .mipi_line_num = 4,
+        .preg_data = (void *)"imx334 3840x2160",
+	},
+	{
+		.index     = 2,
+		.width    = 1280,
+		.height   = 720,
+		.fps      = 60,
+		.hdr_mode = SENSOR_MODE_LINEAR,
+		.bit_width = 10,
+		.bayer_pattern = BAYER_GBRG,
+        .mipi_phy_freq = 600, //mbps
+        .mipi_line_num = 4,
+        .preg_data = (void *)"imx334 1920x1080",
+	}
+    */
+};
+
+/*
+static const uint32_t SensorDrvSupportResoluton[] = {
+    ISI_RES_TV720P,
+    ISI_RES_TV1080P
+};
+*/
+
+static RESULT IMX334_IsiSensorSetPowerIss(IsiSensorHandle_t handle, bool_t on) {
+    RESULT result = RET_SUCCESS;
+
+    int ret = 0;
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    int32_t enable = on;
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_POWER, &enable);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: sensor set power error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiResetSensorIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_RESET, NULL);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    sleep(0.01);
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+#ifdef SUBDEV_CHAR
+static RESULT IMX334_IsiSensorSetClkIss(IsiSensorHandle_t handle, uint32_t clk) {
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_CLK, &clk);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: sensor set clk error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiSensorGetClkIss(IsiSensorHandle_t handle, uint32_t * pclk) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_CLK, pclk);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: sensor get clk error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiConfigSensorSCCBIss(IsiSensorHandle_t handle)
+{
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    static const IsiSccbInfo_t SensorSccbInfo = {
+        .slave_addr = (0x34 >> 1),
+        .addr_byte = 2,
+        .data_byte = 1,
+    };
+
+    struct vvcam_sccb_cfg_s sensor_sccb_config;
+    sensor_sccb_config.slave_addr = SensorSccbInfo.slave_addr;
+    sensor_sccb_config.addr_byte = SensorSccbInfo.addr_byte;
+    sensor_sccb_config.data_byte = SensorSccbInfo.data_byte;
+
+    ret =
+        ioctl(pHalCtx->sensor_fd, VVSENSORIOC_SENSOR_SCCB_CFG,
+          &sensor_sccb_config);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: sensor config sccb info error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+}
+#endif
+
+static RESULT IMX334_IsiRegisterReadIss (IsiSensorHandle_t handle, const uint32_t address, uint32_t * p_value) {
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    struct vvcam_sccb_data sccb_data;
+    sccb_data.addr = address;
+    sccb_data.data = 0;
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_READ_REG, &sccb_data);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: read sensor register error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    *p_value = sccb_data.data;
+
+    TRACE(IMX334_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+}
+
+static RESULT IMX334_IsiRegisterWriteIss(IsiSensorHandle_t handle, const uint32_t address, const uint32_t value) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    struct vvcam_sccb_data sccb_data;
+    sccb_data.addr = address;
+    sccb_data.data = value;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_WRITE_REG, &sccb_data);
+    if (ret != 0) {
+        TRACE(IMX334_ERROR, "%s: write sensor register error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+}
+
+static RESULT IMX334_IsiQuerySensorSupportIss(HalHandle_t  HalHandle, vvcam_mode_info_array_t *pSensorSupportInfo)
+{
+    int ret = 0;
+    struct vvcam_mode_info_array *psensor_mode_info_arry;
+
+    HalContext_t *pHalCtx = HalHandle;
+    if ( pHalCtx == NULL ) {
+        return RET_NULL_POINTER;
+    }
+
+    psensor_mode_info_arry = pSensorSupportInfo;
+    psensor_mode_info_arry->count = sizeof(pIMX334_mode_info) / sizeof(struct vvcam_mode_info);
+    memcpy(psensor_mode_info_arry->modes, pIMX334_mode_info, sizeof(pIMX334_mode_info));
+
+    TRACE(IMX334_INFO, "SensorQuery:\n");
+    TRACE(IMX334_INFO, "*********************************\n");
+    for(int i=0; i<psensor_mode_info_arry->count; i++)
+    {
+        TRACE( IMX334_INFO, "Current Sensor Mode:\n");
+        TRACE( IMX334_INFO, "Mode Index: %d \n",psensor_mode_info_arry->modes[i].index);
+        TRACE( IMX334_INFO, "Resolution: %d * %d\n",psensor_mode_info_arry->modes[i].width,psensor_mode_info_arry->modes[i].height);
+        TRACE( IMX334_INFO, "fps: %d \n",psensor_mode_info_arry->modes[i].fps);
+        TRACE( IMX334_INFO, "hdr_mode: %d \n",psensor_mode_info_arry->modes[i].hdr_mode);
+        TRACE( IMX334_INFO, "stitching_mode: %d \n",psensor_mode_info_arry->modes[i].stitching_mode);
+        TRACE( IMX334_INFO, "bit_width: %d \n",psensor_mode_info_arry->modes[i].bit_width);
+        TRACE( IMX334_INFO, "bayer_pattern: %d \n",psensor_mode_info_arry->modes[i].bayer_pattern);
+        TRACE( IMX334_INFO, "---------------------------------\n");
+    }
+    TRACE(IMX334_INFO, "*********************************\n");
+    return RET_SUCCESS;
+}
+
+static  RESULT IMX334_IsiQuerySensorIss(IsiSensorHandle_t handle, vvcam_mode_info_array_t *pSensorInfo)
+{
+    RESULT result = RET_SUCCESS;
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+    IMX334_IsiQuerySensorSupportIss(pHalCtx,pSensorInfo);
+
+    return result;
+}
+
+static RESULT IMX334_IsiGetSensorModeIss(IsiSensorHandle_t handle,void *mode)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL) {
+        return (RET_WRONG_HANDLE);
+    }
+    memcpy(mode,&(pIMX334Ctx->SensorMode), sizeof(pIMX334Ctx->SensorMode));
+
+    return ( RET_SUCCESS );
+}
+
+static RESULT IMX334_IsiCreateSensorIss(IsiSensorInstanceConfig_t * pConfig) {
+    RESULT result = RET_SUCCESS;
+    IMX334_Context_t *pIMX334Ctx;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (!pConfig || !pConfig->pSensor)
+        return (RET_NULL_POINTER);
+
+    pIMX334Ctx = (IMX334_Context_t *) malloc(sizeof(IMX334_Context_t));
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR, "%s: Can't allocate IMX334 context\n",
+              __func__);
+        return (RET_OUTOFMEM);
+    }
+
+    MEMSET(pIMX334Ctx, 0, sizeof(IMX334_Context_t));
+
+    result = HalAddRef(pConfig->HalHandle);
+    if (result != RET_SUCCESS) {
+        free(pIMX334Ctx);
+        return (result);
+    }
+
+    pIMX334Ctx->IsiCtx.HalHandle = pConfig->HalHandle;
+    pIMX334Ctx->IsiCtx.pSensor = pConfig->pSensor;
+    pIMX334Ctx->GroupHold = BOOL_FALSE;
+    pIMX334Ctx->OldGain = 1.0;
+    pIMX334Ctx->OldIntegrationTime = 0.01;
+    pIMX334Ctx->Configured = BOOL_FALSE;
+    pIMX334Ctx->Streaming = BOOL_FALSE;
+    pIMX334Ctx->TestPattern = BOOL_FALSE;
+    pIMX334Ctx->isAfpsRun = BOOL_FALSE;
+    pIMX334Ctx->SensorMode.index = pConfig->SensorModeIndex;
+    pConfig->hSensor = (IsiSensorHandle_t) pIMX334Ctx;
+#ifdef SUBDEV_CHAR
+    struct vvcam_mode_info *SensorDefaultMode = NULL;
+    for (int i=0; i < sizeof(pIMX334_mode_info)/ sizeof(struct vvcam_mode_info); i++)
+    {
+        if (pIMX334_mode_info[i].index == pIMX334Ctx->SensorMode.index)
+        {
+            SensorDefaultMode = &(pIMX334_mode_info[i]);
+            break;
+        }
+    }
+
+    if (SensorDefaultMode != NULL)
+    {
+        strcpy(pIMX334Ctx->SensorRegCfgFile, get_vi_config_path());
+        switch(SensorDefaultMode->index)
+        {
+            case 0:
+                strcat(pIMX334Ctx->SensorRegCfgFile,
+                    "IMX334_mipi4lane_3864_2180_raw12_800mbps_init.txt");
+                break;
+                /*
+            case 1: //3Dol mode
+                strcat(pIMX334Ctx->SensorRegCfgFile,
+                    "IMX334_mipi4lane_3840_2160_raw12_800mbps_3dol_init.txt");
+                break;
+            */
+            default:
+                break;
+        }
+
+        if (access(pIMX334Ctx->SensorRegCfgFile, F_OK) == 0) {
+            pIMX334Ctx->KernelDriverFlag = 0;
+            memcpy(&(pIMX334Ctx->SensorMode),SensorDefaultMode,sizeof(struct vvcam_mode_info));
+        } else {
+            TRACE(IMX334_ERROR, "%s, %d, load %s: error\n", __func__, __LINE__, pIMX334Ctx->SensorRegCfgFile);
+            return -1;
+        }
+    }else
+    {
+        pIMX334Ctx->KernelDriverFlag = 1;
+    }
+
+    result = IMX334_IsiSensorSetPowerIss(pIMX334Ctx, BOOL_TRUE);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    uint32_t SensorClkIn;
+    if (pIMX334Ctx->KernelDriverFlag) {
+        result = IMX334_IsiSensorGetClkIss(pIMX334Ctx, &SensorClkIn);
+        RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+    }
+
+    result = IMX334_IsiSensorSetClkIss(pIMX334Ctx, SensorClkIn);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    result = IMX334_IsiResetSensorIss(pIMX334Ctx);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    if (!pIMX334Ctx->KernelDriverFlag) {
+        result = IMX334_IsiConfigSensorSCCBIss(pIMX334Ctx);
+        RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+    }
+
+    pIMX334Ctx->pattern = 3;
+#endif
+
+#ifdef SUBDEV_V4L2
+    pIMX334Ctx->pattern = 3;
+    pIMX334Ctx->subdev = HalGetFdHandle(pConfig->HalHandle, HAL_MODULE_SENSOR);
+    pIMX334Ctx->KernelDriverFlag = 1;
+#endif
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiGetRegCfgIss(const char *registerFileName,
+                     struct vvcam_sccb_array *arry)
+{
+    if (NULL == registerFileName) {
+        TRACE(IMX334_ERROR, "%s:registerFileName is NULL\n", __func__);
+        return (RET_NULL_POINTER);
+    }
+#ifdef SUBDEV_CHAR
+    FILE *fp = NULL;
+    fp = fopen(registerFileName, "rb");
+    if (!fp) {
+        TRACE(IMX334_ERROR, "%s:load register file  %s error!\n",
+              __func__, registerFileName);
+        return (RET_FAILURE);
+    }
+
+    char LineBuf[512];
+    uint32_t FileTotalLine = 0;
+    while (!feof(fp)) {
+        fgets(LineBuf, 512, fp);
+        FileTotalLine++;
+    }
+
+    arry->sccb_data =
+        malloc(FileTotalLine * sizeof(struct vvcam_sccb_data));
+    if (arry->sccb_data == NULL) {
+        TRACE(IMX334_ERROR, "%s:malloc failed NULL Point!\n", __func__,
+              registerFileName);
+        return (RET_FAILURE);
+    }
+    rewind(fp);
+
+    arry->count = 0;
+    while (!feof(fp)) {
+        memset(LineBuf, 0, sizeof(LineBuf));
+        fgets(LineBuf, 512, fp);
+
+        int result =
+            sscanf(LineBuf, "0x%x 0x%x",
+               &(arry->sccb_data[arry->count].addr),
+               &(arry->sccb_data[arry->count].data));
+        if (result != 2)
+            continue;
+        arry->count++;
+
+    }
+#endif
+
+    return 0;
+}
+
+#if 0
+static RESULT IMX334_IsiGetPicSize(uint32_t Resolution, uint32_t * pwidth,
+                   uint32_t * pheight)
+{
+    switch (Resolution) {
+    case ISI_RES_TV1080P:
+        {
+            *pwidth = 1920;
+            *pheight = 1080;
+            break;
+        }
+    case ISI_RES_TV720P:
+        {
+            *pwidth = 1280;
+            *pheight = 720;
+            break;
+        }
+    default:
+        {
+            return (RET_NOTSUPP);
+        }
+    }
+    return (RET_SUCCESS);
+}
+#endif
+
+static RESULT IMX334_IsiInitSensorIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+    if (pIMX334Ctx == NULL) {
+        return (RET_WRONG_HANDLE);
+    }
+    if (pIMX334Ctx->KernelDriverFlag) {
+#ifdef SUBDEV_CHAR
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_INIT, &(pIMX334Ctx->SensorMode));
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:sensor init error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_SENSOR_MODE, &(pIMX334Ctx->SensorMode));
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:sensor get mode info error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+
+        struct vvcam_ae_info_s ae_info;
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_AE_INFO, &ae_info);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:sensor get ae info error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+        pIMX334Ctx->one_line_exp_time  = IMX334_HMAX/IMX334_PLL_PCLK;
+        pIMX334Ctx->MaxIntegrationLine = ae_info.max_integration_time;
+        pIMX334Ctx->MinIntegrationLine = ae_info.min_integration_time;
+        pIMX334Ctx->gain_accuracy = ae_info.gain_accuracy;
+        pIMX334Ctx->AecMinGain =  1.0;
+        pIMX334Ctx->AecMaxGain = 36;
+
+        pIMX334Ctx->MaxFps  = pIMX334Ctx->SensorMode.fps;
+        pIMX334Ctx->MinFps  = 1;
+        pIMX334Ctx->CurrFps = pIMX334Ctx->MaxFps;
+#endif
+
+#ifdef SUBDEV_V4L2
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_SENSOR_MODE, &(pIMX334Ctx->SensorMode));
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:sensor get mode info error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+        pIMX334Ctx->one_line_exp_time = IMX334_HMAX/IMX334_PLL_PCLK;
+        pIMX334Ctx->FrameLengthLines = 0xac4;
+        pIMX334Ctx->CurFrameLengthLines = pIMX334Ctx->FrameLengthLines;
+        pIMX334Ctx->MaxIntegrationLine = pIMX334Ctx->CurFrameLengthLines - 3;
+        pIMX334Ctx->MinIntegrationLine = 1;
+        pIMX334Ctx->AecMaxGain = 24;
+        pIMX334Ctx->AecMinGain = 3;
+        pIMX334Ctx->CurrFps = pIMX334Ctx->MaxFps;
+        pIMX334Ctx->gain_accuracy = 1024;
+
+        if (pIMX334Ctx->SensorMode.hdr_mode != SENSOR_MODE_LINEAR)
+        {
+            pIMX334Ctx->enableHdr = 1;
+        }
+#endif
+
+    } else {
+        struct vvcam_sccb_array arry;
+        result = IMX334_IsiGetRegCfgIss(pIMX334Ctx->SensorRegCfgFile, &arry);
+        if (result != 0) {
+            TRACE(IMX334_ERROR,
+                  "%s:IMX334_IsiGetRegCfgIss error!\n", __func__);
+            return (RET_FAILURE);
+        }
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_WRITE_ARRAY, &arry);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:Sensor Write Reg arry error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+
+        switch(pIMX334Ctx->SensorMode.index)
+        {
+            case 0:
+                pIMX334Ctx->one_line_exp_time = IMX334_HMAX/IMX334_PLL_PCLK;
+                pIMX334Ctx->FrameLengthLines = 0xac4;
+                pIMX334Ctx->CurFrameLengthLines = pIMX334Ctx->FrameLengthLines;
+                pIMX334Ctx->MaxIntegrationLine = pIMX334Ctx->CurFrameLengthLines - 3;
+                pIMX334Ctx->MinIntegrationLine = 1;
+                pIMX334Ctx->AecMaxGain = 24;
+                pIMX334Ctx->AecMinGain = 3;
+                break;
+            case 1:
+                pIMX334Ctx->one_line_exp_time = IMX334_HMAX/IMX334_PLL_PCLK;
+                pIMX334Ctx->FrameLengthLines =  0xac4;
+                pIMX334Ctx->CurFrameLengthLines = pIMX334Ctx->FrameLengthLines;
+                pIMX334Ctx->MaxIntegrationLine = pIMX334Ctx->CurFrameLengthLines - 3;
+                pIMX334Ctx->MinIntegrationLine = 1;
+                pIMX334Ctx->AecMaxGain = 21;
+                pIMX334Ctx->AecMinGain = 3;
+                break;
+            default:
+                return ( RET_NOTAVAILABLE );
+                break;
+        }
+        pIMX334Ctx->MaxFps  = pIMX334Ctx->SensorMode.fps;
+        pIMX334Ctx->MinFps  = 1;
+        pIMX334Ctx->CurrFps = pIMX334Ctx->MaxFps;
+    }
+
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiReleaseSensorIss(IsiSensorHandle_t handle) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL)
+        return (RET_WRONG_HANDLE);
+
+    (void)IMX334_IsiSensorSetStreamingIss(pIMX334Ctx, BOOL_FALSE);
+    (void)IMX334_IsiSensorSetPowerIss(pIMX334Ctx, BOOL_FALSE);
+    (void)HalDelRef(pIMX334Ctx->IsiCtx.HalHandle);
+
+    MEMSET(pIMX334Ctx, 0, sizeof(IMX334_Context_t));
+    free(pIMX334Ctx);
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiGetCapsIss
+    (IsiSensorHandle_t handle, IsiSensorCaps_t * pIsiSensorCaps) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL)
+        return (RET_WRONG_HANDLE);
+
+    if (pIsiSensorCaps == NULL) {
+        return (RET_NULL_POINTER);
+    } else {
+        pIsiSensorCaps->BusWidth = 12;//ISI_BUSWIDTH_12BIT;
+        pIsiSensorCaps->Mode = ISI_MODE_BAYER;
+        pIsiSensorCaps->FieldSelection = ISI_FIELDSEL_BOTH;
+        pIsiSensorCaps->YCSequence = ISI_YCSEQ_YCBYCR;    //  ISI_YCSEQ_YCRYCB;//ISI_YCSEQ_YCBYCR;           /**< only Bayer supported, will not be evaluated */
+        pIsiSensorCaps->Conv422 = ISI_CONV422_NOCOSITED;    //ISI_CONV422_INTER;//ISI_CONV422_NOCOSITED;
+        pIsiSensorCaps->BPat = pIMX334Ctx->pattern;
+        pIsiSensorCaps->HPol = ISI_HPOL_REFPOS;
+        pIsiSensorCaps->VPol = ISI_VPOL_NEG;    //ISI_VPOL_POS;//ISI_VPOL_NEG;
+        pIsiSensorCaps->Edge = ISI_EDGE_RISING;    //ISI_EDGE_FALLING;//ISI_EDGE_RISING;
+        //pIsiSensorCaps->Bls = ISI_BLS_OFF;
+        //pIsiSensorCaps->Gamma = ISI_GAMMA_OFF;
+        //pIsiSensorCaps->CConv = ISI_CCONV_OFF;
+
+        pIsiSensorCaps->Resolution = pIMX334Ctx->Resolution;    //( ISI_RES_TV1080P24   | ISI_RES_TV1080P20 | ISI_RES_TV1080P15 | ISI_RES_TV1080P6
+
+        //pIsiSensorCaps->BLC = (ISI_BLC_AUTO | ISI_BLC_OFF);
+        //pIsiSensorCaps->AGC = ISI_AGC_OFF;    //  ( ISI_AGC_AUTO | ISI_AGC_OFF );
+        //pIsiSensorCaps->AWB = ISI_AWB_OFF;    // ( ISI_AWB_AUTO | ISI_AWB_OFF );
+        //pIsiSensorCaps->AEC = (ISI_AEC_OFF);    //  ISI_AEC_AUTO | ISI_AEC_OFF );
+        //pIsiSensorCaps->DPCC = (ISI_DPCC_AUTO | ISI_DPCC_OFF);
+
+        //pIsiSensorCaps->DwnSz = ISI_DWNSZ_SUBSMPL;
+        /*
+        pIsiSensorCaps->CieProfile = (ISI_CIEPROF_A
+                          | ISI_CIEPROF_D50
+                          | ISI_CIEPROF_D65
+                          | ISI_CIEPROF_D75
+                          | ISI_CIEPROF_F2
+                          | ISI_CIEPROF_F11);
+                          */
+        pIsiSensorCaps->SmiaMode = ISI_SMIA_OFF;
+        pIsiSensorCaps->MipiMode = ISI_MIPI_OFF;    //= ISI_MIPI_MODE_RAW_10;
+        pIsiSensorCaps->MipiLanes = ISI_MIPI_4LANES;
+        //pIsiSensorCaps->AfpsResolutions = ISI_AFPS_NOTSUPP;    //(ISI_RES_TV1080P15); //ISI_AFPS_NOTSUPP; //( ISI_RES_TV1080P24 | ISI_RES_TV1080P20 | ISI_RES_TV1080P15  | ISI_RES_TV1080P6);
+        //pIsiSensorCaps->enableHdr = pIMX334Ctx->enableHdr;
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+/*
+const IsiSensorCaps_t IMX334_g_IsiSensorDefaultConfig = {
+    ISI_BUSWIDTH_12BIT,    // BusWidth
+    ISI_MODE_BAYER,        // Mode
+    ISI_FIELDSEL_BOTH,    // FieldSel
+    ISI_YCSEQ_YCBYCR,    //ISI_YCSEQ_YCRYCB,  //ISI_YCSEQ_YCBYCR,           // YCSeq
+    ISI_CONV422_NOCOSITED,    //ISI_CONV422_INTER, //ISI_CONV422_NOCOSITED,      // Conv422
+    ISI_BPAT_BGBGGRGR,
+    ISI_HPOL_REFPOS,    // HPol
+    ISI_VPOL_NEG,        //ISI_VPOL_POS,      //ISI_VPOL_NEG,               // VPol
+    ISI_EDGE_RISING,    //ISI_EDGE_FALLING,  //ISI_EDGE_RISING,            // Edge
+    ISI_BLS_OFF,        // Bls
+    ISI_GAMMA_OFF,        // Gamma
+    ISI_CCONV_OFF,        // CConv
+    ISI_RES_TV1080P,    //ISI_RES_TV1080P24,          // Res
+    ISI_DWNSZ_SUBSMPL,    // DwnSz
+    ISI_BLC_AUTO,        // BLC
+    ISI_AGC_OFF,        //ISI_AGC_OFF,                // AGC
+    ISI_AWB_OFF,        //ISI_AWB_OFF,                // AWB
+    ISI_AEC_OFF,        //ISI_AEC_OFF,                // AEC
+    ISI_DPCC_OFF,        // DPCC
+    ISI_CIEPROF_F11,    // CieProfile, this is also used as start profile for AWB (if not altered by menu settings)
+    ISI_SMIA_OFF,        // SmiaMode
+    ISI_MIPI_OFF,        //ISI_MIPI_MODE_RAW_10,       // MipiMode
+    ISI_MIPI_4LANES,
+    ISI_AFPS_NOTSUPP,    //ISI_RES_TV1080P15, //   ISI_AFPS_NOTSUPP(ISI_AFPS_NOTSUPP | ISI_RES_TV1080P6)
+    //( ISI_AFPS_NOTSUPP | ISI_RES_TV1080P24 | ISI_RES_TV1080P20 | ISI_RES_TV1080P15 ) // AfpsResolutions
+    0,
+};
+*/
+
+static RESULT IMX334_AecSetModeParameters
+    (IMX334_Context_t * pIMX334Ctx, const IsiSensorConfig_t * pConfig) {
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s%s: (enter)\n", __func__,
+          pIMX334Ctx->isAfpsRun ? "(AFPS)" : "");
+
+    pIMX334Ctx->AecIntegrationTimeIncrement = pIMX334Ctx->one_line_exp_time;
+    pIMX334Ctx->AecMinIntegrationTime = 0.001;
+    pIMX334Ctx->AecMaxIntegrationTime = 0.033;
+
+    TRACE(IMX334_DEBUG, "%s%s: AecMaxIntegrationTime = %f \n", __func__,
+          pIMX334Ctx->isAfpsRun ? "(AFPS)" : "",
+          pIMX334Ctx->AecMaxIntegrationTime);
+
+    pIMX334Ctx->AecGainIncrement = IMX334_MIN_GAIN_STEP;
+
+    //reflects the state of the sensor registers, must equal default settings
+    pIMX334Ctx->AecCurGain = pIMX334Ctx->AecMinGain;
+    pIMX334Ctx->AecCurIntegrationTime = 0.0f;
+    pIMX334Ctx->OldGain = 0;
+    pIMX334Ctx->OldIntegrationTime = 0;
+
+    TRACE(IMX334_INFO, "%s%s: (exit)\n", __func__,
+          pIMX334Ctx->isAfpsRun ? "(AFPS)" : "");
+
+    return (result);
+}
+
+#ifdef SUBDEV_V4L2
+RESULT IMX334_Private_SetFormat(IsiSensorHandle_t handle, int width, int height, bool hdrEnable)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    TRACE(IMX334_INFO, "%s: %d %d %d\n", __func__, width, height, hdrEnable);
+
+    ioctl(pIMX334Ctx->subdev, VVSENSORIOC_S_HDR_MODE, &hdrEnable);
+
+    struct v4l2_subdev_format format;
+    format.format.width = width;
+    format.format.height = height;
+    format.which = V4L2_SUBDEV_FORMAT_ACTIVE;
+    format.pad = 0;
+    int rc = ioctl(pIMX334Ctx->subdev, VIDIOC_SUBDEV_S_FMT, &format);
+    return rc == 0 ? RET_SUCCESS : RET_FAILURE;
+}
+#endif
+
+static RESULT IMX334_IsiSetupSensorIss
+    (IsiSensorHandle_t handle, const IsiSensorConfig_t * pConfig) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pConfig) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid configuration (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    if (pIMX334Ctx->Streaming != BOOL_FALSE) {
+        return RET_WRONG_STATE;
+    }
+
+    memcpy(&pIMX334Ctx->Config, pConfig, sizeof(IsiSensorConfig_t));
+
+    /* 1.) SW reset of image sensor (via I2C register interface)  be careful, bits 6..0 are reserved, reset bit is not sticky */
+    TRACE(IMX334_DEBUG, "%s: IMX334 System-Reset executed\n", __func__);
+    osSleep(100);
+
+    result = IMX334_AecSetModeParameters(pIMX334Ctx, pConfig);
+    if (result != RET_SUCCESS) {
+        TRACE(IMX334_ERROR, "%s: SetupOutputWindow failed.\n",
+              __func__);
+        return (result);
+    }
+#ifdef SUBDEV_V4L2
+     IMX334_Private_SetFormat(pIMX334Ctx,
+                            pIMX334Ctx->SensorMode.width,
+                            pIMX334Ctx->SensorMode.height,
+                            pIMX334Ctx->SensorMode.hdr_mode);
+#endif
+
+    pIMX334Ctx->Configured = BOOL_TRUE;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return 0;
+}
+/*
+static RESULT IMX334_IsiGetSupportResolutionIss
+    (IsiSensorHandle_t handle, IsiResolutionArry_t * pResolutinArry) {
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (handle == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    pResolutinArry->count =
+        sizeof(SensorDrvSupportResoluton) / sizeof(uint32_t);
+    memcpy(pResolutinArry->ResolutionArry, SensorDrvSupportResoluton,
+           sizeof(SensorDrvSupportResoluton));
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+static RESULT IMX334_IsiChangeSensorResolutionIss
+    (IsiSensorHandle_t handle,
+     uint32_t Resolution, uint8_t * pNumberOfFramesToSkip) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    float hdr_ratio[2] = { 1.0f, 1.0f };
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (!pIMX334Ctx)
+        return (RET_WRONG_HANDLE);
+
+    if (!pNumberOfFramesToSkip)
+        return (RET_NULL_POINTER);
+
+    if ((pIMX334Ctx->Configured != BOOL_TRUE)
+        || (pIMX334Ctx->Streaming != BOOL_FALSE))
+        return RET_WRONG_STATE;
+
+    IsiSensorCaps_t Caps;
+    result = IMX334_IsiGetCapsIss(handle, &Caps);
+    if (RET_SUCCESS != result)
+        return result;
+
+    if ((Resolution & Caps.Resolution) == 0)
+        return RET_OUTOFRANGE;
+
+    if (Resolution == pIMX334Ctx->Config.Resolution) {
+        // well, no need to worry
+        *pNumberOfFramesToSkip = 0;
+    } else {
+        // change resolution
+        char *szResName = NULL;
+        result = IsiGetResolutionName(Resolution, &szResName);
+        TRACE(IMX334_DEBUG, "%s: NewRes=0x%08x (%s)\n", __func__,
+              Resolution, szResName);
+
+        // update resolution in copy of config in context
+        pIMX334Ctx->Config.Resolution = Resolution;
+
+        // tell sensor about that
+
+        // remember old exposure values
+        float OldGain = pIMX334Ctx->AecCurGain;
+        float OldIntegrationTime = pIMX334Ctx->AecCurIntegrationTime;
+
+        // update limits & stuff (reset current & old settings)
+        result =
+            IMX334_AecSetModeParameters(pIMX334Ctx,
+                        &pIMX334Ctx->Config);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR,
+                  "%s: AecSetModeParameters failed.\n", __func__);
+            return (result);
+        }
+        // restore old exposure values (at least within new exposure values' limits)
+        uint8_t NumberOfFramesToSkip;
+        float DummySetGain;
+        float DummySetIntegrationTime;
+        result = IMX334_IsiExposureControlIss(handle, OldGain,
+                         OldIntegrationTime,
+                         &NumberOfFramesToSkip,
+                         &DummySetGain,
+                         &DummySetIntegrationTime,
+                         hdr_ratio);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR,
+                  "%s: IMX334_IsiExposureControlIss failed.\n",
+                  __func__);
+            return (result);
+        }
+        // return number of frames that aren't exposed correctly
+        *pNumberOfFramesToSkip = NumberOfFramesToSkip + 1;
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+*/
+
+static RESULT IMX334_IsiChangeSensorResolutionIss(IsiSensorHandle_t handle, uint16_t width, uint16_t height)
+{
+    RESULT result = RET_SUCCESS;
+
+    return (result);
+#if 0
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    float hdr_ratio[2] = { 1.0f, 1.0f };
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    if (!pIMX334Ctx)
+        return (RET_WRONG_HANDLE);
+
+    if ((pIMX334Ctx->Configured != BOOL_TRUE)
+        || (pIMX334Ctx->Streaming != BOOL_FALSE))
+        return RET_WRONG_STATE;
+
+    IsiSensorCaps_t Caps;
+    result = IMX334_IsiGetCapsIss(handle, &Caps);
+    if (RET_SUCCESS != result)
+        return result;
+
+    if (Caps.Resolution.width != width || Caps.Resolution.height != height)
+        return RET_OUTOFRANGE;
+
+
+    if (width == pIMX334Ctx->Config.Resolution.width
+        && height == pIMX334Ctx->Config.Resolution.height) {
+        // well, no need to worry
+    } else {
+        // change resolution
+        char *szResName = NULL;
+        result = IsiGetResolutionName(Resolution, &szResName);
+        TRACE(IMX334_DEBUG, "%s: NewRes=0x%08x (%s)\n", __func__,
+              Resolution, szResName);
+
+        // update resolution in copy of config in context
+        pIMX334Ctx->Config.Resolution = Resolution;
+
+        // tell sensor about that
+
+        // remember old exposure values
+        float OldGain = pIMX334Ctx->AecCurGain;
+        float OldIntegrationTime = pIMX334Ctx->AecCurIntegrationTime;
+
+        // update limits & stuff (reset current & old settings)
+        result =
+            IMX334_AecSetModeParameters(pIMX334Ctx,
+                        &pIMX334Ctx->Config);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR,
+                  "%s: AecSetModeParameters failed.\n", __func__);
+            return (result);
+        }
+        // restore old exposure values (at least within new exposure values' limits)
+        uint8_t NumberOfFramesToSkip;
+        float DummySetGain;
+        float DummySetIntegrationTime;
+        result = IMX334_IsiExposureControlIss(handle, OldGain,
+                         OldIntegrationTime,
+                         &NumberOfFramesToSkip,
+                         &DummySetGain,
+                         &DummySetIntegrationTime,
+                         hdr_ratio);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR,
+                  "%s: IMX334_IsiExposureControlIss failed.\n",
+                  __func__);
+            return (result);
+        }
+        // return number of frames that aren't exposed correctly
+        *pNumberOfFramesToSkip = NumberOfFramesToSkip + 1;
+    }
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+#endif
+}
+
+static RESULT IMX334_IsiSensorSetStreamingIss
+    (IsiSensorHandle_t handle, bool_t on) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (pIMX334Ctx->Configured != BOOL_TRUE)
+        return RET_WRONG_STATE;
+
+    if (on) {
+        ret |= IMX334_IsiRegisterWriteIss(handle, 0x3000, 0x00);
+        ret |= IMX334_IsiRegisterWriteIss(handle, 0x3002, 0x00);
+    } else {
+        ret |= IMX334_IsiRegisterWriteIss(handle, 0x3000, 0x01);
+        ret |= IMX334_IsiRegisterWriteIss(handle, 0x3002, 0x01);
+    }
+
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    pIMX334Ctx->Streaming = on;
+
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiCheckSensorConnectionIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    uint32_t correct_id = 0x9012;
+    uint32_t sensor_id = 0;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_RESERVE_ID,
+              &correct_id);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR,
+                  "%s: Read Sensor correct ID Error! \n", __func__);
+            return (RET_FAILURE);
+        }
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_CHIP_ID,
+              &sensor_id);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR,
+                  "%s: Read Sensor chip ID Error! \n", __func__);
+            return (RET_FAILURE);
+        }
+    } else {
+        result = IMX334_IsiGetSensorRevisionIss(handle, &sensor_id);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR, "%s: Read Sensor ID Error! \n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+    }
+
+    if (correct_id != sensor_id) {
+        TRACE(IMX334_ERROR, "%s:ChipID =0x%x sensor_id=%x error! \n",
+              __func__, correct_id, sensor_id);
+        return (RET_FAILURE);
+    }
+
+    TRACE(IMX334_INFO,
+          "%s ChipID = 0x%08x, sensor_id = 0x%08x, success! \n", __func__,
+          correct_id, sensor_id);
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiGetSensorRevisionIss
+    (IsiSensorHandle_t handle, uint32_t * p_value) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    uint32_t reg_val;
+    uint32_t sensor_id;
+
+    TRACE(IMX334_INFO, "%s (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (!p_value)
+        return (RET_NULL_POINTER);
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_CHIP_ID,
+              &sensor_id);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s: Read Sensor ID Error! \n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+    } else {
+        reg_val = 0;
+        result = IMX334_IsiRegisterReadIss(handle, 0x3a04, &reg_val);
+        sensor_id = (reg_val & 0xff) << 8;
+
+        reg_val = 0;
+        result |= IMX334_IsiRegisterReadIss(handle, 0x3a05, &reg_val);
+        sensor_id |= (reg_val & 0xff);
+
+    }
+
+    *p_value = sensor_id;
+    TRACE(IMX334_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiGetGainLimitsIss
+    (IsiSensorHandle_t handle, float *pMinGain, float *pMaxGain) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pMinGain == NULL) || (pMaxGain == NULL)) {
+        TRACE(IMX334_ERROR, "%s: NULL pointer received!!\n");
+        return (RET_NULL_POINTER);
+    }
+
+    *pMinGain = pIMX334Ctx->AecMinGain;
+    *pMaxGain = pIMX334Ctx->AecMaxGain;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+    return (result);
+}
+
+static RESULT IMX334_IsiGetIntegrationTimeLimitsIss
+    (IsiSensorHandle_t handle,
+     float *pMinIntegrationTime, float *pMaxIntegrationTime) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pMinIntegrationTime == NULL) || (pMaxIntegrationTime == NULL)) {
+        TRACE(IMX334_ERROR, "%s: NULL pointer received!!\n");
+        return (RET_NULL_POINTER);
+    }
+
+    *pMinIntegrationTime = pIMX334Ctx->AecMinIntegrationTime;
+    *pMaxIntegrationTime = pIMX334Ctx->AecMaxIntegrationTime;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetGainIss(IsiSensorHandle_t handle, float *pSetGain) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pSetGain == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    *pSetGain = pIMX334Ctx->AecCurGain;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetSEF1GainIss(IsiSensorHandle_t handle, float *pSetGain) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pSetGain == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    *pSetGain = pIMX334Ctx->AecCurGainSEF1;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+RESULT IMX334_IsiGetGainIncrementIss(IsiSensorHandle_t handle, float *pIncr) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pIncr == NULL)
+        return (RET_NULL_POINTER);
+
+    *pIncr = pIMX334Ctx->AecGainIncrement;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+RESULT IMX334_IsiSetGainIss
+    (IsiSensorHandle_t handle,
+     float NewGain, float *pSetGain, float *hdr_ratio) {
+
+    RESULT result = RET_SUCCESS;
+    return result;
+    int32_t ret = 0;
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        uint32_t SensorGain = 0;
+        SensorGain = NewGain * pIMX334Ctx->gain_accuracy;
+
+    #ifdef SUBDEV_CHAR
+        if (pIMX334Ctx->enableHdr == true) {
+            uint32_t SensorHdrRatio = (uint32_t)*hdr_ratio;
+            ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_HDR_RADIO, &SensorHdrRatio);
+        }
+    #endif
+        ret |= ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_GAIN, &SensorGain);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s: set sensor gain error\n",
+                  __func__);
+            return RET_FAILURE;
+        }
+    } else {
+		uint32_t Gain = 0;
+		Gain = (uint32_t)(20*log10(NewGain)*(10/3)) ;
+                result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x01);
+                result =IMX334_IsiRegisterWriteIss(handle, 0x30e8,(Gain & 0x00ff));
+                result =IMX334_IsiRegisterWriteIss(handle, 0x30e9,(Gain & 0x0700)>>8);
+                result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x00);
+		pIMX334Ctx->OldGain = NewGain;
+        }
+
+
+    pIMX334Ctx->AecCurGain = ((float)(NewGain));
+
+    *pSetGain = pIMX334Ctx->AecCurGain;
+    TRACE(IMX334_DEBUG, "%s: g=%f\n", __func__, *pSetGain);
+    return (result);
+}
+RESULT IMX334_IsiSetSEF1GainIss(IsiSensorHandle_t handle,float NewIntegrationTime,float NewGain, float *pSetGain, float *hdr_ratio) {
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetGain || !hdr_ratio)
+        return (RET_NULL_POINTER);
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        uint32_t SensorGain = 0;
+        SensorGain = NewGain * pIMX334Ctx->gain_accuracy;
+        ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_VSGAIN, &SensorGain);
+    } else {
+	    uint32_t Gain = 0;
+            Gain = (uint32_t)(20*log10(NewGain)*(10/3)) ;
+            result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x01);
+            result =IMX334_IsiRegisterWriteIss(handle, 0x30EA, (Gain & 0x00FF));
+            result =IMX334_IsiRegisterWriteIss(handle, 0x30EB, (Gain & 0x0700)>>8);
+	    result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x00);
+            pIMX334Ctx->OldGainSEF1 = NewGain;
+    }
+
+    pIMX334Ctx->AecCurGainSEF1 = NewGain;
+    *pSetGain = pIMX334Ctx->AecCurGainSEF1;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiSetBayerPattern(IsiSensorHandle_t handle, uint8_t pattern)
+{
+
+    RESULT result = RET_SUCCESS;
+    uint8_t h_shift = 0, v_shift = 0;
+    uint32_t val_h = 0, val_l = 0;
+    uint16_t val = 0;
+    uint8_t Start_p = 0;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    // pattern 0:B 1:GB 2:GR 3:R
+    result = IMX334_IsiSensorSetStreamingIss(handle, 0);
+    switch (pattern) {
+    case BAYER_BGGR:
+        Start_p = 0;
+        break;
+    case BAYER_GBRG:
+        Start_p = 1;
+        break;
+    case BAYER_GRBG:
+        Start_p = 2;
+        break;
+    case BAYER_RGGB:
+        Start_p = 3;
+        break;
+    }
+
+    h_shift = Start_p % 2;
+    v_shift = Start_p / 2;
+
+    IMX334_IsiRegisterReadIss(handle, 0x30a0, &val_h);
+    IMX334_IsiRegisterReadIss(handle, 0x30a1, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + h_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    IMX334_IsiRegisterWriteIss(handle, 0x30a0, (uint8_t)val_h);
+    IMX334_IsiRegisterWriteIss(handle, 0x30a1, (uint8_t)val_l);
+
+    IMX334_IsiRegisterReadIss(handle, 0x30a2, &val_h);
+    IMX334_IsiRegisterReadIss(handle, 0x30a3, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + v_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    IMX334_IsiRegisterWriteIss(handle, 0x30a2, (uint8_t)val_h);
+    IMX334_IsiRegisterWriteIss(handle, 0x30a3, (uint8_t)val_l);
+
+    IMX334_IsiRegisterReadIss(handle, 0x30a4, &val_h);
+    IMX334_IsiRegisterReadIss(handle, 0x30a5, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + h_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    IMX334_IsiRegisterWriteIss(handle, 0x30a4, (uint8_t)val_h);
+    IMX334_IsiRegisterWriteIss(handle, 0x30a5, (uint8_t)val_l);
+
+    IMX334_IsiRegisterReadIss(handle, 0x30a6, &val_h);
+    IMX334_IsiRegisterReadIss(handle, 0x30a7, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + v_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    IMX334_IsiRegisterWriteIss(handle, 0x30a6, (uint8_t)val_h);
+    IMX334_IsiRegisterWriteIss(handle, 0x30a7, (uint8_t)val_l);
+
+    pIMX334Ctx->pattern = 3;
+    result = IMX334_IsiSensorSetStreamingIss(handle, pIMX334Ctx->Streaming);
+
+    return (result);
+}
+
+RESULT IMX334_IsiGetIntegrationTimeIss
+    (IsiSensorHandle_t handle, float *pSetIntegrationTime)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetIntegrationTime)
+        return (RET_NULL_POINTER);
+    *pSetIntegrationTime = pIMX334Ctx->AecCurIntegrationTime;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetSEF1IntegrationTimeIss
+    (IsiSensorHandle_t handle, float *pSetIntegrationTime)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    if (!pSetIntegrationTime)
+        return (RET_NULL_POINTER);
+
+    *pSetIntegrationTime = pIMX334Ctx->AecCurIntegrationTimeSEF1;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetIntegrationTimeIncrementIss
+    (IsiSensorHandle_t handle, float *pIncr)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pIncr)
+        return (RET_NULL_POINTER);
+
+    //_smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application)
+    *pIncr = pIMX334Ctx->AecIntegrationTimeIncrement;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiSetIntegrationTimeIss
+    (IsiSensorHandle_t handle,
+     float NewIntegrationTime,
+     float *pSetIntegrationTime,
+     uint8_t * pNumberOfFramesToSkip, float *hdr_ratio)
+{
+    RESULT result = RET_SUCCESS;
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    uint32_t exp = 0;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetIntegrationTime || !pNumberOfFramesToSkip) {
+        TRACE(IMX334_ERROR, "%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    exp = NewIntegrationTime / pIMX334Ctx->one_line_exp_time;
+
+    TRACE(IMX334_DEBUG, "%s: set AEC_PK_EXPO=0x%05x\n", __func__, exp);
+
+    if (NewIntegrationTime != pIMX334Ctx->OldIntegrationTime) {
+        if (pIMX334Ctx->KernelDriverFlag) {
+            ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_EXP, &exp);
+        } else {
+
+            exp = 2200 - exp +1;
+            exp = exp > 5?exp:5;
+            exp = exp <IMX334_VMAX - 1 ? exp:IMX334_VMAX - 1;
+            result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x01);
+            result = IMX334_IsiRegisterWriteIss(handle, 0x3058, (exp & 0x0000FF));
+            result = IMX334_IsiRegisterWriteIss(handle, 0x3059, (exp & 0x00FF00)>>8);
+            result = IMX334_IsiRegisterWriteIss(handle, 0x305a, (exp & 0x070000)>>16);
+            result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x00);
+        }
+
+        pIMX334Ctx->OldIntegrationTime = NewIntegrationTime ;
+        pIMX334Ctx->AecCurIntegrationTime = NewIntegrationTime;
+
+        *pNumberOfFramesToSkip = 1U;
+    } else {
+        *pNumberOfFramesToSkip = 0U;    //no frame skip
+    }
+
+    *pSetIntegrationTime = pIMX334Ctx->AecCurIntegrationTime;
+    TRACE(IMX334_DEBUG, "%s: Ti=%f\n", __func__, *pSetIntegrationTime);
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiSetSEF1IntegrationTimeIss(IsiSensorHandle_t handle, float NewIntegrationTime,float *pSetIntegrationTimeSEF1, uint8_t * pNumberOfFramesToSkip, float *hdr_ratio)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+    RESULT result = RET_SUCCESS;
+    uint32_t exp = 0;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (!pIMX334Ctx) {
+        TRACE(IMX334_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetIntegrationTimeSEF1 || !pNumberOfFramesToSkip) {
+        TRACE(IMX334_ERROR,"%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+    TRACE(IMX334_INFO,"%s:  maxIntegrationTime-=%f minIntegrationTime = %f\n", __func__,
+          pIMX334Ctx->AecMaxIntegrationTime, pIMX334Ctx->AecMinIntegrationTime);
+
+
+    exp = NewIntegrationTime / pIMX334Ctx->one_line_exp_time;
+
+    if (NewIntegrationTime != pIMX334Ctx->OldIntegrationTimeSEF1) {
+        if (pIMX334Ctx->KernelDriverFlag) {
+            ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_VSEXP, &exp);
+        } else {
+            exp = 2200- exp +1;
+	    exp = exp > 5 ? exp : 5;
+            exp = exp < IMX334_VMAX - 1 ? exp : IMX334_VMAX - 1;
+	    result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x01);
+	    result = IMX334_IsiRegisterWriteIss(handle, 0x305c,(exp & 0x0000ff));
+            result = IMX334_IsiRegisterWriteIss(handle, 0x305D,(exp & 0x00ff00)>>8);
+            result = IMX334_IsiRegisterWriteIss(handle, 0x305e,(exp & 0x070000)>>16);
+	    result = IMX334_IsiRegisterWriteIss(handle, 0x3001, 0x00);
+        }
+
+        pIMX334Ctx->OldIntegrationTimeSEF1 = NewIntegrationTime;
+        pIMX334Ctx->AecCurIntegrationTimeSEF1 = NewIntegrationTime;
+        *pNumberOfFramesToSkip = 1U;
+    } else {
+        *pNumberOfFramesToSkip = 0U;
+    }
+
+    *pSetIntegrationTimeSEF1 = pIMX334Ctx->AecCurIntegrationTimeSEF1;
+
+    TRACE(IMX334_DEBUG, "%s: NewIntegrationTime=%f\n", __func__,
+          NewIntegrationTime);
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiExposureControlIss(IsiSensorHandle_t handle,float NewGain,float NewIntegrationTime,
+ 				    uint8_t * pNumberOfFramesToSkip,float *pSetGain, float *pSetIntegrationTime, float *hdr_ratio)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    return result;
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pNumberOfFramesToSkip == NULL) || (pSetGain == NULL)
+        || (pSetIntegrationTime == NULL)) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+
+    if (pIMX334Ctx->enableHdr)
+    {
+        result = IMX334_IsiSetSEF1IntegrationTimeIss(handle, NewIntegrationTime,pSetIntegrationTime,pNumberOfFramesToSkip,hdr_ratio);
+        result = IMX334_IsiSetSEF1GainIss(handle, NewIntegrationTime, NewGain,pSetGain, hdr_ratio);
+    }
+    result = IMX334_IsiSetIntegrationTimeIss(handle, NewIntegrationTime,pSetIntegrationTime,pNumberOfFramesToSkip, hdr_ratio);
+    result =  IMX334_IsiSetGainIss(handle, NewGain,  pSetGain,  hdr_ratio);
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+
+    return result;
+}
+
+RESULT IMX334_IsiGetCurrentExposureIss
+    (IsiSensorHandle_t handle, float *pSetGain, float *pSetIntegrationTime, float *hdr_ratio) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pSetGain == NULL) || (pSetIntegrationTime == NULL))
+        return (RET_NULL_POINTER);
+
+    *pSetGain = pIMX334Ctx->AecCurGain;
+    *pSetIntegrationTime = pIMX334Ctx->AecCurIntegrationTime;
+    *hdr_ratio = pIMX334Ctx->CurHdrRatio;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetResolutionIss
+    (IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight) {
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    *pwidth = pIMX334Ctx->Config.Resolution.width;
+    *pheight = pIMX334Ctx->Config.Resolution.height;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiGetSensorFpsIss(IsiSensorHandle_t handle, uint32_t * pfps)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_FPS, pfps);
+        pIMX334Ctx->CurrFps = *pfps;
+    }
+
+    *pfps = pIMX334Ctx->CurrFps;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT IMX334_IsiSetSensorFpsIss(IsiSensorHandle_t handle, uint32_t fps)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+    return 0;
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+
+    if (fps > pIMX334Ctx->MaxFps) {
+        TRACE(IMX334_ERROR,
+              "%s: set fps(%d) out of range, correct to %d (%d, %d)\n",
+              __func__, fps, pIMX334Ctx->MaxFps, pIMX334Ctx->MinFps,
+              pIMX334Ctx->MaxFps);
+        fps = pIMX334Ctx->MaxFps;
+    }
+    if (fps < pIMX334Ctx->MinFps) {
+        TRACE(IMX334_ERROR,
+              "%s: set fps(%d) out of range, correct to %d (%d, %d)\n",
+              __func__, fps, pIMX334Ctx->MinFps, pIMX334Ctx->MinFps,
+              pIMX334Ctx->MaxFps);
+        fps = pIMX334Ctx->MinFps;
+    }
+    if (pIMX334Ctx->KernelDriverFlag) {
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_FPS, &fps);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s: set sensor fps=%d error\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+#ifdef SUBDEV_CHAR
+        struct vvcam_ae_info_s ae_info;
+        ret =
+            ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_AE_INFO, &ae_info);
+        if (ret != 0) {
+            TRACE(IMX334_ERROR, "%s:sensor get ae info error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+        pIMX334Ctx->one_line_exp_time =
+            (float)ae_info.one_line_exp_time_ns / 1000000000;
+        pIMX334Ctx->MaxIntegrationLine = ae_info.max_integration_time;
+        pIMX334Ctx->AecMaxIntegrationTime =
+            pIMX334Ctx->MaxIntegrationLine *
+            pIMX334Ctx->one_line_exp_time;
+#endif
+    } else {
+        uint16_t FrameLengthLines;
+        FrameLengthLines =
+            pIMX334Ctx->FrameLengthLines * pIMX334Ctx->MaxFps / fps;
+        result =
+            IMX334_IsiRegisterWriteIss(handle, 0x30b2,
+                           (FrameLengthLines >> 8) & 0xff);
+        result |=
+            IMX334_IsiRegisterWriteIss(handle, 0x30b3,
+                           FrameLengthLines & 0xff);
+        if (result != RET_SUCCESS) {
+            TRACE(IMX334_ERROR,
+                  "%s: Invalid sensor handle (NULL pointer detected)\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+        pIMX334Ctx->CurrFps = fps;
+        pIMX334Ctx->CurFrameLengthLines = FrameLengthLines;
+        pIMX334Ctx->MaxIntegrationLine =
+            pIMX334Ctx->CurFrameLengthLines - 3;
+        pIMX334Ctx->AecMaxIntegrationTime =
+            pIMX334Ctx->MaxIntegrationLine *
+            pIMX334Ctx->one_line_exp_time;
+    }
+
+    TRACE(IMX334_INFO, "%s: set sensor fps = %d\n", __func__,
+          pIMX334Ctx->CurrFps);
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+/*
+RESULT IMX334_IsiGetAfpsInfoIss(IsiSensorHandle_t handle,
+                uint32_t Resolution, IsiAfpsInfo_t * pAfpsInfo)
+{
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    if (pIMX334Ctx == NULL) {
+        TRACE(IMX334_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pAfpsInfo == NULL)
+        return (RET_NULL_POINTER);
+
+    // set current resolution data in info struct
+    pAfpsInfo->AecMaxGain = pIMX334Ctx->AecMaxGain;
+    pAfpsInfo->AecMinGain = pIMX334Ctx->AecMinGain;
+    pAfpsInfo->AecMaxIntTime = pIMX334Ctx->AecMinIntegrationTime;
+    pAfpsInfo->AecMaxIntTime = pIMX334Ctx->AecMaxIntegrationTime;
+    pAfpsInfo->AecSlowestResolution = pIMX334Ctx->Resolution;
+    pAfpsInfo->CurrResolution = pIMX334Ctx->Resolution;
+    pAfpsInfo->CurrMaxIntTime = pIMX334Ctx->AecMaxIntegrationTime;
+    pAfpsInfo->CurrMinIntTime = pIMX334Ctx->AecMinIntegrationTime;
+    pAfpsInfo->Stage[0].MaxIntTime = pIMX334Ctx->AecMaxIntegrationTime;
+    pAfpsInfo->Stage[0].Resolution = pIMX334Ctx->Resolution;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+*/
+
+static RESULT IMX334_IsiActivateTestPattern(IsiSensorHandle_t handle,
+                        const bool_t enable)
+{
+    RESULT result = RET_SUCCESS;
+
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    if (pIMX334Ctx->Configured != BOOL_TRUE)
+        return RET_WRONG_STATE;
+
+    if (BOOL_TRUE == enable) {
+        result = IMX334_IsiRegisterWriteIss(handle, 0x3253, 0x80);
+    } else {
+        result = IMX334_IsiRegisterWriteIss(handle, 0x3253, 0x00);
+    }
+    pIMX334Ctx->TestPattern = enable;
+
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+/*
+static RESULT IMX334_IsiEnableHdr(IsiSensorHandle_t handle, const bool_t enable)
+{
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    TRACE(IMX334_INFO, "%s: (enter)\n", __func__);
+
+    IMX334_Context_t *pIMX334Ctx = (IMX334_Context_t *) handle;
+    if (pIMX334Ctx == NULL || pIMX334Ctx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+#ifdef SUBDEV_CHAR
+    HalContext_t *pHalCtx = (HalContext_t *) pIMX334Ctx->IsiCtx.HalHandle;
+    result = IMX334_IsiSensorSetStreamingIss(handle, 0);
+
+    if (pIMX334Ctx->KernelDriverFlag) {
+        uint32_t hdr_mode;
+        if (enable == 0) {
+            hdr_mode = SENSOR_MODE_LINEAR;
+        } else {
+            hdr_mode = SENSOR_MODE_HDR_STITCH;
+        }
+        ret =
+            ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_HDR_MODE,
+              &hdr_mode);
+    } else {
+        result |=
+            IMX334_IsiRegisterWriteIss(handle, 0x3190,
+                           enable ? 0x05 : 0x08);
+    }
+    result |=
+        IMX334_IsiSensorSetStreamingIss(handle, pIMX334Ctx->Streaming);
+#endif
+
+    if (result != 0 || ret != 0) {
+        TRACE(IMX334_ERROR, "%s: change hdr status error\n", __func__);
+        return RET_FAILURE;
+    }
+
+    pIMX334Ctx->enableHdr = enable;
+    TRACE(IMX334_INFO, "%s: (exit)\n", __func__);
+    return RET_SUCCESS;
+}
+*/
+
+RESULT IMX334_IsiGetSensorIss(IsiSensor_t *pIsiSensor)
+{
+    RESULT result = RET_SUCCESS;
+    TRACE( IMX334_INFO, "%s (enter)\n", __func__);
+
+    if ( pIsiSensor != NULL ) {
+        pIsiSensor->pszName                         = SensorName;
+        pIsiSensor->pIsiCreateSensorIss             = IMX334_IsiCreateSensorIss;
+
+        pIsiSensor->pIsiInitSensorIss               = IMX334_IsiInitSensorIss;
+        pIsiSensor->pIsiGetSensorModeIss            = IMX334_IsiGetSensorModeIss;
+        pIsiSensor->pIsiResetSensorIss              = IMX334_IsiResetSensorIss;
+        pIsiSensor->pIsiReleaseSensorIss            = IMX334_IsiReleaseSensorIss;
+        pIsiSensor->pIsiGetCapsIss                  = IMX334_IsiGetCapsIss;
+        pIsiSensor->pIsiSetupSensorIss              = IMX334_IsiSetupSensorIss;
+        pIsiSensor->pIsiChangeSensorResolutionIss   = IMX334_IsiChangeSensorResolutionIss;
+        pIsiSensor->pIsiSensorSetStreamingIss       = IMX334_IsiSensorSetStreamingIss;
+        pIsiSensor->pIsiSensorSetPowerIss           = IMX334_IsiSensorSetPowerIss;
+        pIsiSensor->pIsiCheckSensorConnectionIss    = IMX334_IsiCheckSensorConnectionIss;
+        pIsiSensor->pIsiGetSensorRevisionIss        = IMX334_IsiGetSensorRevisionIss;
+        pIsiSensor->pIsiRegisterReadIss             = IMX334_IsiRegisterReadIss;
+        pIsiSensor->pIsiRegisterWriteIss            = IMX334_IsiRegisterWriteIss;
+
+        /* AEC functions */
+        pIsiSensor->pIsiExposureControlIss          = IMX334_IsiExposureControlIss;
+        pIsiSensor->pIsiGetGainLimitsIss            = IMX334_IsiGetGainLimitsIss;
+        pIsiSensor->pIsiGetIntegrationTimeLimitsIss = IMX334_IsiGetIntegrationTimeLimitsIss;
+        pIsiSensor->pIsiGetCurrentExposureIss       = IMX334_IsiGetCurrentExposureIss;
+        pIsiSensor->pIsiGetVSGainIss                    = IMX334_IsiGetSEF1GainIss;
+        pIsiSensor->pIsiGetGainIss                      = IMX334_IsiGetGainIss;
+        pIsiSensor->pIsiGetGainIncrementIss             = IMX334_IsiGetGainIncrementIss;
+        pIsiSensor->pIsiSetGainIss                      = IMX334_IsiSetGainIss;
+        pIsiSensor->pIsiGetIntegrationTimeIss           = IMX334_IsiGetIntegrationTimeIss;
+        pIsiSensor->pIsiGetVSIntegrationTimeIss         = IMX334_IsiGetSEF1IntegrationTimeIss;
+        pIsiSensor->pIsiGetIntegrationTimeIncrementIss  = IMX334_IsiGetIntegrationTimeIncrementIss;
+        pIsiSensor->pIsiSetIntegrationTimeIss           = IMX334_IsiSetIntegrationTimeIss;
+        pIsiSensor->pIsiQuerySensorIss                  = IMX334_IsiQuerySensorIss;
+        pIsiSensor->pIsiGetResolutionIss                = IMX334_IsiGetResolutionIss;
+        pIsiSensor->pIsiGetSensorFpsIss                 = IMX334_IsiGetSensorFpsIss;
+        pIsiSensor->pIsiSetSensorFpsIss                 = IMX334_IsiSetSensorFpsIss;
+
+        /* AWB specific functions */
+
+        /* Testpattern */
+        pIsiSensor->pIsiActivateTestPattern         = IMX334_IsiActivateTestPattern;
+        pIsiSensor->pIsiSetBayerPattern             = IMX334_IsiSetBayerPattern;
+
+    } else {
+        result = RET_NULL_POINTER;
+    }
+
+    TRACE( IMX334_INFO, "%s (exit)\n", __func__);
+    return ( result );
+}
+
+/*****************************************************************************
+* each sensor driver need declare this struct for isi load
+*****************************************************************************/
+IsiCamDrvConfig_t IMX334_IsiCamDrvConfig = {
+    0,
+    IMX334_IsiQuerySensorSupportIss,
+    IMX334_IsiGetSensorIss,
+    {
+     SensorName,            /**< IsiSensor_t.pszName */
+     0,            /**< IsiSensor_t.pIsiInitIss>*/
+     0,              /**< IsiSensor_t.pIsiResetSensorIss>*/
+     0,            /**< IsiSensor_t.pRegisterTable */
+     0,            /**< IsiSensor_t.pIsiSensorCaps */
+     0,            /**< IsiSensor_t.pIsiCreateSensorIss */
+     0,            /**< IsiSensor_t.pIsiReleaseSensorIss */
+     0,            /**< IsiSensor_t.pIsiGetCapsIss */
+     0,            /**< IsiSensor_t.pIsiSetupSensorIss */
+     0,            /**< IsiSensor_t.pIsiChangeSensorResolutionIss */
+     0,            /**< IsiSensor_t.pIsiSensorSetStreamingIss */
+     0,            /**< IsiSensor_t.pIsiSensorSetPowerIss */
+     0,            /**< IsiSensor_t.pIsiCheckSensorConnectionIss */
+     0,            /**< IsiSensor_t.pIsiGetSensorRevisionIss */
+     0,            /**< IsiSensor_t.pIsiRegisterReadIss */
+     0,            /**< IsiSensor_t.pIsiRegisterWriteIss */
+
+     0,            /**< IsiSensor_t.pIsiExposureControlIss */
+     0,            /**< IsiSensor_t.pIsiGetGainLimitsIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeLimitsIss */
+     0,            /**< IsiSensor_t.pIsiGetCurrentExposureIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIss */
+     0,            /**< IsiSensor_t.pIsiGetVSGainIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIncrementIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIncrementIss */
+     0,            /**< IsiSensor_t.pIsiSetGainIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeIncrementIss */
+     0,            /**< IsiSensor_t.pIsiSetIntegrationTimeIss */
+     0,            /**< IsiSensor_t.pIsiGetResolutionIss */
+     0,            /**< IsiSensor_t.pIsiGetAfpsInfoIss */
+
+     0,            /**< IsiSensor_t.pIsiMdiInitMotoDriveMds */
+     0,            /**< IsiSensor_t.pIsiMdiSetupMotoDrive */
+     0,            /**< IsiSensor_t.pIsiMdiFocusSet */
+     0,            /**< IsiSensor_t.pIsiMdiFocusGet */
+     0,            /**< IsiSensor_t.pIsiMdiFocusCalibrate */
+     0,            /**< IsiSensor_t.pIsiGetSensorMipiInfoIss */
+     0,            /**< IsiSensor_t.pIsiActivateTestPattern */
+     0,            /**< IsiSensor_t.pIsiEnableHdr */
+     0,            /**< IsiSensor_t.pIsiSetBayerPattern */
+     }
+};

File diff suppressed because it is too large
+ 544 - 0
drivers/IMX334/IMX334.xml


File diff suppressed because it is too large
+ 674 - 0
drivers/IMX334/IMX334_3864x2180.xml


+ 102 - 0
drivers/IMX334/IMX334_mipi4lane_3840_2160_raw12_800mbps_3dol_init.txt

@@ -0,0 +1,102 @@
+0x3000 0x01
+0x3001 0x00
+0x3002 0x01
+0x3003 0x00
+0x300C 0x3B
+0x300D 0x2A
+0x3030 0xc4
+
+
+0x319f 0x00
+0x3a20 0x20
+
+0x3031 0x17
+
+0x3048 0x01
+0x3049 0x02
+0x304A 0x02
+0x304B 0x02
+0x304C 0x13
+
+0x3034 0xEC
+0x3035 0x18
+
+0x3059 0x15
+0x3068 0x91
+0x30E8 0x14
+0x314C 0x29
+0x314D 0x01
+0x315A 0x03
+0x3168 0xA0
+0x316A 0x7E
+0x31A1 0x00
+0x31D7 0x01
+0x3288 0x21
+0x328A 0x02
+0x3414 0x05
+0x3416 0x18
+0x35AC 0x0E
+0x3648 0x01
+0x364A 0x04
+0x364C 0x04
+0x3678 0x01
+0x367C 0x31
+0x367E 0x31
+0x3708 0x02
+0x3714 0x01
+0x3715 0x02
+0x3716 0x02
+0x3717 0x02
+0x371C 0x3D
+0x371D 0x3F
+0x372C 0x00
+0x372D 0x00
+0x372E 0x46
+0x372F 0x00
+0x3730 0x89
+0x3731 0x00
+0x3732 0x08
+0x3733 0x01
+0x3734 0xFE
+0x3735 0x05
+0x375D 0x00
+0x375E 0x00
+0x375F 0x61
+0x3760 0x06
+0x3768 0x1B
+0x3769 0x1B
+0x376A 0x1A
+0x376B 0x19
+0x376C 0x18
+0x376D 0x14
+0x376E 0x0F
+0x3776 0x00
+0x3777 0x00
+0x3778 0x46
+0x3779 0x00
+0x377A 0x08
+0x377B 0x01
+0x377C 0x45
+0x377D 0x01
+0x377E 0x23
+0x377F 0x02
+0x3780 0xD9
+0x3781 0x03
+0x3782 0xF5
+0x3783 0x06
+0x3784 0xA5
+0x3788 0x0F
+0x378A 0xD9
+0x378B 0x03
+0x378C 0xEB
+0x378D 0x05
+0x378E 0x87
+0x378F 0x06
+0x3790 0xF5
+0x3792 0x43
+0x3794 0x7A
+0x3796 0xA1
+0x3E04 0x0E
+
+
+

+ 165 - 0
drivers/IMX334/IMX334_mipi4lane_3864_2180_raw12_800mbps_init.txt

@@ -0,0 +1,165 @@
+0x3000 0x01
+0x3001 0x00
+0x3002 0x01
+0x3003 0x00
+0x300C 0x3B
+0x300D 0x2A
+0x3018 0x00
+0x302C 0x30
+0x302D 0x00
+0x302E 0x18
+0x302F 0x0F
+
+0x3030 0xCA
+0x3031 0x08
+0x3032 0x00
+
+0x3033 0x00
+
+0x3034 0x4C
+0x3035 0x04
+
+0x304C 0x14
+0x3050 0x01
+0x3076 0x84
+0x3077 0x08
+0x3090 0x84
+0x3091 0x08
+0x30C6 0x00
+0x30C7 0x00
+0x30CE 0x00
+0x30CF 0x00
+0x30D8 0xF8
+0x30D9 0x11
+0x3117 0x00
+0x314C 0x29
+0x314D 0x01
+0x315A 0x06
+0x3168 0xA0
+0x316A 0x7E
+0x3199 0x00
+0x319D 0x01
+0x319E 0x02
+0x31A0 0x2A
+0x31D4 0x00
+0x31D5 0x00
+0x31DD 0x03
+0x3288 0x21
+0x328A 0x02
+0x3300 0x00
+0x3302 0x32
+0x3303 0x00
+0x3308 0x84
+0x3309 0x08
+0x3414 0x05
+0x3416 0x18
+0x341C 0x47
+0x341D 0x00
+0x35AC 0x0E
+0x3648 0x01
+0x364A 0x04
+0x364C 0x04
+0x3678 0x01
+0x367C 0x31
+0x367E 0x31
+0x3708 0x02
+0x3714 0x01
+0x3715 0x02
+0x3716 0x02
+0x3717 0x02
+0x371C 0x3D
+0x371D 0x3F
+0x372C 0x00
+0x372D 0x00
+0x372E 0x46
+0x372F 0x00
+0x3730 0x89
+0x3731 0x00
+0x3732 0x08
+0x3733 0x01
+0x3734 0xFE
+0x3735 0x05
+0x375D 0x00
+0x375E 0x00
+0x375F 0x61
+0x3760 0x06
+0x3768 0x1B
+0x3769 0x1B
+0x376A 0x1A
+0x376B 0x19
+0x376C 0x18
+0x376D 0x14
+0x376E 0x0F
+0x3776 0x00
+0x3777 0x00
+0x3778 0x46
+0x3779 0x00
+0x377A 0x08
+0x377B 0x01
+0x377C 0x45
+0x377D 0x01
+0x377E 0x23
+0x377F 0x02
+0x3780 0xD9
+0x3781 0x03
+0x3782 0xF5
+0x3783 0x06
+0x3784 0xA5
+0x3788 0x0F
+0x378A 0xD9
+0x378B 0x03
+0x378C 0xEB
+0x378D 0x05
+0x378E 0x87
+0x378F 0x06
+0x3790 0xF5
+0x3792 0x43
+0x3794 0x7A
+0x3796 0xA1
+0x3A01 0x03
+0x3A18 0x7F
+0x3A19 0x00
+0x3A1A 0x37
+0x3A1B 0x00
+0x3A1C 0x37
+0x3A1D 0x00
+0x3A1E 0xF7
+0x3A1F 0x00
+0x3A20 0x3F
+0x3A21 0x00
+0x3A22 0x6F
+0x3A23 0x00
+0x3A24 0x3F
+0x3A25 0x00
+0x3A26 0x5F
+0x3A27 0x00
+0x3A28 0x2F
+0x3A29 0x00
+0x3E04 0x0E
+0x3078 0x02
+0x3079 0x00
+0x307A 0x00
+0x307B 0x00
+0x3081 0x00
+0x3082 0x00
+0x3083 0x00
+0x3088 0x02
+0x3094 0x00
+0x3095 0x00
+0x3096 0x00
+0x309C 0x00
+0x309D 0x00
+0x309E 0x00
+0x30A4 0x00
+0x30A5 0x00
+0x304E 0x00
+0x304F 0x00
+0x3074 0xB0
+0x3075 0x00
+0x308E 0xB1
+0x308F 0x00
+0x30B6 0x00
+0x30B7 0x00
+0x3116 0x00
+0x3080 0x02
+0x309B 0x02

+ 207 - 0
drivers/IMX334/IMX334_priv.h

@@ -0,0 +1,207 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file IMX334_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup IMX334_priv
+ * @{
+ *
+ */
+#ifndef __IMX334_PRIV_H__
+#define __IMX334_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct IMX334_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    IsiResolution_t       Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurGain;
+    float               AecCurIntegrationTime;
+    float               AecCurGainSEF1;
+    float               AecCurIntegrationTimeSEF1;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldGainSEF1;
+    uint32_t            OldIntegrationTimeSEF1;
+
+    int                 subdev;
+    bool                enableHdr;
+    uint8_t             pattern;
+    float               CurHdrRatio;
+} IMX334_Context_t;
+
+static RESULT IMX334_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT IMX334_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT IMX334_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT IMX334_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT IMX334_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT IMX334_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT IMX334_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT IMX334_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT IMX334_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT IMX334_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT IMX334_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT IMX334_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT IMX334_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT IMX334_IsiGetSEF1GainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT IMX334_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT IMX334_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT IMX334_IsiSetSEF1GainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT IMX334_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT IMX334_IsiGetSEF1IntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT IMX334_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT IMX334_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT IMX334_IsiSetSEF1IntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+static RESULT IMX334_IsiGetResolutionIss
+    (IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT IMX334_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} IMX334priv */
+
+#endif    /* __IMX334PRIV_H__ */
+

+ 518 - 0
drivers/SC132GS/3aconfig_SC132GS.json

@@ -0,0 +1,518 @@
+{
+    "root" : [
+        {
+            "classname" : "Aev1",
+            "enable" : false
+        },
+        {
+            "classname" : "Aev2",
+            "enable" : true,
+            "motionThreshold" : 0.5,
+            "roiWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 2.6,
+            "setPoint" : 120,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5
+        },
+        {
+            "classname" : "Aehdr",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "AdaptiveAe",
+            "enable" : false,
+            "motionThreshold" : 0.7,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "targetFilter"  : 0.5,
+            "wdrContrast.min" : 10,
+            "wdrContrast.max" : 110,
+            "lowlight" : {
+                "linear_repress" : [1, 0.8, 0.6, 0.4, 0.4],
+                "linear_gain" : [4, 8, 16, 32, 100],
+                "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8],
+                "hdr_gain" : [4, 8, 16, 32, 100]
+            },
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "Awbv2",
+            "enable" : false,
+            "illuorder" : "A, D50, D65, D75, TL84, F12, CWF",
+            "indoor" : [1, 1, 1, 1, 1, 1, 1],
+            "outdoor" : [1, 1, 1, 1, 1, 1, 1],
+            "transition" : [1, 1, 1, 1, 1, 1, 1],
+            "avg" : 0.0
+        },
+        {
+            "classname" : "IspController",
+            "enable" : true
+        },
+        {
+            "classname" : "AutoHdr",
+            "enable" : false
+        },
+        {
+            "classname" : "DciHist",
+            "enable" : false,
+            "gaussMeanPos" : 64,
+            "gaussSigmaPos" : 128,
+            "gaussAmpPos" : 1.0,
+            "gaussMeanNeg" : 0,
+            "gaussSigmaNeg" : 128,
+            "gaussAmpNeg" : 1.0
+        },
+        {
+            "classname" : "SensorController",
+            "enable" : true
+        },
+        {
+            "classname" : "AGamma64",
+            "forcecreate" : false,
+            "enable" : false,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 915, 930, 946, 961, 977, 992, 1008, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ACproc",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1, 1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0],
+                    "saturation" : [1, 1, 1, 1, 1, 1],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                }
+            ]
+        },
+        {
+            "classname" : "Aee",
+            "forcecreate" : false,
+            "enable" : false,
+            "disable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [2048, 2048, 2048, 2048, 2048, 2048],
+                    "ydown" : [2048, 2048, 2048, 2048, 2048, 2048],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [1000, 1000, 1000, 1000, 500, 200]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [8000, 8000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1500, 600, 200]
+                }
+            ]
+        },
+        {
+            "classname" : "ACa",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enableCA" : [1, 1, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enableCA" : [0, 0, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ], 
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ADmsc2",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "demoire_enable" : true,		
+            "demoire_area_thr" : 3,
+            "demoire_sat_shrink" : 5,
+            "demoire_r2" : 256,
+            "demoire_r1" : 0,           
+		    "demoire_t2_shift" : 2,
+            "demoire_t1" : 180,
+            "demoire_edge_r2" : 256,
+            "demoire_edge_r1" : 20,
+            "demoire_edge_t2_shift" : 4,
+            "demoire_edge_t1" :20,	
+            "depurple_enable" : true,		
+            "depurple_red_sat" : true,	
+            "depurple_blue_sat" : true,	
+            "depurple_sat_shrink" : 8,				
+            "depurple_thr" : 8,
+            "skin_enable" : false,			
+            "cb_thr_max_2047" : 10,
+            "cb_thr_min_2047" : 8,
+            "cr_thr_max_2047" : 10,
+            "cr_thr_min_2047" : 8,
+            "y_thr_max_2047" : 10,
+            "y_thr_min_2047" : 8,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [1, 1, 1, 1, 1, 1],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [10, 10, 10, 10, 10, 10],
+                    "facwhite" : [10, 10, 10, 10, 10, 10],
+                    "maxblack" : [20, 20, 20, 20, 20, 20],
+                    "maxwhite" : [20, 20, 20, 20, 20, 20],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],					
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [0, 0, 0, 0, 0, 0],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [200, 200, 100, 50, 20, 20],
+                    "facwhite" : [200, 200, 150, 80, 40, 20],
+                    "maxblack" : [200, 200, 100, 100, 100, 100],
+                    "maxwhite" : [200, 200, 200, 200, 200, 200],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],				
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                }
+            ]
+        },
+        {
+            "classname" : "AWdr4",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : true,
+            "backlight" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                }
+            ],
+            "entropy_slope": 200,
+            "entropy_base": 700,
+            "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0],
+            "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023],
+            "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575],
+            "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575],
+            "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575]
+        },
+        {
+
+            "classname" : "A3dnrv3",
+            "forcecreate" : false,
+            "enable" : false,
+	    "disable" : false,
+            "autonoiseLevel": true,
+            "tnr_en" : false,
+            "nlm_en" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                }
+            ]
+        },
+        {
+            "classname" : "A2dnrv5",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                }
+            ]
+        },
+        {
+            "classname" : "ADpf",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16],
+                    "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16],
+                    "Div" : [65, 65, 65, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ABlc",
+            "forcecreate" : true,
+            "enable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 16],
+                    "blc" : [256, 256]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 16],
+                    "blc" : [256, 256]
+                }
+            ]
+        }
+    ]
+}

+ 35 - 0
drivers/SC132GS/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module sc132gs)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

+ 2 - 0
drivers/SC132GS/README.txt

@@ -0,0 +1,2 @@
+2 lane 的配置是27mhz的时钟源
+4 lane 的时钟源是24mhz

+ 1996 - 0
drivers/SC132GS/SC132GS.c

@@ -0,0 +1,1996 @@
+#include <ebase/types.h>
+#include <ebase/trace.h>
+#include <ebase/builtins.h>
+#include <common/return_codes.h>
+#include <common/misc.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <isi/isi.h>
+#include <isi/isi_iss.h>
+#include <isi/isi_priv.h>
+#include <vvsensor.h>
+#include "SC132GS_priv.h"
+#include "sc132gs.h"
+
+CREATE_TRACER( SC132GS_INFO , "SC132GS: ", INFO,    0);
+CREATE_TRACER( SC132GS_WARN , "SC132GS: ", WARNING, 1);
+CREATE_TRACER( SC132GS_ERROR, "SC132GS: ", ERROR,   1);
+CREATE_TRACER( SC132GS_DEBUG,     "SC132GS: ", INFO, 1);
+CREATE_TRACER( SC132GS_REG_INFO , "SC132GS: ", INFO, 1);
+CREATE_TRACER( SC132GS_REG_DEBUG, "SC132GS: ", INFO, 1);
+
+#ifdef SUBDEV_V4L2
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <linux/videodev2.h>
+#include <linux/v4l2-subdev.h>
+#undef TRACE
+#define TRACE(x, ...)
+#endif
+#define SC132GS_MIN_GAIN_STEP    ( 1.0f/16.0f )  /**< min gain step size used by GUI (hardware min = 1/16; 1/16..32/16 depending on actual gain ) */
+#define SC132GS_MAX_GAIN_AEC     ( 32.0f )       /**< max. gain used by the AEC (arbitrarily chosen, hardware limit = 62.0, driver limit = 32.0 ) */
+#define SC132GS_VS_MAX_INTEGRATION_TIME (0.0018)
+
+/*****************************************************************************
+ *Sensor Info
+*****************************************************************************/
+static const char SensorName[16] = "SC132GS";
+
+static struct vvcam_mode_info psc132gs_mode_info[] = {
+    {
+        .index     = 0,
+        .width     = 1080,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 607, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10, 607mbps(sensor clk 24m), img resolution is 1080*1280",
+    },
+    {
+        .index     = 1,
+        .width     = 1080,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 607, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10, 607mbps(sensor clk 24m), img resolution is 1080*1280, dual camera synchronization mode, sensor is master",
+    },
+    {
+        .index     = 2,
+        .width     = 1080,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 607, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10, 607mbps(sensor clk 24m), img resolution is 1080*1280, dual camera synchronization mode, sensor is slave",
+    },
+    {
+        .index     = 3,
+        .width     = 960,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 360, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10 30fps, 360mbps, img resolution is 960*1280",
+    },
+    {
+        .index     = 4,
+        .width     = 960,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 360, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10 30fps, 360mbps, img resolution is 960*1280, dual camera synchronization mode, sensor is master",
+    },
+    {
+        .index     = 5,
+        .width     = 960,
+        .height    = 1280,
+        .fps       = 30,
+        .hdr_mode  = SENSOR_MODE_LINEAR,
+        .bit_width = 10,
+        .bayer_pattern = BAYER_BGGR,
+        .mipi_phy_freq = 360, //mbps
+        .mipi_line_num = 2,
+        .preg_data = (void *)"sc132gs sensor liner mode, raw10 30fps, 360mbps, img resolution is 960*1280, dual camera synchronization mode, sensor is slave",
+    },
+
+};
+
+static RESULT SC132GS_IsiRegisterWriteIss(IsiSensorHandle_t handle, const uint32_t address, const uint32_t value);
+
+typedef struct {
+    int ana_reg_val;
+    float step;
+    float max_val;
+} sc132gs_gain_map_t;
+
+static sc132gs_gain_map_t sc132gs_gain_map[] = {
+    {0x03, 0.031, 1},
+    {0x03, 0.031, 1.781},
+    {0x023, 0.056, 3.568},
+    {0x027, 0.114, 7.137},
+    {0x02f, 0.226, 14.273},
+    {0x03f, 0.450, 28.547},
+};
+
+static int sc132gs_set_gain(IsiSensorHandle_t handle, float gain, float *set_gain)
+{
+//Normal 模式/ HDR 模式下的长曝光数据
+#define ANA_GAIN 0x3e08
+#define ANA_FINE 0x3e09
+//HDR 模式下的短曝光数据
+#define ANA_VS_GAIN 0x3e12
+#define ANA_VS_FINE 0x3e13
+
+    int ret = 0;
+    int i = 0;
+    uint32_t ana_gain_val = 0;
+    uint32_t ana_fine_val = 0;
+
+    if (gain <= 1.0) {
+        ana_gain_val = 0x3;
+        ana_fine_val = 0x20;
+        *set_gain = 1;
+    } else if (gain >= 28.547) {
+        ana_gain_val = 0x3f;
+        ana_fine_val = 0x3f;
+        *set_gain = 28.547;
+    } else {
+        for(i = 0; i < sizeof(sc132gs_gain_map) / sizeof(sc132gs_gain_map[0]); i++) {
+            if (sc132gs_gain_map[i].max_val > gain) {
+                ana_gain_val = sc132gs_gain_map[i].ana_reg_val;
+                ana_fine_val =  0x20 + (gain - sc132gs_gain_map[i - 1].max_val) / sc132gs_gain_map[i].step;
+                *set_gain = sc132gs_gain_map[i - 1].max_val + (gain - sc132gs_gain_map[i - 1].max_val) / sc132gs_gain_map[i].step;
+                break;
+            }
+        }
+
+        if (ana_fine_val > 0x3f) {
+            ana_fine_val = 0x3f;
+            *set_gain = sc132gs_gain_map[i].max_val;
+        }
+    }
+
+    ret |= SC132GS_IsiRegisterWriteIss(handle, ANA_GAIN, ana_gain_val);
+    ret |= SC132GS_IsiRegisterWriteIss(handle, ANA_FINE, ana_fine_val);
+
+    if (ret != 0) {
+        return -1;
+    }
+
+    return  ret;
+}
+
+long __sc132gs_set_exposure(IsiSensorHandle_t handle, int coarse_itg,
+				 int gain, int digitgain, SC132GS_EXPOSURE_SETTING_t type)
+
+{
+
+	return 0;
+}
+
+static RESULT SC132GS_IsiSensorSetPowerIss(IsiSensorHandle_t handle, bool_t on) {
+    RESULT result = RET_SUCCESS;
+
+    int ret = 0;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    int32_t enable = on;
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_POWER, &enable);
+    if (ret != 0) {
+        // to do
+        //TRACE(SC132GS_ERROR, "%s: sensor set power error!\n", __func__);
+        //return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiResetSensorIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_RESET, NULL);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+    sleep(0.01);
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x103, 1);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    sleep(0.01);
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x103, 0);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+#ifdef SUBDEV_CHAR
+static RESULT SC132GS_IsiSensorSetClkIss(IsiSensorHandle_t handle, uint32_t clk) {
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_CLK, &clk);
+    if (ret != 0) {
+        // to do
+        //TRACE(SC132GS_ERROR, "%s: sensor set clk error!\n", __func__);
+        //return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiSensorGetClkIss
+    (IsiSensorHandle_t handle, uint32_t * pclk) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_CLK, pclk);
+    if (ret != 0) {
+        // to do
+        //TRACE(SC132GS_ERROR, "%s: sensor get clk error!\n", __func__);
+        //return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiConfigSensorSCCBIss(IsiSensorHandle_t handle)
+{
+    RESULT result = RET_SUCCESS;
+    return result;
+    int ret = 0;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    static const IsiSccbInfo_t SensorSccbInfo = {
+        .slave_addr = (0x31),  //0x30 or 0x32
+        .addr_byte = 2,
+        .data_byte = 1,
+    };
+
+    struct vvcam_sccb_cfg_s sensor_sccb_config;
+    sensor_sccb_config.slave_addr = SensorSccbInfo.slave_addr;
+    sensor_sccb_config.addr_byte = SensorSccbInfo.addr_byte;
+    sensor_sccb_config.data_byte = SensorSccbInfo.data_byte;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_SENSOR_SCCB_CFG,
+          &sensor_sccb_config);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor config sccb info error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+
+    return RET_SUCCESS;
+}
+#endif
+
+static RESULT SC132GS_IsiRegisterReadIss
+    (IsiSensorHandle_t handle, const uint32_t address, uint32_t * p_value) {
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    struct vvcam_sccb_data sccb_data;
+    sccb_data.addr = address;
+    sccb_data.data = 0;
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_READ_REG, &sccb_data);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: read sensor register error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    *p_value = sccb_data.data;
+
+    TRACE(SC132GS_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+}
+
+static RESULT SC132GS_IsiRegisterWriteIss
+    (IsiSensorHandle_t handle, const uint32_t address, const uint32_t value) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    struct vvcam_sccb_data sccb_data;
+    sccb_data.addr = address;
+    sccb_data.data = value;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_WRITE_REG, &sccb_data);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: write sensor register error!\n",
+              __func__);
+        return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit) result = %d\n", __func__, result);
+    return (result);
+}
+
+static RESULT SC132GS_IsiQuerySensorSupportIss(HalHandle_t  HalHandle, vvcam_mode_info_array_t *pSensorSupportInfo)
+{
+    //int ret = 0;
+    struct vvcam_mode_info_array *psensor_mode_info_arry;
+
+    HalContext_t *pHalCtx = HalHandle;
+    if ( pHalCtx == NULL ) {
+        return RET_NULL_POINTER;
+    }
+
+    psensor_mode_info_arry = pSensorSupportInfo;
+    psensor_mode_info_arry->count = sizeof(psc132gs_mode_info) / sizeof(struct vvcam_mode_info);
+    memcpy(psensor_mode_info_arry->modes, psc132gs_mode_info, sizeof(psc132gs_mode_info));
+    return RET_SUCCESS;
+}
+
+static  RESULT SC132GS_IsiQuerySensorIss(IsiSensorHandle_t handle, vvcam_mode_info_array_t *pSensorInfo)
+{
+    RESULT result = RET_SUCCESS;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+    SC132GS_IsiQuerySensorSupportIss(pHalCtx,pSensorInfo);
+
+    return result;
+}
+
+static RESULT SC132GS_IsiGetSensorModeIss(IsiSensorHandle_t handle,void *mode)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL) {
+        return (RET_WRONG_HANDLE);
+    }
+    memcpy(mode,&(pSC132GSCtx->SensorMode), sizeof(pSC132GSCtx->SensorMode));
+
+    return ( RET_SUCCESS );
+}
+
+static RESULT SC132GS_IsiCreateSensorIss(IsiSensorInstanceConfig_t * pConfig) {
+    RESULT result = RET_SUCCESS;
+    SC132GS_Context_t *pSC132GSCtx;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    if (!pConfig || !pConfig->pSensor)
+        return (RET_NULL_POINTER);
+
+    pSC132GSCtx = (SC132GS_Context_t *) malloc(sizeof(SC132GS_Context_t));
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR, "%s: Can't allocate sc132gs context\n",
+              __func__);
+        return (RET_OUTOFMEM);
+    }
+
+    MEMSET(pSC132GSCtx, 0, sizeof(SC132GS_Context_t));
+
+    result = HalAddRef(pConfig->HalHandle);
+    if (result != RET_SUCCESS) {
+        free(pSC132GSCtx);
+        return (result);
+    }
+
+    pSC132GSCtx->IsiCtx.HalHandle = pConfig->HalHandle;
+    pSC132GSCtx->IsiCtx.pSensor = pConfig->pSensor;
+    pSC132GSCtx->GroupHold = BOOL_FALSE;
+    pSC132GSCtx->OldGain = 0;
+    pSC132GSCtx->OldIntegrationTime = 0;
+    pSC132GSCtx->Configured = BOOL_FALSE;
+    pSC132GSCtx->Streaming = BOOL_FALSE;
+    pSC132GSCtx->TestPattern = BOOL_FALSE;
+    pSC132GSCtx->isAfpsRun = BOOL_FALSE;
+    pSC132GSCtx->SensorMode.index = pConfig->SensorModeIndex;
+    pConfig->hSensor = (IsiSensorHandle_t) pSC132GSCtx;
+#ifdef SUBDEV_CHAR
+    struct vvcam_mode_info *SensorDefaultMode = NULL;
+    for (int i=0; i < sizeof(psc132gs_mode_info)/ sizeof(struct vvcam_mode_info); i++)
+    {
+        if (psc132gs_mode_info[i].index == pSC132GSCtx->SensorMode.index)
+        {
+            SensorDefaultMode = &(psc132gs_mode_info[i]);
+            break;
+        }
+    }
+
+    if (SensorDefaultMode != NULL)
+    {
+        strcpy(pSC132GSCtx->SensorRegCfgFile, get_vi_config_path());
+        switch(SensorDefaultMode->index)
+        {
+            case 0:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_1080x1280_init.txt");
+                break;
+            case 1:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_1080x1280_master_init.txt");
+                break;
+
+            case 2:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_1080x1280_slave_init.txt");
+                break;
+            case 3:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_960x1280_init.txt");
+                break;
+            case 4:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_960x1280_master_init.txt");
+                break;
+            case 5:
+                strcat(pSC132GSCtx->SensorRegCfgFile,
+                    "SC132GS_mipi2lane_960x1280_slave_init.txt");
+                break;
+            default:
+                return -1;
+        }
+
+        if (access(pSC132GSCtx->SensorRegCfgFile, F_OK) == 0) {
+            pSC132GSCtx->KernelDriverFlag = 0;
+            memcpy(&(pSC132GSCtx->SensorMode),SensorDefaultMode,sizeof(struct vvcam_mode_info));
+        } else {
+            return -1;
+        }
+    }else
+    {
+        pSC132GSCtx->KernelDriverFlag = 1;
+    }
+
+    result = SC132GS_IsiSensorSetPowerIss(pSC132GSCtx, BOOL_TRUE);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    uint32_t SensorClkIn = 0;
+    if (pSC132GSCtx->KernelDriverFlag) {
+        result = SC132GS_IsiSensorGetClkIss(pSC132GSCtx, &SensorClkIn);
+        RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+    }
+
+    result = SC132GS_IsiSensorSetClkIss(pSC132GSCtx, SensorClkIn);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    result = SC132GS_IsiResetSensorIss(pSC132GSCtx);
+    RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+
+    pSC132GSCtx->pattern = ISI_BPAT_BGBGGRGR;
+
+    if (!pSC132GSCtx->KernelDriverFlag) {
+        result = SC132GS_IsiConfigSensorSCCBIss(pSC132GSCtx);
+        RETURN_RESULT_IF_DIFFERENT(RET_SUCCESS, result);
+    }
+#endif
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiGetRegCfgIss(const char *registerFileName,
+                     struct vvcam_sccb_array *arry)
+{
+    if (NULL == registerFileName) {
+        TRACE(SC132GS_ERROR, "%s:registerFileName is NULL\n", __func__);
+        return (RET_NULL_POINTER);
+    }
+#ifdef SUBDEV_CHAR
+    FILE *fp = NULL;
+    fp = fopen(registerFileName, "rb");
+    if (!fp) {
+        TRACE(SC132GS_ERROR, "%s:load register file  %s error!\n",
+              __func__, registerFileName);
+        return (RET_FAILURE);
+    }
+
+    char LineBuf[512];
+    uint32_t FileTotalLine = 0;
+    while (!feof(fp)) {
+        fgets(LineBuf, 512, fp);
+        FileTotalLine++;
+    }
+
+    arry->sccb_data =
+        malloc(FileTotalLine * sizeof(struct vvcam_sccb_data));
+    if (arry->sccb_data == NULL) {
+        TRACE(SC132GS_ERROR, "%s:malloc failed NULL Point!\n", __func__,
+              registerFileName);
+        return (RET_FAILURE);
+    }
+    rewind(fp);
+
+    arry->count = 0;
+    while (!feof(fp)) {
+        memset(LineBuf, 0, sizeof(LineBuf));
+        fgets(LineBuf, 512, fp);
+
+        int result =
+            sscanf(LineBuf, "0x%x 0x%x",
+               &(arry->sccb_data[arry->count].addr),
+               &(arry->sccb_data[arry->count].data));
+        if (result != 2)
+            continue;
+        arry->count++;
+
+    }
+#endif
+
+    return 0;
+}
+
+static RESULT SC132GS_IsiInitSensorIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+
+    int ret = 0;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pSC132GSCtx->KernelDriverFlag) {
+        ;
+    } else {
+        struct vvcam_sccb_array arry;
+        result = SC132GS_IsiGetRegCfgIss(pSC132GSCtx->SensorRegCfgFile, &arry);
+        if (result != 0) {
+            TRACE(SC132GS_ERROR,
+                  "%s:SC132GS_IsiGetRegCfgIss error!\n", __func__);
+            return (RET_FAILURE);
+        }
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_WRITE_ARRAY, &arry);
+        if (ret != 0) {
+            TRACE(SC132GS_ERROR, "%s:Sensor Write Reg arry error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+
+        switch(pSC132GSCtx->SensorMode.index)
+        {
+            case 0:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            case 1:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            case 2:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            case 3:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            case 4:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            case 5:
+                pSC132GSCtx->one_line_exp_time = 1;
+                pSC132GSCtx->FrameLengthLines = (0x546 - 8) * 16;
+                pSC132GSCtx->CurFrameLengthLines = pSC132GSCtx->FrameLengthLines;
+                pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->CurFrameLengthLines - 3;
+                pSC132GSCtx->MinIntegrationLine = 1;
+                pSC132GSCtx->AecMaxGain = 28;
+                pSC132GSCtx->AecMinGain = 1;
+                break;
+            default:
+                return ( RET_NOTAVAILABLE );
+        }
+
+        pSC132GSCtx->AecIntegrationTimeIncrement = pSC132GSCtx->one_line_exp_time;
+        pSC132GSCtx->AecMinIntegrationTime =
+            pSC132GSCtx->one_line_exp_time * pSC132GSCtx->MinIntegrationLine;
+        pSC132GSCtx->AecMaxIntegrationTime =
+            pSC132GSCtx->one_line_exp_time * pSC132GSCtx->FrameLengthLines;
+
+        pSC132GSCtx->MaxFps  = pSC132GSCtx->SensorMode.fps;
+        pSC132GSCtx->MinFps  = 1;
+        pSC132GSCtx->CurrFps = pSC132GSCtx->MaxFps;
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiReleaseSensorIss(IsiSensorHandle_t handle) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL)
+        return (RET_WRONG_HANDLE);
+
+    (void)SC132GS_IsiSensorSetStreamingIss(pSC132GSCtx, BOOL_FALSE);
+    (void)SC132GS_IsiSensorSetPowerIss(pSC132GSCtx, BOOL_FALSE);
+    (void)HalDelRef(pSC132GSCtx->IsiCtx.HalHandle);
+
+    MEMSET(pSC132GSCtx, 0, sizeof(SC132GS_Context_t));
+    free(pSC132GSCtx);
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+struct sc132gs_fmt {
+    int width;
+    int height;
+    int fps;
+};
+
+static RESULT SC132GS_IsiSetupSensorIss
+    (IsiSensorHandle_t handle, const IsiSensorConfig_t * pConfig) {
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pConfig) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid configuration (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    if (pSC132GSCtx->Streaming != BOOL_FALSE) {
+        return RET_WRONG_STATE;
+    }
+
+    memcpy(&pSC132GSCtx->Config, pConfig, sizeof(IsiSensorConfig_t));
+
+    /* 1.) SW reset of image sensor (via I2C register interface)  be careful, bits 6..0 are reserved, reset bit is not sticky */
+    TRACE(SC132GS_DEBUG, "%s: SC132GS System-Reset executed\n", __func__);
+    osSleep(100);
+
+    //SC132GS_AecSetModeParameters not defined yet as of 2021/8/9.
+    //result = SC132GS_AecSetModeParameters(pSC132GSCtx, pConfig);
+    //if (result != RET_SUCCESS) {
+    //    TRACE(SC132GS_ERROR, "%s: SetupOutputWindow failed.\n",
+    //          __func__);
+    //    return (result);
+    //}
+#if 1
+    struct sc132gs_fmt fmt;
+    fmt.width = pConfig->Resolution.width;
+    fmt.height = pConfig->Resolution.height;
+
+    ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_FPS, &fmt);//result = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_FPS, &fmt);
+#endif
+    pSC132GSCtx->Configured = BOOL_TRUE;
+    TRACE(SC132GS_INFO, "%s: (exit) ret=0x%x \n", __func__, result);
+    return result;
+}
+
+static RESULT SC132GS_IsiChangeSensorResolutionIss(IsiSensorHandle_t handle, uint16_t width, uint16_t height) {
+    RESULT result = RET_SUCCESS;
+#if 0
+    struct sc132gs_fmt fmt;
+    fmt.width = width;
+    fmt.height = height;
+
+    int ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_FPS, &fmt);
+#endif
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiSensorSetStreamingIss
+    (IsiSensorHandle_t handle, bool_t on) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    if (pSC132GSCtx->Configured != BOOL_TRUE)
+        return RET_WRONG_STATE;
+
+    int32_t enable = (uint32_t) on;
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x3800, 0x00);
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x3817, 0x01);
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x100, on);
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x3800, 0x10);
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    ret = SC132GS_IsiRegisterWriteIss(handle, 0x3800, 0x40);
+    if (ret != 0) {
+        return (RET_FAILURE);
+    }
+
+    pSC132GSCtx->Streaming = on;
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static int32_t sensor_get_chip_id(IsiSensorHandle_t handle, uint32_t *chip_id)
+{
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    int32_t chip_id_high = 0;
+    int32_t chip_id_low = 0;
+
+    ret = SC132GS_IsiRegisterReadIss(handle, 0x3107, &chip_id_high);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR,
+            "%s: Read Sensor correct ID Error! \n", __func__);
+        return (RET_FAILURE);
+    }
+
+    ret = SC132GS_IsiRegisterReadIss(handle, 0x3108, &chip_id_low);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR,
+            "%s: Read Sensor correct ID Error! \n", __func__);
+        return (RET_FAILURE);
+    }
+
+    *chip_id = ((chip_id_high & 0xff)<<8) | (chip_id_low & 0xff);
+
+    return 0;
+}
+
+static RESULT SC132GS_IsiCheckSensorConnectionIss(IsiSensorHandle_t handle) {
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    uint32_t correct_id = 0x132;
+    uint32_t sensor_id = 0;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    ret = sensor_get_chip_id(handle, &sensor_id);
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR,
+            "%s: Read Sensor chip ID Error! \n", __func__);
+        return (RET_FAILURE);
+    }
+
+    if (correct_id != sensor_id) {
+        TRACE(SC132GS_ERROR, "%s:ChipID =0x%x sensor_id=%x error! \n",
+              __func__, correct_id, sensor_id);
+        return (RET_FAILURE);
+    }
+
+    TRACE(SC132GS_INFO,
+          "%s ChipID = 0x%08x, sensor_id = 0x%08x, success! \n", __func__,
+          correct_id, sensor_id);
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiGetSensorRevisionIss
+    (IsiSensorHandle_t handle, uint32_t * p_value) {
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    *p_value = 0X132;
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiGetGainLimitsIss
+    (IsiSensorHandle_t handle, float *pMinGain, float *pMaxGain) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    /*TODO*/
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pMinGain == NULL) || (pMaxGain == NULL)) {
+        TRACE(SC132GS_ERROR, "%s: NULL pointer received!!\n");
+        return (RET_NULL_POINTER);
+    }
+
+    *pMinGain = pSC132GSCtx->AecMinGain;
+    *pMaxGain = pSC132GSCtx->AecMaxGain;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiGetIntegrationTimeLimitsIss
+    (IsiSensorHandle_t handle,
+     float *pMinIntegrationTime, float *pMaxIntegrationTime) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    /*TODO*/
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pMinIntegrationTime == NULL) || (pMaxIntegrationTime == NULL)) {
+        TRACE(SC132GS_ERROR, "%s: NULL pointer received!!\n");
+        return (RET_NULL_POINTER);
+    }
+
+    *pMinIntegrationTime = pSC132GSCtx->AecMinIntegrationTime;
+    *pMaxIntegrationTime = pSC132GSCtx->AecMaxIntegrationTime;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetGainIss(IsiSensorHandle_t handle, float *pSetGain) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pSetGain == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    *pSetGain = pSC132GSCtx->AecCurGain;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetLongGainIss(IsiSensorHandle_t handle, float *gain)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",__func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (gain == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    *gain = pSC132GSCtx->AecCurLongGain;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+
+    return (RET_SUCCESS);
+}
+
+RESULT SC132GS_IsiGetVSGainIss(IsiSensorHandle_t handle, float *pSetGain) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pSetGain == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    *pSetGain = pSC132GSCtx->AecCurVSGain;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+RESULT SC132GS_IsiGetGainIncrementIss(IsiSensorHandle_t handle, float *pIncr) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pIncr == NULL)
+        return (RET_NULL_POINTER);
+
+    *pIncr = pSC132GSCtx->AecGainIncrement;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+RESULT SC132GS_IsiSetGainIss
+    (IsiSensorHandle_t handle,
+     float NewGain, float *pSetGain, float *hdr_ratio) {
+
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    int TmpGain;
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    if (NewGain >= 25) { // More than 25 will not take effect
+        NewGain = 25;
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    sc132gs_set_gain(handle, NewGain, pSetGain);
+    pSC132GSCtx->AecCurGain = *pSetGain;
+
+    TRACE(SC132GS_DEBUG, "%s: g=%f\n", __func__, *pSetGain);
+    return (result);
+}
+
+RESULT SC132GS_IsiSetLongGainIss(IsiSensorHandle_t handle, float gain)
+{
+    int ret = 0;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+
+    if (!pSC132GSCtx || !pSC132GSCtx->IsiCtx.HalHandle)
+    {
+        TRACE(SC132GS_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",__func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    uint32_t SensorGain = 0;
+    SensorGain = gain * pSC132GSCtx->gain_accuracy;
+    if (pSC132GSCtx->LastLongGain != SensorGain)
+    {
+
+        /*TODO*/
+#if 0
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_LONG_GAIN, &SensorGain);
+        if (ret != 0)
+        {
+            return (RET_FAILURE);
+            TRACE(SC132GS_ERROR,"%s: set long gain failed\n");
+
+        }
+#endif
+        pSC132GSCtx->LastLongGain = SensorGain;
+        pSC132GSCtx->AecCurLongGain = gain;
+    }
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (RET_SUCCESS);
+}
+
+RESULT SC132GS_IsiSetVSGainIss
+    (IsiSensorHandle_t handle,
+     float NewIntegrationTime,
+     float NewGain, float *pSetGain, float *hdr_ratio) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+    RESULT result = RET_SUCCESS;
+#if 0
+    float Gain = 0.0f;
+
+    uint32_t ucGain = 0U;
+    uint32_t again = 0U;
+#endif
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetGain || !hdr_ratio)
+        return (RET_NULL_POINTER);
+
+    uint32_t SensorGain = 0;
+    SensorGain = NewGain * pSC132GSCtx->gain_accuracy;
+
+    /*TODO*/
+    //ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_VSGAIN, &SensorGain);
+
+    pSC132GSCtx->AecCurVSGain = NewGain;
+    *pSetGain = pSC132GSCtx->AecCurGain;
+    TRACE(SC132GS_DEBUG, "%s: g=%f\n", __func__, *pSetGain);
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiSetBayerPattern(IsiSensorHandle_t handle, uint8_t pattern)
+{
+
+    RESULT result = RET_SUCCESS;
+#if 0
+    uint8_t h_shift = 0, v_shift = 0;
+    uint32_t val_h = 0, val_l = 0;
+    uint16_t val = 0;
+    uint8_t Start_p = 0;
+    bool_t streaming_status;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    // pattern 0:B 1:GB 2:GR 3:R
+    streaming_status = pSC132GSCtx->Streaming;
+    result = SC132GS_IsiSensorSetStreamingIss(handle, 0);
+    switch (pattern) {
+    case BAYER_BGGR:
+        Start_p = 0;
+        break;
+    case BAYER_GBRG:
+        Start_p = 1;
+        break;
+    case BAYER_GRBG:
+        Start_p = 2;
+        break;
+    case BAYER_RGGB:
+        Start_p = 3;
+        break;
+    }
+
+    h_shift = Start_p % 2;
+    v_shift = Start_p / 2;
+
+    SC132GS_IsiRegisterReadIss(handle, 0x30a0, &val_h);
+    SC132GS_IsiRegisterReadIss(handle, 0x30a1, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + h_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a0, (uint8_t)val_h);
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a1, (uint8_t)val_l);
+
+    SC132GS_IsiRegisterReadIss(handle, 0x30a2, &val_h);
+    SC132GS_IsiRegisterReadIss(handle, 0x30a3, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + v_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a2, (uint8_t)val_h);
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a3, (uint8_t)val_l);
+
+    SC132GS_IsiRegisterReadIss(handle, 0x30a4, &val_h);
+    SC132GS_IsiRegisterReadIss(handle, 0x30a5, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + h_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a4, (uint8_t)val_h);
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a5, (uint8_t)val_l);
+
+    SC132GS_IsiRegisterReadIss(handle, 0x30a6, &val_h);
+    SC132GS_IsiRegisterReadIss(handle, 0x30a7, &val_l);
+    val = (((val_h << 8) & 0xff00) | (val_l & 0x00ff)) + v_shift;
+    val_h = (val >> 8) & 0xff;
+    val_l = val & 0xff;
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a6, (uint8_t)val_h);
+    SC132GS_IsiRegisterWriteIss(handle, 0x30a7, (uint8_t)val_l);
+
+    pSC132GSCtx->pattern = pattern;
+    result = SC132GS_IsiSensorSetStreamingIss(handle, streaming_status);
+#endif
+
+    return (result);
+}
+
+RESULT SC132GS_IsiGetIntegrationTimeIss
+    (IsiSensorHandle_t handle, float *pSetIntegrationTime)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetIntegrationTime)
+        return (RET_NULL_POINTER);
+    *pSetIntegrationTime = pSC132GSCtx->AecCurIntegrationTime;
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetLongIntegrationTimeIss(IsiSensorHandle_t handle, float *pIntegrationTime)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",__func__);
+        return (RET_WRONG_HANDLE);
+    }
+    if (!pIntegrationTime)
+        return (RET_NULL_POINTER);
+
+    pSC132GSCtx->AecCurLongIntegrationTime =  pSC132GSCtx->AecCurIntegrationTime;
+
+    *pIntegrationTime = pSC132GSCtx->AecCurLongIntegrationTime;
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (RET_SUCCESS);
+}
+
+RESULT SC132GS_IsiGetVSIntegrationTimeIss
+    (IsiSensorHandle_t handle, float *pSetIntegrationTime)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    if (!pSetIntegrationTime)
+        return (RET_NULL_POINTER);
+
+    *pSetIntegrationTime = pSC132GSCtx->AecCurVSIntegrationTime;
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetIntegrationTimeIncrementIss
+    (IsiSensorHandle_t handle, float *pIncr)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pIncr)
+        return (RET_NULL_POINTER);
+
+    //_smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application)
+    *pIncr = pSC132GSCtx->AecIntegrationTimeIncrement;
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiSetIntegrationTimeIss
+    (IsiSensorHandle_t handle,
+     float NewIntegrationTime,
+     float *pSetIntegrationTime,
+     uint8_t * pNumberOfFramesToSkip, float *hdr_ratio)
+{
+    RESULT result = RET_SUCCESS;
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    // 曝光时间小于3ms
+    if (NewIntegrationTime > 3692.0f) {
+        NewIntegrationTime = 3692.0f;
+    }
+
+    //行长 = 寄存器{16‘h320c, 16′h320d}值*2
+    //2*{16’h320e,16’h320f}-6:h320e,h320f为帧长
+    uint32_t hval_time =  (((uint32_t)NewIntegrationTime) & 0xf0000) >> 16;
+    uint32_t mval_time =  (((uint32_t)NewIntegrationTime) & 0xff00) >> 8;
+    uint32_t lval_time =  ((uint32_t)NewIntegrationTime) & 0xff;
+
+    result = SC132GS_IsiRegisterWriteIss(handle, 0x3e00, hval_time);
+    result = SC132GS_IsiRegisterWriteIss(handle, 0x3e01, mval_time);
+    result = SC132GS_IsiRegisterWriteIss(handle, 0x3e02, lval_time);
+
+    pSC132GSCtx->AecCurIntegrationTime = NewIntegrationTime;
+    *pNumberOfFramesToSkip = 1U;
+    *pSetIntegrationTime = pSC132GSCtx->AecCurIntegrationTime;
+
+#if 0
+    uint32_t exp_line = 0;
+    uint32_t exp_line_old = 0;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetIntegrationTime || !pNumberOfFramesToSkip) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    exp_line = NewIntegrationTime / pSC132GSCtx->one_line_exp_time;
+    exp_line_old = exp_line;
+    exp_line =
+        MIN(pSC132GSCtx->MaxIntegrationLine,
+        MAX(pSC132GSCtx->MinIntegrationLine, exp_line));
+
+    TRACE(SC132GS_DEBUG, "%s: set AEC_PK_EXPO=0x%05x\n", __func__, exp_line);
+
+    if (exp_line != pSC132GSCtx->OldIntegrationTime) {
+
+        /*TODO*/
+        //ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_EXP, &exp_line);
+        pSC132GSCtx->OldIntegrationTime = exp_line;    // remember current integration time
+        pSC132GSCtx->AecCurIntegrationTime =
+            exp_line * pSC132GSCtx->one_line_exp_time;
+
+        *pNumberOfFramesToSkip = 1U;    //skip 1 frame
+    } else {
+        *pNumberOfFramesToSkip = 0U;    //no frame skip
+    }
+
+    if (NewIntegrationTime > pSC132GSCtx->FrameLengthLines * pSC132GSCtx->one_line_exp_time)
+        NewIntegrationTime = pSC132GSCtx->FrameLengthLines * pSC132GSCtx->one_line_exp_time;
+    float exp_t = NewIntegrationTime * 16.0f / pSC132GSCtx->one_line_exp_time;
+    __sc132gs_set_exposure(handle, (int)exp_t,
+				0, 0, SC132GS_INTEGRATION_TIME);
+
+    if (exp_line_old != exp_line) {
+        *pSetIntegrationTime = pSC132GSCtx->AecCurIntegrationTime;
+    } else {
+        *pSetIntegrationTime = NewIntegrationTime;
+    }
+#endif
+
+    TRACE(SC132GS_DEBUG, "%s: Ti=%f\n", __func__, *pSetIntegrationTime);
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiSetLongIntegrationTimeIss(IsiSensorHandle_t handle,float IntegrationTime)
+{
+    int ret;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (!handle || !pSC132GSCtx->IsiCtx.HalHandle)
+    {
+        TRACE(SC132GS_ERROR,"%s: Invalid sensor handle (NULL pointer detected)\n",__func__);
+        return (RET_WRONG_HANDLE);
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    uint32_t exp_line = 0;
+    exp_line = IntegrationTime / pSC132GSCtx->one_line_exp_time;
+    exp_line = MIN(pSC132GSCtx->MaxIntegrationLine, MAX(pSC132GSCtx->MinIntegrationLine, exp_line));
+
+    if (exp_line != pSC132GSCtx->LastLongExpLine)
+    {
+        if (pSC132GSCtx->KernelDriverFlag)
+        {
+            ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_LONG_EXP, &exp_line);
+            if (ret != 0)
+            {
+                TRACE(SC132GS_ERROR,"%s: set long gain failed\n");
+                return RET_FAILURE;
+            }
+        }
+
+        pSC132GSCtx->LastLongExpLine = exp_line;
+        pSC132GSCtx->AecCurLongIntegrationTime =  pSC132GSCtx->LastLongExpLine*pSC132GSCtx->one_line_exp_time;
+    }
+
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (RET_SUCCESS);
+}
+
+RESULT SC132GS_IsiSetVSIntegrationTimeIss
+    (IsiSensorHandle_t handle,
+     float NewIntegrationTime,
+     float *pSetVSIntegrationTime,
+     uint8_t * pNumberOfFramesToSkip, float *hdr_ratio)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    uint32_t exp_line = 0;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (!pSC132GSCtx) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (!pSetVSIntegrationTime || !pNumberOfFramesToSkip) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    TRACE(SC132GS_INFO,
+          "%s:  maxIntegrationTime-=%f minIntegrationTime = %f\n", __func__,
+          pSC132GSCtx->AecMaxIntegrationTime,
+          pSC132GSCtx->AecMinIntegrationTime);
+
+
+    exp_line = NewIntegrationTime / pSC132GSCtx->one_line_exp_time;
+    exp_line =
+        MIN(pSC132GSCtx->MaxIntegrationLine,
+        MAX(pSC132GSCtx->MinIntegrationLine, exp_line));
+
+    if (exp_line != pSC132GSCtx->OldVsIntegrationTime) {
+    /*TODO*/
+    //    ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_VSEXP, &exp_line);
+    } else if (1){
+
+        pSC132GSCtx->OldVsIntegrationTime = exp_line;
+        pSC132GSCtx->AecCurVSIntegrationTime = exp_line * pSC132GSCtx->one_line_exp_time;    //remember current integration time
+        *pNumberOfFramesToSkip = 1U;    //skip 1 frame
+    } else {
+        *pNumberOfFramesToSkip = 0U;    //no frame skip
+    }
+
+    *pSetVSIntegrationTime = pSC132GSCtx->AecCurVSIntegrationTime;
+
+    TRACE(SC132GS_DEBUG, "%s: NewIntegrationTime=%f\n", __func__,
+          NewIntegrationTime);
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiExposureControlIss
+    (IsiSensorHandle_t handle,
+     float NewGain,
+     float NewIntegrationTime,
+     uint8_t * pNumberOfFramesToSkip,
+     float *pSetGain, float *pSetIntegrationTime, float *hdr_ratio)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pNumberOfFramesToSkip == NULL) || (pSetGain == NULL)
+        || (pSetIntegrationTime == NULL)) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid parameter (NULL pointer detected)\n",
+              __func__);
+        return (RET_NULL_POINTER);
+    }
+
+    if (NewGain >= 28) {
+        NewGain = 28;
+    }
+
+    TRACE(SC132GS_DEBUG, "%s: g=%f, Ti=%f\n", __func__, NewGain,
+          NewIntegrationTime);
+
+    if (NewIntegrationTime > pSC132GSCtx->FrameLengthLines * pSC132GSCtx->one_line_exp_time)
+        NewIntegrationTime = pSC132GSCtx->FrameLengthLines * pSC132GSCtx->one_line_exp_time;
+
+    sc132gs_set_gain(handle, NewGain, pSetGain);
+    SC132GS_IsiSetIntegrationTimeIss(handle, NewIntegrationTime, pSetIntegrationTime, pNumberOfFramesToSkip, hdr_ratio);
+    pSC132GSCtx->AecCurGain = NewGain;
+    pSC132GSCtx->AecCurIntegrationTime = *pSetIntegrationTime;
+
+    TRACE(SC132GS_DEBUG, "%s: set: vsg=%f, vsTi=%f, vsskip=%d\n", __func__,
+          NewGain, NewIntegrationTime, *pNumberOfFramesToSkip);
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+
+    return result;
+}
+
+RESULT SC132GS_IsiGetCurrentExposureIss
+    (IsiSensorHandle_t handle, float *pSetGain, float *pSetIntegrationTime, float *hdr_ratio) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    if ((pSetGain == NULL) || (pSetIntegrationTime == NULL))
+        return (RET_NULL_POINTER);
+
+    *pSetGain = pSC132GSCtx->AecCurGain;
+    *pSetIntegrationTime = pSC132GSCtx->AecCurIntegrationTime;
+    *hdr_ratio = pSC132GSCtx->CurHdrRatio;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight) {
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+
+    *pwidth = pSC132GSCtx->SensorMode.width;
+    *pheight =  pSC132GSCtx->SensorMode.height;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiGetSensorFpsIss(IsiSensorHandle_t handle, uint32_t * pfps)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    if (pSC132GSCtx->KernelDriverFlag) {
+       /*TODO*/
+        ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_FPS, pfps);
+        pSC132GSCtx->CurrFps = *pfps;
+    }
+
+    *pfps = pSC132GSCtx->CurrFps;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+RESULT SC132GS_IsiSetSensorFpsIss(IsiSensorHandle_t handle, uint32_t fps)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    RESULT result = RET_SUCCESS;
+    int32_t ret = 0;
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        TRACE(SC132GS_ERROR,
+              "%s: Invalid sensor handle (NULL pointer detected)\n",
+              __func__);
+        return (RET_WRONG_HANDLE);
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    if (fps > pSC132GSCtx->MaxFps) {
+        TRACE(SC132GS_ERROR,
+              "%s: set fps(%d) out of range, correct to %d (%d, %d)\n",
+              __func__, fps, pSC132GSCtx->MaxFps, pSC132GSCtx->MinFps,
+              pSC132GSCtx->MaxFps);
+        fps = pSC132GSCtx->MaxFps;
+    }
+    if (fps < pSC132GSCtx->MinFps) {
+        TRACE(SC132GS_ERROR,
+              "%s: set fps(%d) out of range, correct to %d (%d, %d)\n",
+              __func__, fps, pSC132GSCtx->MinFps, pSC132GSCtx->MinFps,
+              pSC132GSCtx->MaxFps);
+        fps = pSC132GSCtx->MinFps;
+    }
+    if (pSC132GSCtx->KernelDriverFlag) {
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_FPS, &fps);
+        if (ret != 0) {
+            TRACE(SC132GS_ERROR, "%s: set sensor fps=%d error\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+
+        ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_SENSOR_MODE, &(pSC132GSCtx->SensorMode));
+        {
+            pSC132GSCtx->MaxIntegrationLine = pSC132GSCtx->SensorMode.ae_info.max_integration_time;
+            pSC132GSCtx->AecMaxIntegrationTime = pSC132GSCtx->MaxIntegrationLine * pSC132GSCtx->one_line_exp_time;
+        }
+#ifdef SUBDEV_CHAR
+        struct vvcam_ae_info_s ae_info;
+        ret =
+            ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_AE_INFO, &ae_info);
+        if (ret != 0) {
+            TRACE(SC132GS_ERROR, "%s:sensor get ae info error!\n",
+                  __func__);
+            return (RET_FAILURE);
+        }
+        pSC132GSCtx->one_line_exp_time =
+            (float)ae_info.one_line_exp_time_ns / 1000000000;
+        pSC132GSCtx->MaxIntegrationLine = ae_info.max_integration_time;
+        pSC132GSCtx->AecMaxIntegrationTime =
+            pSC132GSCtx->MaxIntegrationLine *
+            pSC132GSCtx->one_line_exp_time;
+#endif
+    }
+
+    TRACE(SC132GS_INFO, "%s: set sensor fps = %d\n", __func__,
+          pSC132GSCtx->CurrFps);
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+    return (result);
+}
+
+static RESULT SC132GS_IsiActivateTestPattern(IsiSensorHandle_t handle,
+                        const bool_t enable)
+{
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s: (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+
+    if (pSC132GSCtx->Configured != BOOL_TRUE)
+        return RET_WRONG_STATE;
+
+    if (BOOL_TRUE == enable) {
+        //result = SC132GS_IsiRegisterWriteIss(handle, 0x3253, 0x80);
+    } else {
+        //result = SC132GS_IsiRegisterWriteIss(handle, 0x3253, 0x00);
+    }
+    pSC132GSCtx->TestPattern = enable;
+
+    TRACE(SC132GS_INFO, "%s: (exit)\n", __func__);
+
+    return (result);
+}
+
+static RESULT SC132GS_IsiSensorSetBlcIss(IsiSensorHandle_t handle, sensor_blc_t * pblc)
+{
+    int32_t ret = 0;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_WRONG_HANDLE;
+    }
+
+    if (pblc == NULL)
+        return RET_NULL_POINTER;
+
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_BLC, pblc);
+    if (ret != 0)
+    {
+         TRACE(SC132GS_ERROR, "%s: set wb error\n", __func__);
+    }
+
+    return RET_SUCCESS;
+}
+
+static RESULT SC132GS_IsiSensorSetWBIss(IsiSensorHandle_t handle, sensor_white_balance_t * pwb)
+{
+    int32_t ret = 0;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_WRONG_HANDLE;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    if (pwb == NULL)
+        return RET_NULL_POINTER;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_S_WB, pwb);
+    if (ret != 0)
+    {
+         TRACE(SC132GS_ERROR, "%s: set wb error\n", __func__);
+    }
+
+    return RET_SUCCESS;
+}
+
+static RESULT SC132GS_IsiGetSensorAWBModeIss(IsiSensorHandle_t  handle, IsiSensorAwbMode_t *pawbmode)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    if (pSC132GSCtx->SensorMode.hdr_mode == SENSOR_MODE_HDR_NATIVE){
+        *pawbmode = ISI_SENSOR_AWB_MODE_SENSOR;
+    }else{
+        *pawbmode = ISI_SENSOR_AWB_MODE_NORMAL;
+    }
+    return RET_SUCCESS;
+}
+
+static RESULT SC132GS_IsiSensorGetExpandCurveIss(IsiSensorHandle_t handle, sensor_expand_curve_t * pexpand_curve)
+{
+    int32_t ret = 0;
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    ret = ioctl(pHalCtx->sensor_fd, VVSENSORIOC_G_EXPAND_CURVE, pexpand_curve);
+    if (ret != 0)
+    {
+        TRACE(SC132GS_ERROR, "%s: get  expand cure error\n", __func__);
+        return RET_FAILURE;
+    }
+
+    return RET_SUCCESS;
+}
+
+static RESULT SC132GS_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps)
+{
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+
+    RESULT result = RET_SUCCESS;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    if (pSC132GSCtx == NULL) {
+        return (RET_WRONG_HANDLE);
+    }
+
+    if (pIsiSensorCaps == NULL) {
+        return (RET_NULL_POINTER);
+    }
+
+    pIsiSensorCaps->BusWidth = pSC132GSCtx->SensorMode.bit_width;
+    pIsiSensorCaps->Mode = ISI_MODE_BAYER;
+    pIsiSensorCaps->FieldSelection = ISI_FIELDSEL_BOTH;
+    pIsiSensorCaps->YCSequence = ISI_YCSEQ_YCBYCR;
+    pIsiSensorCaps->Conv422 = ISI_CONV422_NOCOSITED;
+    pIsiSensorCaps->BPat = pSC132GSCtx->SensorMode.bayer_pattern;
+    pIsiSensorCaps->HPol = ISI_HPOL_REFPOS;
+    pIsiSensorCaps->VPol = ISI_VPOL_NEG;
+    pIsiSensorCaps->Edge = ISI_EDGE_RISING;
+    pIsiSensorCaps->Resolution.width = pSC132GSCtx->SensorMode.width;
+    pIsiSensorCaps->Resolution.height = pSC132GSCtx->SensorMode.height;
+    pIsiSensorCaps->SmiaMode = ISI_SMIA_OFF;
+    pIsiSensorCaps->MipiLanes = ISI_MIPI_2LANES;
+
+    if (pIsiSensorCaps->BusWidth == 10) {
+        pIsiSensorCaps->MipiMode      = ISI_MIPI_MODE_RAW_10;
+    }else if (pIsiSensorCaps->BusWidth == 12){
+        pIsiSensorCaps->MipiMode      = ISI_MIPI_MODE_RAW_12;
+    }else{
+        pIsiSensorCaps->MipiMode      = ISI_MIPI_OFF;
+    }
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return result;
+}
+
+static RESULT SC132GS_IsiGetSensorTemperature(IsiSensorHandle_t handle, int32_t *val)
+{
+    RESULT result = RET_SUCCESS;
+    int ret = 0;
+    uint32_t i = 0, f = 0;
+
+    TRACE(SC132GS_INFO, "%s (enter)\n", __func__);
+
+    SC132GS_Context_t *pSC132GSCtx = (SC132GS_Context_t *) handle;
+    if (pSC132GSCtx == NULL || pSC132GSCtx->IsiCtx.HalHandle == NULL) {
+        return RET_NULL_POINTER;
+    }
+    HalContext_t *pHalCtx = (HalContext_t *) pSC132GSCtx->IsiCtx.HalHandle;
+
+    /*
+    ret = SC132GS_IsiRegisterReadIss(handle, 0x4c11, &f); //float
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+    */
+
+    ret = SC132GS_IsiRegisterReadIss(handle, 0x4c10, &i); //integer
+    if (ret != 0) {
+        TRACE(SC132GS_ERROR, "%s: sensor reset error!\n", __func__);
+        return (RET_FAILURE);
+    }
+
+    *val = i * 2 - 273;
+
+    TRACE(SC132GS_INFO, "%s (exit)\n", __func__);
+    return (result);
+}
+
+
+RESULT SC132GS_IsiGetSensorIss(IsiSensor_t *pIsiSensor)
+{
+    RESULT result = RET_SUCCESS;
+    TRACE( SC132GS_INFO, "%s (enter)\n", __func__);
+
+    if ( pIsiSensor != NULL ) {
+        pIsiSensor->pszName                         = SensorName;
+        pIsiSensor->pIsiCreateSensorIss             = SC132GS_IsiCreateSensorIss;
+
+        pIsiSensor->pIsiInitSensorIss               = SC132GS_IsiInitSensorIss;
+        pIsiSensor->pIsiGetSensorModeIss            = SC132GS_IsiGetSensorModeIss;
+        pIsiSensor->pIsiResetSensorIss              = SC132GS_IsiResetSensorIss;
+        pIsiSensor->pIsiReleaseSensorIss            = SC132GS_IsiReleaseSensorIss;
+        pIsiSensor->pIsiGetCapsIss                  = SC132GS_IsiGetCapsIss;
+        pIsiSensor->pIsiSetupSensorIss              = SC132GS_IsiSetupSensorIss;
+        pIsiSensor->pIsiChangeSensorResolutionIss   = SC132GS_IsiChangeSensorResolutionIss;
+        pIsiSensor->pIsiSensorSetStreamingIss       = SC132GS_IsiSensorSetStreamingIss;
+        pIsiSensor->pIsiSensorSetPowerIss           = SC132GS_IsiSensorSetPowerIss;
+        pIsiSensor->pIsiCheckSensorConnectionIss    = SC132GS_IsiCheckSensorConnectionIss;
+        pIsiSensor->pIsiGetSensorRevisionIss        = SC132GS_IsiGetSensorRevisionIss;
+        pIsiSensor->pIsiRegisterReadIss             = SC132GS_IsiRegisterReadIss;
+        pIsiSensor->pIsiRegisterWriteIss            = SC132GS_IsiRegisterWriteIss;
+
+        /* AEC functions */
+        pIsiSensor->pIsiExposureControlIss          = SC132GS_IsiExposureControlIss;
+        pIsiSensor->pIsiGetGainLimitsIss            = SC132GS_IsiGetGainLimitsIss;
+        pIsiSensor->pIsiGetIntegrationTimeLimitsIss = SC132GS_IsiGetIntegrationTimeLimitsIss;
+        pIsiSensor->pIsiGetCurrentExposureIss       = SC132GS_IsiGetCurrentExposureIss;
+        pIsiSensor->pIsiGetVSGainIss                    = SC132GS_IsiGetVSGainIss;
+        pIsiSensor->pIsiGetGainIss                      = SC132GS_IsiGetGainIss;
+        pIsiSensor->pIsiGetLongGainIss                  = SC132GS_IsiGetLongGainIss;
+        pIsiSensor->pIsiGetGainIncrementIss             = SC132GS_IsiGetGainIncrementIss;
+        pIsiSensor->pIsiSetGainIss                      = SC132GS_IsiSetGainIss;
+        pIsiSensor->pIsiGetIntegrationTimeIss           = SC132GS_IsiGetIntegrationTimeIss;
+        pIsiSensor->pIsiGetVSIntegrationTimeIss         = SC132GS_IsiGetVSIntegrationTimeIss;
+        pIsiSensor->pIsiGetLongIntegrationTimeIss       = SC132GS_IsiGetLongIntegrationTimeIss;
+        pIsiSensor->pIsiGetIntegrationTimeIncrementIss  = SC132GS_IsiGetIntegrationTimeIncrementIss;
+        pIsiSensor->pIsiSetIntegrationTimeIss           = SC132GS_IsiSetIntegrationTimeIss;
+        pIsiSensor->pIsiQuerySensorIss                  = SC132GS_IsiQuerySensorIss;
+        pIsiSensor->pIsiGetResolutionIss                = SC132GS_IsiGetResolutionIss;
+        pIsiSensor->pIsiGetSensorFpsIss                 = SC132GS_IsiGetSensorFpsIss;
+        pIsiSensor->pIsiSetSensorFpsIss                 = SC132GS_IsiSetSensorFpsIss;
+        pIsiSensor->pIsiSensorGetExpandCurveIss         = SC132GS_IsiSensorGetExpandCurveIss;
+
+        /* AWB specific functions */
+
+        /* Testpattern */
+        pIsiSensor->pIsiActivateTestPattern         = SC132GS_IsiActivateTestPattern;
+        pIsiSensor->pIsiSetBayerPattern             = SC132GS_IsiSetBayerPattern;
+
+        pIsiSensor->pIsiSensorSetBlcIss             = SC132GS_IsiSensorSetBlcIss;
+        pIsiSensor->pIsiSensorSetWBIss              = SC132GS_IsiSensorSetWBIss;
+        pIsiSensor->pIsiGetSensorAWBModeIss         = SC132GS_IsiGetSensorAWBModeIss;
+        pIsiSensor->pIsiGetSensorTemperature        = SC132GS_IsiGetSensorTemperature;
+    } else {
+        result = RET_NULL_POINTER;
+    }
+
+    TRACE( SC132GS_INFO, "%s (exit)\n", __func__);
+    return ( result );
+}
+
+/*****************************************************************************
+* each sensor driver need declare this struct for isi load
+*****************************************************************************/
+IsiCamDrvConfig_t SC132GS_IsiCamDrvConfig = {
+    0,
+    SC132GS_IsiQuerySensorSupportIss,
+    SC132GS_IsiGetSensorIss,
+    {
+     SensorName,            /**< IsiSensor_t.pszName */
+     0,            /**< IsiSensor_t.pIsiInitIss>*/
+     0,            /**< IsiSensor_t.pIsiResetSensorIss>*/
+     0,            /**< IsiSensor_t.pRegisterTable */
+     0,            /**< IsiSensor_t.pIsiSensorCaps */
+     0,            /**< IsiSensor_t.pIsiCreateSensorIss */
+     0,            /**< IsiSensor_t.pIsiReleaseSensorIss */
+     0,            /**< IsiSensor_t.pIsiGetCapsIss */
+     0,            /**< IsiSensor_t.pIsiSetupSensorIss */
+     0,            /**< IsiSensor_t.pIsiChangeSensorResolutionIss */
+     0,            /**< IsiSensor_t.pIsiSensorSetStreamingIss */
+     0,            /**< IsiSensor_t.pIsiSensorSetPowerIss */
+     0,            /**< IsiSensor_t.pIsiCheckSensorConnectionIss */
+     0,            /**< IsiSensor_t.pIsiGetSensorRevisionIss */
+     0,            /**< IsiSensor_t.pIsiRegisterReadIss */
+     0,            /**< IsiSensor_t.pIsiRegisterWriteIss */
+
+     0,            /**< IsiSensor_t.pIsiExposureControlIss */
+     0,            /**< IsiSensor_t.pIsiGetGainLimitsIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeLimitsIss */
+     0,            /**< IsiSensor_t.pIsiGetCurrentExposureIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIss */
+     0,            /**< IsiSensor_t.pIsiGetVSGainIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIncrementIss */
+     0,            /**< IsiSensor_t.pIsiGetGainIncrementIss */
+     0,            /**< IsiSensor_t.pIsiSetGainIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeIss */
+     0,            /**< IsiSensor_t.pIsiGetIntegrationTimeIncrementIss */
+     0,            /**< IsiSensor_t.pIsiSetIntegrationTimeIss */
+     0,            /**< IsiSensor_t.pIsiGetResolutionIss */
+     0,            /**< IsiSensor_t.pIsiGetAfpsInfoIss */
+
+     0,            /**< IsiSensor_t.pIsiMdiInitMotoDriveMds */
+     0,            /**< IsiSensor_t.pIsiMdiSetupMotoDrive */
+     0,            /**< IsiSensor_t.pIsiMdiFocusSet */
+     0,            /**< IsiSensor_t.pIsiMdiFocusGet */
+     0,            /**< IsiSensor_t.pIsiMdiFocusCalibrate */
+     0,            /**< IsiSensor_t.pIsiGetSensorMipiInfoIss */
+     0,            /**< IsiSensor_t.pIsiActivateTestPattern */
+     0,            /**< IsiSensor_t.pIsiSetBayerPattern */
+     }
+};

File diff suppressed because it is too large
+ 544 - 0
drivers/SC132GS/SC132GS.xml


File diff suppressed because it is too large
+ 544 - 0
drivers/SC132GS/SC132GS_1080x1280.xml


+ 101 - 0
drivers/SC132GS/SC132GS_mipi2lane_1080x1280_init.txt

@@ -0,0 +1,101 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x301a 0xb4
+0x301f 0x27
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x05
+0x3253 0x41
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x65
+0x36eb 0x05
+0x36ec 0x03
+0x36ed 0x04
+0x36fa 0x65
+0x36fb 0x09
+0x36fc 0x00
+0x36fd 0x07
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x03
+0x3e02 0xe0
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4837 0x1a
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x36e9 0x31
+0x36f9 0x31
+0x33fa 0x02
+0x3317 0x14
+0x3e08 0x3f
+0x3e09 0x3f
+0x320e 0x0a
+0x320f 0x20

+ 105 - 0
drivers/SC132GS/SC132GS_mipi2lane_1080x1280_master_init.txt

@@ -0,0 +1,105 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x301a 0xb4
+0x301f 0x27
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x05
+0x3253 0x41
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x65
+0x36eb 0x05
+0x36ec 0x03
+0x36ed 0x04
+0x36fa 0x65
+0x36fb 0x09
+0x36fc 0x00
+0x36fd 0x07
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x03
+0x3e02 0xe0
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4837 0x1a
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x36e9 0x31
+0x36f9 0x31
+0x33fa 0x02
+0x3317 0x14
+0x3e08 0x3f
+0x3e09 0x3f
+0x320e 0x0a
+0x320f 0x20
+0x300a 0x64
+0x3032 0xa0
+0x3217 0x0a
+0x3218 0x1b

+ 112 - 0
drivers/SC132GS/SC132GS_mipi2lane_1080x1280_slave_init.txt

@@ -0,0 +1,112 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x301a 0xb4
+0x301f 0x27
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x05
+0x3253 0x41
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x65
+0x36eb 0x05
+0x36ec 0x03
+0x36ed 0x04
+0x36fa 0x65
+0x36fb 0x09
+0x36fc 0x00
+0x36fd 0x07
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x03
+0x3e02 0xe0
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4837 0x1a
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x36e9 0x31
+0x36f9 0x31
+0x33fa 0x02
+0x3317 0x14
+0x3e08 0x3f
+0x3e09 0x3f
+0x320e 0x0a
+0x320f 0x20
+0x300a 0x62
+0x3222 0x02
+0x3223 0x44
+0x3226 0x08
+0x3227 0x08
+0x3228 0x0a
+0x3229 0x18
+0x3217 0x00
+0x3218 0x00
+0x322b 0x0b
+0x3231 0x28

+ 120 - 0
drivers/SC132GS/SC132GS_mipi2lane_960x1280_init.txt

@@ -0,0 +1,120 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x3019 0x0c
+0x301a 0xb4
+0x301f 0x91
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x320e 0x06
+0x320f 0x40
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x06
+0x3253 0x3b
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x34
+0x36eb 0x14
+0x36ec 0x03
+0x36ed 0x24
+0x36fa 0x37
+0x36fb 0x15
+0x36fc 0x01
+0x36fd 0x14
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x63
+0x3e02 0x80
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4800 0x24
+0x4837 0x2c
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x3200 0x00
+0x3201 0x42
+0x3202 0x00
+0x3203 0x02
+0x3204 0x04
+0x3205 0x15
+0x3206 0x05
+0x3207 0x15
+0x3208 0x03
+0x3209 0xc0
+0x320a 0x05
+0x320b 0x00
+0x3210 0x00
+0x3211 0x0a
+0x3212 0x00
+0x3213 0x0a
+0x36e9 0x54
+0x36f9 0x54
+0x0100 0x01
+0x33fa 0x01
+0x3317 0xf0
+0x33fa 0x02
+0x3317 0x14

+ 125 - 0
drivers/SC132GS/SC132GS_mipi2lane_960x1280_master_init.txt

@@ -0,0 +1,125 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x3019 0x0c
+0x301a 0xb4
+0x301f 0x91
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x320e 0x06
+0x320f 0x40
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x06
+0x3253 0x3b
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x34
+0x36eb 0x14
+0x36ec 0x03
+0x36ed 0x24
+0x36fa 0x37
+0x36fb 0x15
+0x36fc 0x01
+0x36fd 0x14
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x63
+0x3e02 0x80
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4800 0x24
+0x4837 0x2c
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x3200 0x00
+0x3201 0x42
+0x3202 0x00
+0x3203 0x02
+0x3204 0x04
+0x3205 0x15
+0x3206 0x05
+0x3207 0x15
+0x3208 0x03
+0x3209 0xc0
+0x320a 0x05
+0x320b 0x00
+0x3210 0x00
+0x3211 0x0a
+0x3212 0x00
+0x3213 0x0a
+0x36e9 0x54
+0x36f9 0x54
+0x0100 0x01
+0x33fa 0x01
+0x3317 0xf0
+0x33fa 0x02
+0x3317 0x14
+0x300a 0x64
+0x3032 0xa0
+0x3217 0x0a
+0x3218 0x1a
+

+ 131 - 0
drivers/SC132GS/SC132GS_mipi2lane_960x1280_slave_init.txt

@@ -0,0 +1,131 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3018 0x32
+0x3019 0x0c
+0x301a 0xb4
+0x301f 0x91
+0x3032 0x60
+0x3038 0x44
+0x3207 0x17
+0x320c 0x02
+0x320d 0xee
+0x320e 0x06
+0x320f 0x40
+0x3250 0xcc
+0x3251 0x02
+0x3252 0x06
+0x3253 0x3b
+0x3254 0x05
+0x3255 0x3b
+0x3306 0x78
+0x330a 0x00
+0x330b 0xc8
+0x330f 0x24
+0x3314 0x80
+0x3315 0x40
+0x3317 0xf0
+0x331f 0x12
+0x3364 0x00
+0x3385 0x41
+0x3387 0x41
+0x3389 0x09
+0x33ab 0x00
+0x33ac 0x00
+0x33b1 0x03
+0x33b2 0x12
+0x33f8 0x02
+0x33fa 0x01
+0x3409 0x08
+0x34f0 0xc0
+0x34f1 0x20
+0x34f2 0x03
+0x3622 0xf5
+0x3630 0x5c
+0x3631 0x80
+0x3632 0xc8
+0x3633 0x32
+0x3638 0x2a
+0x3639 0x07
+0x363b 0x48
+0x363c 0x83
+0x363d 0x10
+0x36ea 0x34
+0x36eb 0x14
+0x36ec 0x03
+0x36ed 0x24
+0x36fa 0x37
+0x36fb 0x15
+0x36fc 0x01
+0x36fd 0x14
+0x3900 0x11
+0x3901 0x05
+0x3902 0xc5
+0x3904 0x04
+0x3908 0x91
+0x391e 0x00
+0x3e01 0x63
+0x3e02 0x80
+0x3e09 0x20
+0x3e0e 0xd2
+0x3e14 0xb0
+0x3e1e 0x7c
+0x3e26 0x20
+0x4418 0x38
+0x4503 0x10
+0x4800 0x24
+0x4837 0x2c
+0x5000 0x0e
+0x540c 0x51
+0x550f 0x38
+0x5780 0x67
+0x5784 0x10
+0x5785 0x06
+0x5787 0x02
+0x5788 0x00
+0x5789 0x00
+0x578a 0x02
+0x578b 0x00
+0x578c 0x00
+0x5790 0x00
+0x5791 0x00
+0x5792 0x00
+0x5793 0x00
+0x5794 0x00
+0x5795 0x00
+0x5799 0x04
+0x3200 0x00
+0x3201 0x42
+0x3202 0x00
+0x3203 0x02
+0x3204 0x04
+0x3205 0x15
+0x3206 0x05
+0x3207 0x15
+0x3208 0x03
+0x3209 0xc0
+0x320a 0x05
+0x320b 0x00
+0x3210 0x00
+0x3211 0x0a
+0x3212 0x00
+0x3213 0x0a
+0x36e9 0x54
+0x36f9 0x54
+0x0100 0x01
+0x33fa 0x01
+0x3317 0xf0
+0x33fa 0x02
+0x3317 0x14
+0x300a 0x62
+0x3222 0x02
+0x3223 0x4c
+0x3226 0x06
+0x3227 0x06
+0x3228 0x0a
+0x3229 0x1a
+0x3217 0x00
+0x3218 0x00
+0x322b 0x0b
+0x3231 0x28

+ 241 - 0
drivers/SC132GS/SC132GS_priv.h

@@ -0,0 +1,241 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file SC132GS_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup sc132gs_priv
+ * @{
+ *
+ */
+#ifndef __SC132GS_PRIV_H__
+#define __SC132GS_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define SC132GS_PIDH                         (0x300A)  //R  - Product ID High Byte MSBs
+#define SC132GS_PIDL                         (0x300B)  //R  - Product ID Low Byte LSBs
+
+/*****************************************************************************
+ * Default values
+ *****************************************************************************/
+
+ // Make sure that these static settings are reflecting the capabilities defined
+// in IsiGetCapsIss (further dynamic setup may alter these default settings but
+// often does not if there is no choice available).
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define SC132GS_PIDH_DEFAULT                        (0x27) //read only
+#define SC132GS_PIDL_DEFAULT                        (0x70) //read only
+
+typedef struct SC132GS_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    uint32_t              Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurIntegrationTime;
+    float               AecCurVSIntegrationTime;
+    float               AecCurLongIntegrationTime;
+    float               AecCurGain;
+    float               AecCurVSGain;
+    float               AecCurLongGain;
+
+    uint32_t            LastExpLine;
+    uint32_t            LastVsExpLine;
+    uint32_t            LastLongExpLine;
+
+    uint32_t            LastGain;
+    uint32_t            LastVsGain;
+    uint32_t            LastLongGain;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldVsGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldVsIntegrationTime;
+    uint32_t            OldGainHcg;
+    uint32_t            OldAGainHcg;
+    uint32_t            OldGainLcg;
+    uint32_t            OldAGainLcg;
+    int                 subdev;
+    uint8_t             pattern;
+
+    float               CurHdrRatio;
+} SC132GS_Context_t;
+
+static RESULT SC132GS_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT SC132GS_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT SC132GS_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT SC132GS_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT SC132GS_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT SC132GS_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT SC132GS_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT SC132GS_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT SC132GS_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT SC132GS_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT SC132GS_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT SC132GS_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT SC132GS_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT SC132GS_IsiGetVSGainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT SC132GS_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT SC132GS_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT SC132GS_IsiSetVSGainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT SC132GS_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT SC132GS_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT SC132GS_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT SC132GS_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT SC132GS_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+RESULT SC132GS_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT SC132GS_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} sc132gspriv */
+
+#endif    /* __SC132GSPRIV_H__ */
+

+ 1377 - 0
drivers/SC132GS/sc132gs.h

@@ -0,0 +1,1377 @@
+/*
+ * Support for OmniVision SC132GS 5M camera sensor.
+ *
+ * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef __SC132GS_H__
+#define __SC132GS_H__
+
+#define SC132GS_NAME		"sc132gs"
+
+#define SC132GS_POWER_UP_RETRY_NUM 5
+
+/* Defines for register writes and register array processing */
+#define I2C_MSG_LENGTH		0x2
+#define I2C_RETRY_COUNT		5
+
+#define SC132GS_FOCAL_LENGTH_NUM	334	/*3.34mm*/
+#define SC132GS_FOCAL_LENGTH_DEM	100
+#define SC132GS_F_NUMBER_DEFAULT_NUM	24
+#define SC132GS_F_NUMBER_DEM	10
+
+#define MAX_FMTS		1
+
+/* sensor_mode_data read_mode adaptation */
+#define SC132GS_READ_MODE_BINNING_ON	0x0400
+#define SC132GS_READ_MODE_BINNING_OFF	0x00
+#define SC132GS_INTEGRATION_TIME_MARGIN	8
+
+#define SC132GS_MAX_EXPOSURE_VALUE	0xFFF1
+#define SC132GS_MAX_GAIN_VALUE		0xFF
+
+/*
+ * focal length bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define SC132GS_FOCAL_LENGTH_DEFAULT 0x1B70064
+
+/*
+ * current f-number bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define SC132GS_F_NUMBER_DEFAULT 0x18000a
+
+/*
+ * f-number range bits definition:
+ * bits 31-24: max f-number numerator
+ * bits 23-16: max f-number denominator
+ * bits 15-8: min f-number numerator
+ * bits 7-0: min f-number denominator
+ */
+#define SC132GS_F_NUMBER_RANGE 0x180a180a
+#define SC132GS_ID	0x5690
+
+#define SC132GS_FINE_INTG_TIME_MIN 0
+#define SC132GS_FINE_INTG_TIME_MAX_MARGIN 0
+#define SC132GS_COARSE_INTG_TIME_MIN 1
+#define SC132GS_COARSE_INTG_TIME_MAX_MARGIN 6
+
+#define SC132GS_BIN_FACTOR_MAX 4
+/*
+ * SC132GS System control registers
+ */
+#define SC132GS_SW_SLEEP				0x0100
+#define SC132GS_SW_RESET				0x0103
+#define SC132GS_SW_STREAM			0x0100
+
+#define SC132GS_SC_CMMN_CHIP_ID_H		0x300A
+#define SC132GS_SC_CMMN_CHIP_ID_L		0x300B
+#define SC132GS_SC_CMMN_SCCB_ID			0x300C
+#define SC132GS_SC_CMMN_SUB_ID			0x302A /* process, version*/
+/*Bit[7:4] Group control, Bit[3:0] Group ID*/
+#define SC132GS_GROUP_ACCESS			0x3208
+/*
+*Bit[3:0] Bit[19:16] of exposure,
+*remaining 16 bits lies in Reg0x3501&Reg0x3502
+*/
+#define SC132GS_EXPOSURE_H			0x3500
+#define SC132GS_EXPOSURE_M			0x3501
+#define SC132GS_EXPOSURE_L			0x3502
+/*Bit[1:0] means Bit[9:8] of gain*/
+#define SC132GS_AGC_H				0x350A
+#define SC132GS_AGC_L				0x350B /*Bit[7:0] of gain*/
+
+#define SC132GS_HORIZONTAL_START_H		0x3800 /*Bit[11:8]*/
+#define SC132GS_HORIZONTAL_START_L		0x3801 /*Bit[7:0]*/
+#define SC132GS_VERTICAL_START_H			0x3802 /*Bit[11:8]*/
+#define SC132GS_VERTICAL_START_L			0x3803 /*Bit[7:0]*/
+#define SC132GS_HORIZONTAL_END_H			0x3804 /*Bit[11:8]*/
+#define SC132GS_HORIZONTAL_END_L			0x3805 /*Bit[7:0]*/
+#define SC132GS_VERTICAL_END_H			0x3806 /*Bit[11:8]*/
+#define SC132GS_VERTICAL_END_L			0x3807 /*Bit[7:0]*/
+#define SC132GS_HORIZONTAL_OUTPUT_SIZE_H		0x3808 /*Bit[3:0]*/
+#define SC132GS_HORIZONTAL_OUTPUT_SIZE_L		0x3809 /*Bit[7:0]*/
+#define SC132GS_VERTICAL_OUTPUT_SIZE_H		0x380a /*Bit[3:0]*/
+#define SC132GS_VERTICAL_OUTPUT_SIZE_L		0x380b /*Bit[7:0]*/
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define SC132GS_TIMING_HTS_H			0x380C
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define SC132GS_TIMING_HTS_L			0x380D
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define SC132GS_TIMING_VTS_H			0x380e
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define SC132GS_TIMING_VTS_L			0x380f
+
+#define SC132GS_MWB_RED_GAIN_H			0x3400
+#define SC132GS_MWB_GREEN_GAIN_H			0x3402
+#define SC132GS_MWB_BLUE_GAIN_H			0x3404
+#define SC132GS_MWB_GAIN_MAX			0x0fff
+
+#define SC132GS_START_STREAMING			0x01
+#define SC132GS_STOP_STREAMING			0x00
+
+#define VCM_ADDR           0x0c
+#define VCM_CODE_MSB       0x04
+
+#define SC132GS_INVALID_CONFIG	0xffffffff
+
+#define SC132GS_VCM_SLEW_STEP			0x30F0
+#define SC132GS_VCM_SLEW_STEP_MAX		0x7
+#define SC132GS_VCM_SLEW_STEP_MASK		0x7
+#define SC132GS_VCM_CODE				0x30F2
+#define SC132GS_VCM_SLEW_TIME			0x30F4
+#define SC132GS_VCM_SLEW_TIME_MAX		0xffff
+#define SC132GS_VCM_ENABLE			0x8000
+
+#define SC132GS_VCM_MAX_FOCUS_NEG       -1023
+#define SC132GS_VCM_MAX_FOCUS_POS       1023
+
+#define DLC_ENABLE 1
+#define DLC_DISABLE 0
+#define VCM_PROTECTION_OFF     0xeca3
+#define VCM_PROTECTION_ON      0xdc51
+#define VCM_DEFAULT_S 0x0
+#define vcm_step_s(a) (u8)(a & 0xf)
+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3)
+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104)
+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200)
+#define vcm_val(data, s) (u16)(data << 4 | s)
+#define DIRECT_VCM vcm_dlc_mclk(0, 0)
+
+/* Defines for OTP Data Registers */
+#define SC132GS_FRAME_OFF_NUM		0x4202
+#define SC132GS_OTP_BYTE_MAX		32	//change to 32 as needed by otpdata
+#define SC132GS_OTP_SHORT_MAX		16
+#define SC132GS_OTP_START_ADDR		0x3D00
+#define SC132GS_OTP_END_ADDR		0x3D0F
+#define SC132GS_OTP_DATA_SIZE		320
+#define SC132GS_OTP_PROGRAM_REG      	0x3D80
+#define SC132GS_OTP_READ_REG		0x3D81	// 1:Enable 0:disable
+#define SC132GS_OTP_BANK_REG		0x3D84	//otp bank and mode
+#define SC132GS_OTP_READY_REG_DONE	1
+#define SC132GS_OTP_BANK_MAX		28
+#define SC132GS_OTP_BANK_SIZE		16	//16 bytes per bank
+#define SC132GS_OTP_READ_ONETIME		16
+#define SC132GS_OTP_MODE_READ		1
+
+typedef enum SC132GS_EXPOSURE_SETTING_e {
+	SC132GS_ANALOG_GAIN = 1 << 0,
+	SC132GS_INTEGRATION_TIME = 1 << 1,
+	SC132GS_DIGITAL_GAIN = 1 << 2,
+}SC132GS_EXPOSURE_SETTING_t;
+
+#if 0
+struct regval_list {
+	u16 reg_num;
+	u8 value;
+};
+
+struct sc132gs_resolution {
+	u8 *desc;
+	const struct sc132gs_reg *regs;
+	int res;
+	int width;
+	int height;
+	int fps;
+	int pix_clk_freq;
+	u16 pixels_per_line;
+	u16 lines_per_frame;
+	u8 bin_factor_x;
+	u8 bin_factor_y;
+	u8 bin_mode;
+	bool used;
+};
+
+struct sc132gs_format {
+	u8 *desc;
+	u32 pixelformat;
+	struct sc132gs_reg *regs;
+};
+
+enum vcm_type {
+	VCM_UNKNOWN,
+	VCM_AD5823,
+	VCM_DW9714,
+};
+
+/*
+ * sc132gs device structure.
+ */
+struct sc132gs_device {
+	struct v4l2_subdev sd;
+	struct media_pad pad;
+	struct v4l2_mbus_framefmt format;
+	struct mutex input_lock;
+	struct v4l2_ctrl_handler ctrl_handler;
+
+	struct camera_sensor_platform_data *platform_data;
+	struct timespec timestamp_t_focus_abs;
+	int vt_pix_clk_freq_mhz;
+	int fmt_idx;
+	int run_mode;
+	int otp_size;
+	u8 *otp_data;
+	u32 focus;
+	s16 number_of_steps;
+	u8 res;
+	u8 type;
+	bool vcm_update;
+	enum vcm_type vcm;
+};
+
+enum sc132gs_tok_type {
+	SC132GS_8BIT  = 0x0001,
+	SC132GS_16BIT = 0x0002,
+	SC132GS_32BIT = 0x0004,
+	SC132GS_TOK_TERM   = 0xf000,	/* terminating token for reg list */
+	SC132GS_TOK_DELAY  = 0xfe00,	/* delay token for reg list */
+	SC132GS_TOK_MASK = 0xfff0
+};
+
+/**
+ * struct sc132gs_reg - MI sensor  register format
+ * @type: type of the register
+ * @reg: 16-bit offset to register
+ * @val: 8/16/32-bit register value
+ *
+ * Define a structure for sensor register initialization values
+ */
+struct sc132gs_reg {
+	enum sc132gs_tok_type type;
+	u16 reg;
+	u32 val;	/* @set value for read/mod/write, @mask */
+};
+
+#define to_sc132gs_sensor(x) container_of(x, struct sc132gs_device, sd)
+
+#define SC132GS_MAX_WRITE_BUF_SIZE	30
+
+struct sc132gs_write_buffer {
+	u16 addr;
+	u8 data[SC132GS_MAX_WRITE_BUF_SIZE];
+};
+
+struct sc132gs_write_ctrl {
+	int index;
+	struct sc132gs_write_buffer buffer;
+};
+
+static const struct i2c_device_id sc132gs_id[] = {
+	{SC132GS_NAME, 0},
+	{}
+};
+
+static struct sc132gs_reg const sc132gs_global_setting[] = {
+	{SC132GS_8BIT, 0x0103, 0x01},
+	{SC132GS_8BIT, 0x3001, 0x0a},
+	{SC132GS_8BIT, 0x3002, 0x80},
+	{SC132GS_8BIT, 0x3006, 0x00},
+	{SC132GS_8BIT, 0x3011, 0x21},
+	{SC132GS_8BIT, 0x3012, 0x09},
+	{SC132GS_8BIT, 0x3013, 0x10},
+	{SC132GS_8BIT, 0x3014, 0x00},
+	{SC132GS_8BIT, 0x3015, 0x08},
+	{SC132GS_8BIT, 0x3016, 0xf0},
+	{SC132GS_8BIT, 0x3017, 0xf0},
+	{SC132GS_8BIT, 0x3018, 0xf0},
+	{SC132GS_8BIT, 0x301b, 0xb4},
+	{SC132GS_8BIT, 0x301d, 0x02},
+	{SC132GS_8BIT, 0x3021, 0x00},
+	{SC132GS_8BIT, 0x3022, 0x01},
+	{SC132GS_8BIT, 0x3028, 0x44},
+	{SC132GS_8BIT, 0x3098, 0x02},
+	{SC132GS_8BIT, 0x3099, 0x19},
+	{SC132GS_8BIT, 0x309a, 0x02},
+	{SC132GS_8BIT, 0x309b, 0x01},
+	{SC132GS_8BIT, 0x309c, 0x00},
+	{SC132GS_8BIT, 0x30a0, 0xd2},
+	{SC132GS_8BIT, 0x30a2, 0x01},
+	{SC132GS_8BIT, 0x30b2, 0x00},
+	{SC132GS_8BIT, 0x30b3, 0x7d},
+	{SC132GS_8BIT, 0x30b4, 0x03},
+	{SC132GS_8BIT, 0x30b5, 0x04},
+	{SC132GS_8BIT, 0x30b6, 0x01},
+	{SC132GS_8BIT, 0x3104, 0x21},
+	{SC132GS_8BIT, 0x3106, 0x00},
+	{SC132GS_8BIT, 0x3400, 0x04},
+	{SC132GS_8BIT, 0x3401, 0x00},
+	{SC132GS_8BIT, 0x3402, 0x04},
+	{SC132GS_8BIT, 0x3403, 0x00},
+	{SC132GS_8BIT, 0x3404, 0x04},
+	{SC132GS_8BIT, 0x3405, 0x00},
+	{SC132GS_8BIT, 0x3406, 0x01},
+	{SC132GS_8BIT, 0x3500, 0x00},
+	{SC132GS_8BIT, 0x3503, 0x07},
+	{SC132GS_8BIT, 0x3504, 0x00},
+	{SC132GS_8BIT, 0x3505, 0x00},
+	{SC132GS_8BIT, 0x3506, 0x00},
+	{SC132GS_8BIT, 0x3507, 0x02},
+	{SC132GS_8BIT, 0x3508, 0x00},
+	{SC132GS_8BIT, 0x3509, 0x10},
+	{SC132GS_8BIT, 0x350a, 0x00},
+	{SC132GS_8BIT, 0x350b, 0x40},
+	{SC132GS_8BIT, 0x3601, 0x0a},
+	{SC132GS_8BIT, 0x3602, 0x38},
+	{SC132GS_8BIT, 0x3612, 0x80},
+	{SC132GS_8BIT, 0x3620, 0x54},
+	{SC132GS_8BIT, 0x3621, 0xc7},
+	{SC132GS_8BIT, 0x3622, 0x0f},
+	{SC132GS_8BIT, 0x3625, 0x10},
+	{SC132GS_8BIT, 0x3630, 0x55},
+	{SC132GS_8BIT, 0x3631, 0xf4},
+	{SC132GS_8BIT, 0x3632, 0x00},
+	{SC132GS_8BIT, 0x3633, 0x34},
+	{SC132GS_8BIT, 0x3634, 0x02},
+	{SC132GS_8BIT, 0x364d, 0x0d},
+	{SC132GS_8BIT, 0x364f, 0xdd},
+	{SC132GS_8BIT, 0x3660, 0x04},
+	{SC132GS_8BIT, 0x3662, 0x10},
+	{SC132GS_8BIT, 0x3663, 0xf1},
+	{SC132GS_8BIT, 0x3665, 0x00},
+	{SC132GS_8BIT, 0x3666, 0x20},
+	{SC132GS_8BIT, 0x3667, 0x00},
+	{SC132GS_8BIT, 0x366a, 0x80},
+	{SC132GS_8BIT, 0x3680, 0xe0},
+	{SC132GS_8BIT, 0x3681, 0x00},
+	{SC132GS_8BIT, 0x3700, 0x42},
+	{SC132GS_8BIT, 0x3701, 0x14},
+	{SC132GS_8BIT, 0x3702, 0xa0},
+	{SC132GS_8BIT, 0x3703, 0xd8},
+	{SC132GS_8BIT, 0x3704, 0x78},
+	{SC132GS_8BIT, 0x3705, 0x02},
+	{SC132GS_8BIT, 0x370a, 0x00},
+	{SC132GS_8BIT, 0x370b, 0x20},
+	{SC132GS_8BIT, 0x370c, 0x0c},
+	{SC132GS_8BIT, 0x370d, 0x11},
+	{SC132GS_8BIT, 0x370e, 0x00},
+	{SC132GS_8BIT, 0x370f, 0x40},
+	{SC132GS_8BIT, 0x3710, 0x00},
+	{SC132GS_8BIT, 0x371a, 0x1c},
+	{SC132GS_8BIT, 0x371b, 0x05},
+	{SC132GS_8BIT, 0x371c, 0x01},
+	{SC132GS_8BIT, 0x371e, 0xa1},
+	{SC132GS_8BIT, 0x371f, 0x0c},
+	{SC132GS_8BIT, 0x3721, 0x00},
+	{SC132GS_8BIT, 0x3724, 0x10},
+	{SC132GS_8BIT, 0x3726, 0x00},
+	{SC132GS_8BIT, 0x372a, 0x01},
+	{SC132GS_8BIT, 0x3730, 0x10},
+	{SC132GS_8BIT, 0x3738, 0x22},
+	{SC132GS_8BIT, 0x3739, 0xe5},
+	{SC132GS_8BIT, 0x373a, 0x50},
+	{SC132GS_8BIT, 0x373b, 0x02},
+	{SC132GS_8BIT, 0x373c, 0x41},
+	{SC132GS_8BIT, 0x373f, 0x02},
+	{SC132GS_8BIT, 0x3740, 0x42},
+	{SC132GS_8BIT, 0x3741, 0x02},
+	{SC132GS_8BIT, 0x3742, 0x18},
+	{SC132GS_8BIT, 0x3743, 0x01},
+	{SC132GS_8BIT, 0x3744, 0x02},
+	{SC132GS_8BIT, 0x3747, 0x10},
+	{SC132GS_8BIT, 0x374c, 0x04},
+	{SC132GS_8BIT, 0x3751, 0xf0},
+	{SC132GS_8BIT, 0x3752, 0x00},
+	{SC132GS_8BIT, 0x3753, 0x00},
+	{SC132GS_8BIT, 0x3754, 0xc0},
+	{SC132GS_8BIT, 0x3755, 0x00},
+	{SC132GS_8BIT, 0x3756, 0x1a},
+	{SC132GS_8BIT, 0x3758, 0x00},
+	{SC132GS_8BIT, 0x3759, 0x0f},
+	{SC132GS_8BIT, 0x376b, 0x44},
+	{SC132GS_8BIT, 0x375c, 0x04},
+	{SC132GS_8BIT, 0x3774, 0x10},
+	{SC132GS_8BIT, 0x3776, 0x00},
+	{SC132GS_8BIT, 0x377f, 0x08},
+	{SC132GS_8BIT, 0x3780, 0x22},
+	{SC132GS_8BIT, 0x3781, 0x0c},
+	{SC132GS_8BIT, 0x3784, 0x2c},
+	{SC132GS_8BIT, 0x3785, 0x1e},
+	{SC132GS_8BIT, 0x378f, 0xf5},
+	{SC132GS_8BIT, 0x3791, 0xb0},
+	{SC132GS_8BIT, 0x3795, 0x00},
+	{SC132GS_8BIT, 0x3796, 0x64},
+	{SC132GS_8BIT, 0x3797, 0x11},
+	{SC132GS_8BIT, 0x3798, 0x30},
+	{SC132GS_8BIT, 0x3799, 0x41},
+	{SC132GS_8BIT, 0x379a, 0x07},
+	{SC132GS_8BIT, 0x379b, 0xb0},
+	{SC132GS_8BIT, 0x379c, 0x0c},
+	{SC132GS_8BIT, 0x37c5, 0x00},
+	{SC132GS_8BIT, 0x37c6, 0x00},
+	{SC132GS_8BIT, 0x37c7, 0x00},
+	{SC132GS_8BIT, 0x37c9, 0x00},
+	{SC132GS_8BIT, 0x37ca, 0x00},
+	{SC132GS_8BIT, 0x37cb, 0x00},
+	{SC132GS_8BIT, 0x37de, 0x00},
+	{SC132GS_8BIT, 0x37df, 0x00},
+	{SC132GS_8BIT, 0x3800, 0x00},
+	{SC132GS_8BIT, 0x3801, 0x00},
+	{SC132GS_8BIT, 0x3802, 0x00},
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3810, 0x00},
+	{SC132GS_8BIT, 0x3812, 0x00},
+	{SC132GS_8BIT, 0x3823, 0x00},
+	{SC132GS_8BIT, 0x3824, 0x00},
+	{SC132GS_8BIT, 0x3825, 0x00},
+	{SC132GS_8BIT, 0x3826, 0x00},
+	{SC132GS_8BIT, 0x3827, 0x00},
+	{SC132GS_8BIT, 0x382a, 0x04},
+	{SC132GS_8BIT, 0x3a04, 0x06},
+	{SC132GS_8BIT, 0x3a05, 0x14},
+	{SC132GS_8BIT, 0x3a06, 0x00},
+	{SC132GS_8BIT, 0x3a07, 0xfe},
+	{SC132GS_8BIT, 0x3b00, 0x00},
+	{SC132GS_8BIT, 0x3b02, 0x00},
+	{SC132GS_8BIT, 0x3b03, 0x00},
+	{SC132GS_8BIT, 0x3b04, 0x00},
+	{SC132GS_8BIT, 0x3b05, 0x00},
+	{SC132GS_8BIT, 0x3e07, 0x20},
+	{SC132GS_8BIT, 0x4000, 0x08},
+	{SC132GS_8BIT, 0x4001, 0x04},
+	{SC132GS_8BIT, 0x4002, 0x45},
+	{SC132GS_8BIT, 0x4004, 0x08},
+	{SC132GS_8BIT, 0x4005, 0x18},
+	{SC132GS_8BIT, 0x4006, 0x20},
+	{SC132GS_8BIT, 0x4008, 0x24},
+	{SC132GS_8BIT, 0x4009, 0x10},
+	{SC132GS_8BIT, 0x400c, 0x00},
+	{SC132GS_8BIT, 0x400d, 0x00},
+	{SC132GS_8BIT, 0x4058, 0x00},
+	{SC132GS_8BIT, 0x404e, 0x37},
+	{SC132GS_8BIT, 0x404f, 0x8f},
+	{SC132GS_8BIT, 0x4058, 0x00},
+	{SC132GS_8BIT, 0x4101, 0xb2},
+	{SC132GS_8BIT, 0x4303, 0x00},
+	{SC132GS_8BIT, 0x4304, 0x08},
+	{SC132GS_8BIT, 0x4307, 0x31},
+	{SC132GS_8BIT, 0x4311, 0x04},
+	{SC132GS_8BIT, 0x4315, 0x01},
+	{SC132GS_8BIT, 0x4511, 0x05},
+	{SC132GS_8BIT, 0x4512, 0x01},
+	{SC132GS_8BIT, 0x4806, 0x00},
+	{SC132GS_8BIT, 0x4816, 0x52},
+	{SC132GS_8BIT, 0x481f, 0x30},
+	{SC132GS_8BIT, 0x4826, 0x2c},
+	{SC132GS_8BIT, 0x4831, 0x64},
+	{SC132GS_8BIT, 0x4d00, 0x04},
+	{SC132GS_8BIT, 0x4d01, 0x71},
+	{SC132GS_8BIT, 0x4d02, 0xfd},
+	{SC132GS_8BIT, 0x4d03, 0xf5},
+	{SC132GS_8BIT, 0x4d04, 0x0c},
+	{SC132GS_8BIT, 0x4d05, 0xcc},
+	{SC132GS_8BIT, 0x4837, 0x0a},
+	{SC132GS_8BIT, 0x5000, 0x06},
+	{SC132GS_8BIT, 0x5001, 0x01},
+	{SC132GS_8BIT, 0x5003, 0x20},
+	{SC132GS_8BIT, 0x5046, 0x0a},
+	{SC132GS_8BIT, 0x5013, 0x00},
+	{SC132GS_8BIT, 0x5046, 0x0a},
+	{SC132GS_8BIT, 0x5780, 0x1c},
+	{SC132GS_8BIT, 0x5786, 0x20},
+	{SC132GS_8BIT, 0x5787, 0x10},
+	{SC132GS_8BIT, 0x5788, 0x18},
+	{SC132GS_8BIT, 0x578a, 0x04},
+	{SC132GS_8BIT, 0x578b, 0x02},
+	{SC132GS_8BIT, 0x578c, 0x02},
+	{SC132GS_8BIT, 0x578e, 0x06},
+	{SC132GS_8BIT, 0x578f, 0x02},
+	{SC132GS_8BIT, 0x5790, 0x02},
+	{SC132GS_8BIT, 0x5791, 0xff},
+	{SC132GS_8BIT, 0x5842, 0x01},
+	{SC132GS_8BIT, 0x5843, 0x2b},
+	{SC132GS_8BIT, 0x5844, 0x01},
+	{SC132GS_8BIT, 0x5845, 0x92},
+	{SC132GS_8BIT, 0x5846, 0x01},
+	{SC132GS_8BIT, 0x5847, 0x8f},
+	{SC132GS_8BIT, 0x5848, 0x01},
+	{SC132GS_8BIT, 0x5849, 0x0c},
+	{SC132GS_8BIT, 0x5e00, 0x00},
+	{SC132GS_8BIT, 0x5e10, 0x0c},
+	{SC132GS_8BIT, 0x0100, 0x00},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 654x496 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct sc132gs_reg const sc132gs_654x496[] = {
+	{SC132GS_8BIT, 0x3501, 0x3d},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe6},
+	{SC132GS_8BIT, 0x3709, 0xc7},
+	{SC132GS_8BIT, 0x3803, 0x00},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xa3},
+	{SC132GS_8BIT, 0x3808, 0x02},
+	{SC132GS_8BIT, 0x3809, 0x90},
+	{SC132GS_8BIT, 0x380a, 0x01},
+	{SC132GS_8BIT, 0x380b, 0xf0},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x08},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x04},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+*DS from 2592x1952
+*/
+static struct sc132gs_reg const sc132gs_1296x976[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+
+	{SC132GS_8BIT, 0x3800, 0x00},
+	{SC132GS_8BIT, 0x3801, 0x00},
+	{SC132GS_8BIT, 0x3802, 0x00},
+	{SC132GS_8BIT, 0x3803, 0x00},
+
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xA3},
+
+	{SC132GS_8BIT, 0x3808, 0x05},
+	{SC132GS_8BIT, 0x3809, 0x10},
+	{SC132GS_8BIT, 0x380a, 0x03},
+	{SC132GS_8BIT, 0x380b, 0xD0},
+
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+
+	{SC132GS_8BIT, 0x3810, 0x00},
+	{SC132GS_8BIT, 0x3811, 0x10},
+	{SC132GS_8BIT, 0x3812, 0x00},
+	{SC132GS_8BIT, 0x3813, 0x02},
+
+	{SC132GS_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC132GS_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+
+};
+
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2564x1956
+ */
+static struct sc132gs_reg const sc132gs_336x256[] = {
+	{SC132GS_8BIT, 0x3501, 0x3d},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe6},
+	{SC132GS_8BIT, 0x3709, 0xc7},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xa3},
+	{SC132GS_8BIT, 0x3808, 0x01},
+	{SC132GS_8BIT, 0x3809, 0x50},
+	{SC132GS_8BIT, 0x380a, 0x01},
+	{SC132GS_8BIT, 0x380b, 0x00},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x1E},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x04},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2368x1956
+ */
+static struct sc132gs_reg const sc132gs_368x304[] = {
+	{SC132GS_8BIT, 0x3501, 0x3d},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe6},
+	{SC132GS_8BIT, 0x3709, 0xc7},
+	{SC132GS_8BIT, 0x3808, 0x01},
+	{SC132GS_8BIT, 0x3809, 0x70},
+	{SC132GS_8BIT, 0x380a, 0x01},
+	{SC132GS_8BIT, 0x380b, 0x30},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x80},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x04},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * sc132gs_192x160 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2460x1956
+ */
+static struct sc132gs_reg const sc132gs_192x160[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x80},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xA3},
+	{SC132GS_8BIT, 0x3808, 0x00},
+	{SC132GS_8BIT, 0x3809, 0xC0},
+	{SC132GS_8BIT, 0x380a, 0x00},
+	{SC132GS_8BIT, 0x380b, 0xA0},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x40},
+	{SC132GS_8BIT, 0x3813, 0x00},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x04},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+
+static struct sc132gs_reg const sc132gs_736x496[] = {
+	{SC132GS_8BIT, 0x3501, 0x3d},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe6},
+	{SC132GS_8BIT, 0x3709, 0xc7},
+	{SC132GS_8BIT, 0x3803, 0x68},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0x3b},
+	{SC132GS_8BIT, 0x3808, 0x02},
+	{SC132GS_8BIT, 0x3809, 0xe0},
+	{SC132GS_8BIT, 0x380a, 0x01},
+	{SC132GS_8BIT, 0x380b, 0xf0},
+	{SC132GS_8BIT, 0x380c, 0x0a}, /*hts*/
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07}, /*vts*/
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x08},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x04},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+static struct sc132gs_reg const sc132gs_736x496[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe6},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0x00},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xa3},
+	{SC132GS_8BIT, 0x3808, 0x02},
+	{SC132GS_8BIT, 0x3809, 0xe0},
+	{SC132GS_8BIT, 0x380a, 0x01},
+	{SC132GS_8BIT, 0x380b, 0xf0},
+	{SC132GS_8BIT, 0x380c, 0x0d},
+	{SC132GS_8BIT, 0x380d, 0xb0},
+	{SC132GS_8BIT, 0x380e, 0x05},
+	{SC132GS_8BIT, 0x380f, 0xf2},
+	{SC132GS_8BIT, 0x3811, 0x08},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x31},
+	{SC132GS_8BIT, 0x3815, 0x31},
+	{SC132GS_8BIT, 0x3820, 0x01},
+	{SC132GS_8BIT, 0x3821, 0x1f},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+*/
+/*
+ * 976x556 30fps 8.8ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct sc132gs_reg const sc132gs_976x556[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0xf0},
+	{SC132GS_8BIT, 0x3806, 0x06},
+	{SC132GS_8BIT, 0x3807, 0xa7},
+	{SC132GS_8BIT, 0x3808, 0x03},
+	{SC132GS_8BIT, 0x3809, 0xd0},
+	{SC132GS_8BIT, 0x380a, 0x02},
+	{SC132GS_8BIT, 0x380b, 0x2C},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x10},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*DS from 2624x1492*/
+static struct sc132gs_reg const sc132gs_1296x736[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+
+	{SC132GS_8BIT, 0x3800, 0x00},
+	{SC132GS_8BIT, 0x3801, 0x00},
+	{SC132GS_8BIT, 0x3802, 0x00},
+	{SC132GS_8BIT, 0x3803, 0x00},
+
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xA3},
+
+	{SC132GS_8BIT, 0x3808, 0x05},
+	{SC132GS_8BIT, 0x3809, 0x10},
+	{SC132GS_8BIT, 0x380a, 0x02},
+	{SC132GS_8BIT, 0x380b, 0xe0},
+
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+
+	{SC132GS_8BIT, 0x3813, 0xE8},
+
+	{SC132GS_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC132GS_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+static struct sc132gs_reg const sc132gs_1636p_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0xf0},
+	{SC132GS_8BIT, 0x3806, 0x06},
+	{SC132GS_8BIT, 0x3807, 0xa7},
+	{SC132GS_8BIT, 0x3808, 0x06},
+	{SC132GS_8BIT, 0x3809, 0x64},
+	{SC132GS_8BIT, 0x380a, 0x04},
+	{SC132GS_8BIT, 0x380b, 0x48},
+	{SC132GS_8BIT, 0x380c, 0x0a}, /*hts*/
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07}, /*vts*/
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x02},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+static struct sc132gs_reg const sc132gs_1616x1216_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x80},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3800, 0x00},	/*{3800,3801} Array X start*/
+	{SC132GS_8BIT, 0x3801, 0x08},	/* 04 //{3800,3801} Array X start*/
+	{SC132GS_8BIT, 0x3802, 0x00},	/*{3802,3803} Array Y start*/
+	{SC132GS_8BIT, 0x3803, 0x04},	/* 00  //{3802,3803} Array Y start*/
+	{SC132GS_8BIT, 0x3804, 0x0a},	/*{3804,3805} Array X end*/
+	{SC132GS_8BIT, 0x3805, 0x37},	/* 3b  //{3804,3805} Array X end*/
+	{SC132GS_8BIT, 0x3806, 0x07},	/*{3806,3807} Array Y end*/
+	{SC132GS_8BIT, 0x3807, 0x9f},	/* a3  //{3806,3807} Array Y end*/
+	{SC132GS_8BIT, 0x3808, 0x06},	/*{3808,3809} Final output H size*/
+	{SC132GS_8BIT, 0x3809, 0x50},	/*{3808,3809} Final output H size*/
+	{SC132GS_8BIT, 0x380a, 0x04},	/*{380a,380b} Final output V size*/
+	{SC132GS_8BIT, 0x380b, 0xc0},	/*{380a,380b} Final output V size*/
+	{SC132GS_8BIT, 0x380c, 0x0a},	/*{380c,380d} HTS*/
+	{SC132GS_8BIT, 0x380d, 0x80},	/*{380c,380d} HTS*/
+	{SC132GS_8BIT, 0x380e, 0x07},	/*{380e,380f} VTS*/
+	{SC132GS_8BIT, 0x380f, 0xc0},	/* bc	//{380e,380f} VTS*/
+	{SC132GS_8BIT, 0x3810, 0x00},	/*{3810,3811} windowing X offset*/
+	{SC132GS_8BIT, 0x3811, 0x10},	/*{3810,3811} windowing X offset*/
+	{SC132GS_8BIT, 0x3812, 0x00},	/*{3812,3813} windowing Y offset*/
+	{SC132GS_8BIT, 0x3813, 0x06},	/*{3812,3813} windowing Y offset*/
+	{SC132GS_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC132GS_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC132GS_8BIT, 0x3820, 0x00},	/*FLIP/Binnning control*/
+	{SC132GS_8BIT, 0x3821, 0x1e},	/*MIRROR control*/
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x5041, 0x84},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+
+/*
+ * 1940x1096 30fps 8.8ms VBlanking 2lane 10bit (Scaling)
+ */
+static struct sc132gs_reg const sc132gs_1940x1096[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0xf0},
+	{SC132GS_8BIT, 0x3806, 0x06},
+	{SC132GS_8BIT, 0x3807, 0xa7},
+	{SC132GS_8BIT, 0x3808, 0x07},
+	{SC132GS_8BIT, 0x3809, 0x94},
+	{SC132GS_8BIT, 0x380a, 0x04},
+	{SC132GS_8BIT, 0x380b, 0x48},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x02},
+	{SC132GS_8BIT, 0x3813, 0x02},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x80},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+static struct sc132gs_reg const sc132gs_2592x1456_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3800, 0x00},
+	{SC132GS_8BIT, 0x3801, 0x00},
+	{SC132GS_8BIT, 0x3802, 0x00},
+	{SC132GS_8BIT, 0x3803, 0xf0},
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3806, 0x06},
+	{SC132GS_8BIT, 0x3807, 0xa4},
+	{SC132GS_8BIT, 0x3808, 0x0a},
+	{SC132GS_8BIT, 0x3809, 0x20},
+	{SC132GS_8BIT, 0x380a, 0x05},
+	{SC132GS_8BIT, 0x380b, 0xb0},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x10},
+	{SC132GS_8BIT, 0x3813, 0x00},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+static struct sc132gs_reg const sc132gs_2576x1456_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3800, 0x00},
+	{SC132GS_8BIT, 0x3801, 0x00},
+	{SC132GS_8BIT, 0x3802, 0x00},
+	{SC132GS_8BIT, 0x3803, 0xf0},
+	{SC132GS_8BIT, 0x3804, 0x0a},
+	{SC132GS_8BIT, 0x3805, 0x3f},
+	{SC132GS_8BIT, 0x3806, 0x06},
+	{SC132GS_8BIT, 0x3807, 0xa4},
+	{SC132GS_8BIT, 0x3808, 0x0a},
+	{SC132GS_8BIT, 0x3809, 0x10},
+	{SC132GS_8BIT, 0x380a, 0x05},
+	{SC132GS_8BIT, 0x380b, 0xb0},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x18},
+	{SC132GS_8BIT, 0x3813, 0x00},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 2592x1944 30fps 0.6ms VBlanking 2lane 10Bit
+ */
+static struct sc132gs_reg const sc132gs_2592x1944_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0x00},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xa3},
+	{SC132GS_8BIT, 0x3808, 0x0a},
+	{SC132GS_8BIT, 0x3809, 0x20},
+	{SC132GS_8BIT, 0x380a, 0x07},
+	{SC132GS_8BIT, 0x380b, 0x98},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x10},
+	{SC132GS_8BIT, 0x3813, 0x00},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 11:9 Full FOV Output, expected FOV Res: 2346x1920
+ * ISP Effect Res: 1408x1152
+ * Sensor out: 1424x1168, DS From: 2380x1952
+ *
+ * WA: Left Offset: 8, Hor scal: 64
+ */
+static struct sc132gs_reg const sc132gs_1424x1168_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{SC132GS_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{SC132GS_8BIT, 0x3801, 0x50}, /* 80 */
+	{SC132GS_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{SC132GS_8BIT, 0x3803, 0x02}, /* 2 */
+	{SC132GS_8BIT, 0x3804, 0x09}, /* TIMING_X_ADDR_END */
+	{SC132GS_8BIT, 0x3805, 0xdd}, /* 2525 */
+	{SC132GS_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{SC132GS_8BIT, 0x3807, 0xa1}, /* 1953 */
+	{SC132GS_8BIT, 0x3808, 0x05}, /* TIMING_X_OUTPUT_SIZE */
+	{SC132GS_8BIT, 0x3809, 0x90}, /* 1424 */
+	{SC132GS_8BIT, 0x380a, 0x04}, /* TIMING_Y_OUTPUT_SIZE */
+	{SC132GS_8BIT, 0x380b, 0x90}, /* 1168 */
+	{SC132GS_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{SC132GS_8BIT, 0x3811, 0x02}, /* 2 */
+	{SC132GS_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{SC132GS_8BIT, 0x3813, 0x00}, /* 0 */
+	{SC132GS_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{SC132GS_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+/*
+ * 3:2 Full FOV Output, expected FOV Res: 2560x1706
+ * ISP Effect Res: 720x480
+ * Sensor out: 736x496, DS From 2616x1764
+ */
+static struct sc132gs_reg const sc132gs_736x496_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{SC132GS_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{SC132GS_8BIT, 0x3801, 0x02}, /* 2 */
+	{SC132GS_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{SC132GS_8BIT, 0x3803, 0x62}, /* 98 */
+	{SC132GS_8BIT, 0x3804, 0x0a}, /* TIMING_X_ADDR_END */
+	{SC132GS_8BIT, 0x3805, 0x3b}, /* 2619 */
+	{SC132GS_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{SC132GS_8BIT, 0x3807, 0x43}, /* 1859 */
+	{SC132GS_8BIT, 0x3808, 0x02}, /* TIMING_X_OUTPUT_SIZE */
+	{SC132GS_8BIT, 0x3809, 0xe0}, /* 736 */
+	{SC132GS_8BIT, 0x380a, 0x01}, /* TIMING_Y_OUTPUT_SIZE */
+	{SC132GS_8BIT, 0x380b, 0xf0}, /* 496 */
+	{SC132GS_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{SC132GS_8BIT, 0x3811, 0x02}, /* 2 */
+	{SC132GS_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{SC132GS_8BIT, 0x3813, 0x00}, /* 0 */
+	{SC132GS_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{SC132GS_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+static struct sc132gs_reg const sc132gs_2576x1936_30fps[] = {
+	{SC132GS_8BIT, 0x3501, 0x7b},
+	{SC132GS_8BIT, 0x3502, 0x00},
+	{SC132GS_8BIT, 0x3708, 0xe2},
+	{SC132GS_8BIT, 0x3709, 0xc3},
+	{SC132GS_8BIT, 0x3803, 0x00},
+	{SC132GS_8BIT, 0x3806, 0x07},
+	{SC132GS_8BIT, 0x3807, 0xa3},
+	{SC132GS_8BIT, 0x3808, 0x0a},
+	{SC132GS_8BIT, 0x3809, 0x10},
+	{SC132GS_8BIT, 0x380a, 0x07},
+	{SC132GS_8BIT, 0x380b, 0x90},
+	{SC132GS_8BIT, 0x380c, 0x0a},
+	{SC132GS_8BIT, 0x380d, 0x80},
+	{SC132GS_8BIT, 0x380e, 0x07},
+	{SC132GS_8BIT, 0x380f, 0xc0},
+	{SC132GS_8BIT, 0x3811, 0x18},
+	{SC132GS_8BIT, 0x3813, 0x00},
+	{SC132GS_8BIT, 0x3814, 0x11},
+	{SC132GS_8BIT, 0x3815, 0x11},
+	{SC132GS_8BIT, 0x3820, 0x00},
+	{SC132GS_8BIT, 0x3821, 0x1e},
+	{SC132GS_8BIT, 0x5002, 0x00},
+	{SC132GS_8BIT, 0x0100, 0x01},
+	{SC132GS_TOK_TERM, 0, 0}
+};
+
+struct sc132gs_resolution sc132gs_res_preview[] = {
+	{
+		.desc = "sc132gs_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_736x496_30fps,
+	},
+	{
+		.desc = "sc132gs_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_1616x1216_30fps,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2576,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2576x1456_30fps,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2576,
+		.height = 1936,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2576x1936_30fps,
+	},
+};
+#define N_RES_PREVIEW (ARRAY_SIZE(sc132gs_res_preview))
+
+struct sc132gs_resolution sc132gs_res_still[] = {
+	{
+		.desc = "sc132gs_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_736x496_30fps,
+	},
+	{
+		.desc = "sc132gs_1424x1168_30fps",
+		.width = 1424,
+		.height = 1168,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_1424x1168_30fps,
+	},
+	{
+		.desc = "sc132gs_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_1616x1216_30fps,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2592x1456_30fps,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2592x1944_30fps,
+	},
+};
+#define N_RES_STILL (ARRAY_SIZE(sc132gs_res_still))
+
+struct sc132gs_resolution sc132gs_res_video[] = {
+	{
+		.desc = "sc132gs_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc132gs_736x496,
+	},
+	{
+		.desc = "sc132gs_336x256_30fps",
+		.width = 336,
+		.height = 256,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc132gs_336x256,
+	},
+	{
+		.desc = "sc132gs_368x304_30fps",
+		.width = 368,
+		.height = 304,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc132gs_368x304,
+	},
+	{
+		.desc = "sc132gs_192x160_30fps",
+		.width = 192,
+		.height = 160,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc132gs_192x160,
+	},
+	{
+		.desc = "sc132gs_1296x736_30fps",
+		.width = 1296,
+		.height = 736,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = sc132gs_1296x736,
+	},
+	{
+		.desc = "sc132gs_1296x976_30fps",
+		.width = 1296,
+		.height = 976,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = sc132gs_1296x976,
+	},
+	{
+		.desc = "sc132gs_1636P_30fps",
+		.width = 1636,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_1636p_30fps,
+	},
+	{
+		.desc = "sc132gs_1080P_30fps",
+		.width = 1940,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_1940x1096,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2592x1456_30fps,
+	},
+	{
+		.desc = "sc132gs_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc132gs_2592x1944_30fps,
+	},
+};
+
+#define N_RES_VIDEO (ARRAY_SIZE(sc132gs_res_video))
+
+static struct sc132gs_resolution *sc132gs_res = sc132gs_res_preview;
+static unsigned long N_RES = N_RES_PREVIEW;
+#endif
+#endif

+ 518 - 0
drivers/SC2310/3aconfig_SC2310.json

@@ -0,0 +1,518 @@
+	{
+    "root" : [
+        {
+            "classname" : "Aev1",
+            "enable" : false
+        },
+        {
+            "classname" : "Aev2",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roiWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 2.6,
+            "setPoint" : 30,
+            "roi_start" : 12,
+            "roi_end" : 20,
+            "roi_weight" : 1
+        },
+        {
+            "classname" : "Aehdr",
+            "enable" : false,
+            "motionThreshold" : 0.5,
+            "roi_start" : 8,
+            "roi_end" : 24,
+            "roi_weight" : 0.5,
+            "faceWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 12,
+            "setPoint" : 30
+        },
+        {
+            "classname" : "AdaptiveAe",
+            "enable" : true,
+            "motionThreshold" : 0.7,
+            "roi_start" : 7,
+            "roi_end" : 20,
+            "roi_weight" : 1,
+            "faceWeight" : 0.6,
+            "motionFilter"  : 0.5,
+            "targetFilter"  : 0.5,
+            "wdrContrast.min" : 150,
+            "wdrContrast.max" : 150,
+            "lowlight" : {
+                "linear_repress" : [0.8, 0.7, 0.5, 0.5, 0.4],
+                "linear_gain" : [4, 8, 16, 32, 100],
+                "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8],
+                "hdr_gain" : [4, 8, 16, 32, 100]
+            },
+            "maxSensorAgain" : 15.5,
+            "maxSensorDgain" : 1,
+            "maxIspDgain" : 1,
+            "setPoint" : 60
+        },
+        {
+            "classname" : "Awbv2",
+            "enable" : true,
+            "illuorder" : "A, D50, D65, D75, TL84, F12, CWF",
+            "indoor" : [1, 1, 1, 1, 1, 1, 1],
+            "outdoor" : [1, 1, 1, 1, 1, 1, 1],
+            "transition" : [1, 1, 1, 1, 1, 1, 1],
+            "avg" : 0.0
+        },
+        {
+            "classname" : "IspController",
+            "enable" : true
+        },
+        {
+            "classname" : "AutoHdr",
+            "enable" : false
+        },
+        {
+            "classname" : "DciHist",
+            "enable" : false,
+            "gaussMeanPos" : 64,
+            "gaussSigmaPos" : 128,
+            "gaussAmpPos" : 1.0,
+            "gaussMeanNeg" : 0,
+            "gaussSigmaNeg" : 128,
+            "gaussAmpNeg" : 1.0
+        },
+        {
+            "classname" : "SensorController",
+            "enable" : true
+        },
+        {
+            "classname" : "AGamma64",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023],
+                        [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 914, 930, 945, 961, 977, 992, 1008, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curve" : [
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023],
+                        [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ACproc",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1.2, 1.1, 1, 1, 1, 1],
+                    "brightness" : [0, 0, 0, 0, 0, 0],
+                    "saturation" : [1.2, 1.05, 0.92, 0.80, 0.75, 0.6],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "contrast" : [1.0, 1.0, 1.3, 1.3, 1.5, 1.85],
+                    "brightness" : [-12, -12, -24, -30, -16, 0],
+                    "saturation" : [1.25, 1.0, 0.9, 0.8, 0.7, 0.6],
+                    "hue" : [0, 0, 0, 0, 0, 0],
+                    "chromaout" : [2, 2, 2, 2, 2, 2],
+                    "lumain" : [2, 2, 2, 2, 2, 2],
+                    "lumaout" : [2, 2, 2, 2, 2, 2]
+                }
+            ]
+        },
+        {
+            "classname" : "Aee",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [1024, 1024, 1024, 1024, 1024, 1024],
+                    "ydown" : [1024, 1024, 1024, 1024, 1024, 1024],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [1000, 1000, 1000, 1000, 500, 200]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "strength" : [100, 100, 100, 100, 100, 100],
+                    "srcStrength" : [1, 1, 1, 1, 1, 1],
+                    "yup" : [5000, 5000, 5000, 5000, 5000, 5000],
+                    "ydown" : [8000, 8000, 5000, 5000, 5000, 5000],
+                    "uvgain" : [0, 0, 0, 0, 0, 0],
+                    "edgegain" : [2000, 2000, 2000, 1500, 600, 200]
+                }
+            ]
+        },
+        {
+            "classname" : "ACa",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enableCA" : [1, 1, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ],
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023],
+                        [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enableCA" : [0, 0, 1, 1, 1, 1],
+                    "enableDCI" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "curveCA" : [
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024],
+                        [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024]
+                    ], 
+                    "curveDCI" : [
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+                        [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022],
+			            [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ADmsc2",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "demoire_enable" : true,			
+            "demoire_area_thr" : 16,
+            "demoire_sat_shrink" : 8,
+            "demoire_r2" : 256,
+            "demoire_r1" : 0,           
+		    "demoire_t2_shift" : 2,
+            "demoire_t1" : 180,
+            "demoire_edge_r2" : 256,
+            "demoire_edge_r1" : 20,
+            "demoire_edge_t2_shift" : 4,
+            "demoire_edge_t1" :20,	
+            "depurple_enable" : true,
+            "depurple_red_sat" : true,	
+            "depurple_blue_sat" : true,	
+            "depurple_sat_shrink" : 8,				
+            "depurple_thr" : 40,
+            "skin_enable" : true,			
+            "cb_thr_max_2047" : 10,
+            "cb_thr_min_2047" : 8,
+            "cr_thr_max_2047" : 10,
+            "cr_thr_min_2047" : 8,
+            "y_thr_max_2047" : 10,
+            "y_thr_min_2047" : 8,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [1, 1, 1, 1, 1, 1],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [70, 60, 40, 20, 20, 0],
+                    "facwhite" : [70, 60, 60, 40, 20, 0],
+                    "maxblack" : [100, 100, 100, 100, 100, 100],
+                    "maxwhite" : [100, 100, 100, 100, 100, 100],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [5, 5, 5, 5, 5, 5],
+                    "gsharpen" : [8, 8, 8, 8, 8, 8],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],					
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "enableSharpen" : [0, 0, 0, 0, 0, 0],
+                    "enableSharpenLine" : [0, 0, 0, 0, 0, 0],
+                    "facblack" : [200, 200, 100, 50, 20, 20],
+                    "facwhite" : [200, 200, 150, 80, 40, 20],
+                    "maxblack" : [200, 200, 100, 100, 100, 100],
+                    "maxwhite" : [200, 200, 200, 200, 200, 200],
+                    "t1" : [0, 0, 0, 0, 0, 0],
+                    "t2" : [0, 0, 0, 0, 0, 0],
+                    "t3" : [0, 0, 0, 0, 0, 0],
+                    "t4" : [0, 0, 0, 0, 0, 0],
+                    "r1" : [0, 0, 0, 0, 0, 0],
+                    "r2" : [128, 128, 128, 128, 128, 128],
+                    "r3" : [256, 256, 256, 256, 256, 256],
+                    "gdenoise" : [0, 0, 0, 0, 0, 0],
+                    "gsharpen" : [16, 16, 16, 16, 16, 16],
+                    "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6],
+                    "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5],
+                    "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000],
+                    "sharpen_line_strength" : [100, 100, 100, 100, 100, 100],				
+                    "sharpen_line_r2" : [200, 200, 200, 200, 200, 200],
+                    "sharpen_line_r1" : [5, 5, 5, 5, 5, 5]
+                }
+            ]
+        },
+        {
+            "classname" : "AWdr4",
+            "forcecreate" : true,
+            "enable" : false,
+	    "disable" : true,
+            "backlight" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45],
+                    "strength" : [128, 128, 128, 128, 128, 128],
+                    "highStrength" : [20, 20, 20, 90, 90, 90],
+                    "lowStrength" : [4, 8, 16, 24, 45, 64],
+                    "globalStrength" : [0, 0, 0, 0, 0, 0],
+                    "contrast" : [800, 800, 800, 800, 800, 800],
+                    "flatStrength" : [0, 0, 0, 0, 0, 0],
+                    "flatThreshold" : [0, 0, 0, 0, 0, 0]
+                }
+            ],
+            "entropy_slope": 200,
+            "entropy_base": 700,
+            "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0],
+            "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023],
+            "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575],
+            "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575],
+            "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575]
+        },
+        {
+
+            "classname" : "A3dnrv3",
+            "forcecreate" : false,
+            "enable" : false,
+	    "disable" : false,
+            "autonoiseLevel": true,
+            "tnr_en" : false,
+            "nlm_en" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [0, 0, 0, 0, 0, 0, 0],
+                    "gains" : [1, 2, 4, 8, 16, 32],
+                    "filterLen" : [100, 150, 200, 300, 400, 500],
+                    "filterLen2" : [10, 10, 10, 10, 10, 10],
+                    "motionSlope"  : [1, 1, 1, 1, 1, 1],
+                    "noiseLevel"  : [25, 40, 60, 80, 100, 120],
+                    "sadweight" : [8, 8, 8, 8, 8, 8],
+                    "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000],
+                    "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362],
+                    "noisemodel_b" : [0.000065, 9.7098, 140.351654,  219.965805, 284.8835, 344.9119],
+                    "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5],
+                    "motion_dilate_en" : [1, 1, 1, 1, 1, 1],
+                    "motion_erode_en" : [1, 1, 1, 1, 1, 1],
+                    "pregamma_en" : [1, 1, 1, 1, 1, 1],
+                    "strength" : [120, 120, 120, 120, 120, 120],
+                    "range_h" : [7, 7, 7, 7, 7, 7],
+                    "range_v" : [3, 3, 3, 3, 3, 3],
+                    "dialte_h" : [3, 3, 3, 3, 3, 3],
+                    "preweight" : [8, 8, 8, 8, 8, 8],
+                    "noise_thresh_factor" : [2, 2, 2, 2, 2, 2],
+                    "moving_pixel_thresh" : [1, 1, 1, 1, 1, 1]
+                }
+            ]
+        },
+        {
+            "classname" : "A2dnrv5",
+            "forcecreate" : true,
+            "enable" : true,
+            "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
+                    "sigma" : [2, 2, 2, 5, 6, 6, 11, 11, 11, 14],
+                    "blendstatic" : [100, 100, 100, 100, 100, 90, 90, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 90, 90, 100, 100, 100]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2],
+                    "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14],
+                    "blendstatic" : [100, 100, 100, 100, 100, 100, 100, 35, 35, 40],
+                    "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
+                }
+            ]
+        },
+        {
+            "classname" : "ADpf",
+            "forcecreate" : true,
+            "enable" : true,
+	    "disable" : false,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16],
+                    "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65],
+                    "sigma_g" : [2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
+                    "sigma_rb" : [2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                },
+                {
+                    "hdr" : true,
+                    "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40],
+                    "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2],
+                    "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+                    "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16],
+                    "Div" : [64, 64, 64, 64, 64, 64, 64, 64, 64, 64],
+                    "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4],
+                    "curve" : [
+                        [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129,  979,  877,  801,  742,  695],
+                        [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042,  933,  852,  738,  660,  603,  558,  523],
+                        [3688, 2169, 1687, 1428, 1260, 1050,  918,  827,  758,  660,  592,  542,  470,  421,  385,  357,  335],
+                        [2254, 1553, 1258, 1085,  968,  816,  718,  649,  597,  521,  469,  430,  374,  335,  307,  284,  267],
+                        [1060,  883,  772,  695,  637,  555,  498,  455,  422,  373,  338,  311,  272,  245,  225,  209,  196],
+                        [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148],
+                        [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120],
+                        [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103,  96,  91,  86],
+                        [158, 152, 147, 142, 138, 130, 124, 118, 113, 105,  99,  93,  84,  78,  72,  68,  64],
+                        [127, 124, 121, 118, 115, 110, 106, 103,  99,  93,  88,  84,  77,  72,  68,  64,  61]
+                    ]
+                }
+            ]
+        },
+        {
+            "classname" : "ABlc",
+            "forcecreate" : true,
+            "enable" : true,
+            "tables" : [
+                {
+                    "hdr" : false,
+                    "gains" : [1, 16],
+                    "blc" : [256, 256]
+                },
+                {
+                    "hdr" : true,
+                    "gains" : [1, 16],
+                    "blc" : [256, 256]
+                }
+            ]
+        }
+    ]
+}

+ 35 - 0
drivers/SC2310/CMakeLists.txt

@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+# define module name & interface version
+set (module sc2310)
+string(TOUPPER ${module} SENSOR_NAME)
+
+# we want to compile all .c files as default
+file(GLOB libsources ${SENSOR_NAME}.c )
+
+# set public headers, these get installed
+#file(GLOB pub_headers include/*.h)
+
+#include_directories()
+
+add_library(${module} SHARED ${libsources})
+
+add_custom_target(${module}.drv
+                  ALL
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/${module}.drv
+                  COMMAND ${CMAKE_COMMAND} -E copy lib${module}.so ${LIB_ROOT}/rootfs/usr/lib/lib${module}.so
+                  COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/isp/test/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.xml ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/${SENSOR_NAME}*.txt ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  COMMAND ${CMAKE_COMMAND} -E copy ${LIB_ROOT}/../drivers/${SENSOR_NAME}/*.json ${LIB_ROOT}/rootfs/usr/share/vi/tuningtool/bin/
+                  DEPENDS ${module}
+                  COMMENT "Copying ${module} driver module"
+                  )
+    
+#install(FILES       ${LIB_ROOT}/${CMAKE_BUILD_TYPE}/lib/lib${module}.so.${${module}_INTERFACE_CURRENT}
+#                  DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+#                  RENAME      ${module}.drv
+#                  )

File diff suppressed because it is too large
+ 0 - 0
drivers/SC2310/SC2310.c


File diff suppressed because it is too large
+ 674 - 0
drivers/SC2310/SC2310_1920x1080.xml


File diff suppressed because it is too large
+ 674 - 0
drivers/SC2310/SC2310_1920x1088.xml


+ 173 - 0
drivers/SC2310/SC2310_mipi2lane_1920x1080_raw10_30fps_init.txt

@@ -0,0 +1,173 @@
+0x0103 0x01
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3001 0xfe
+0x3018 0x33
+0x3019 0x0c
+0x301c 0x78
+0x301f 0x40
+0x3031 0x0a
+0x3037 0x22
+0x3038 0x22
+0x303f 0x01
+0x3200 0x00
+0x3201 0x04
+0x3202 0x00
+0x3203 0x04
+0x3204 0x07
+0x3205 0x8b
+0x3206 0x04
+0x3207 0x43
+0x3208 0x07
+0x3209 0x80
+0x320a 0x04
+0x320b 0x38
+0x320c 0x04
+0x320d 0x4c
+0x3210 0x00
+0x3211 0x04
+0x3212 0x00
+0x3213 0x04
+0x3301 0x10
+0x3302 0x10
+0x3303 0x18
+0x3306 0x60
+0x3308 0x08
+0x3309 0x30
+0x330a 0x00
+0x330b 0xc8
+0x330e 0x28
+0x3314 0x04
+0x331b 0x83
+0x331e 0x11
+0x331f 0x29
+0x3320 0x01
+0x3324 0x02
+0x3325 0x02
+0x3326 0x00
+0x3333 0x30
+0x3334 0x40
+0x333d 0x08
+0x3341 0x07
+0x3343 0x03
+0x3364 0x1d
+0x3366 0x80
+0x3367 0x08
+0x3368 0x04
+0x3369 0x00
+0x336a 0x00
+0x336b 0x00
+0x336c 0x42
+0x337f 0x03
+0x3380 0x1b
+0x33aa 0x00
+0x33b6 0x07
+0x33b7 0x07
+0x33b8 0x10
+0x33b9 0x10
+0x33ba 0x10
+0x33bb 0x07
+0x33bc 0x07
+0x33bd 0x20
+0x33be 0x20
+0x33bf 0x20
+0x360f 0x05
+0x3621 0xac
+0x3622 0xe6
+0x3623 0x18
+0x3624 0x47
+0x3630 0xc8
+0x3631 0x88
+0x3632 0x18
+0x3633 0x22
+0x3634 0x44
+0x3635 0x40
+0x3636 0x65
+0x3637 0x17
+0x3638 0x25
+0x363b 0x08
+0x363c 0x05
+0x363d 0x05
+0x3640 0x00
+0x366e 0x04
+0x3670 0x4a
+0x3671 0xf6
+0x3672 0x16
+0x3673 0x16
+0x3674 0xc8
+0x3675 0x54
+0x3676 0x18
+0x3677 0x22
+0x3678 0x33
+0x3679 0x44
+0x367a 0x40
+0x367b 0x40
+0x367c 0x40
+0x367d 0x58
+0x367e 0x40
+0x367f 0x58
+0x3696 0x83
+0x3697 0x87
+0x3698 0x9f
+0x36a0 0x58
+0x36a1 0x78
+0x36ea 0x9f
+0x36eb 0x0e
+0x36ec 0x1e
+0x36ed 0x03
+0x36fa 0xf8
+0x36fb 0x10
+0x3802 0x00
+0x3907 0x01
+0x3908 0x01
+0x391e 0x00
+0x391f 0xc0
+0x3933 0x28
+0x3934 0x0a
+0x3940 0x1b
+0x3941 0x40
+0x3942 0x08
+0x3943 0x0e
+0x3e00 0x00
+0x3e01 0x01
+0x3e02 0x40
+0x3e03 0x0b
+0x3e06 0x00
+0x3e07 0x80
+0x3e08 0x03
+0x3e09 0x40
+0x3e0e 0x66
+0x3e14 0xb0
+0x3e1e 0x35
+0x3e25 0x03
+0x3e26 0x40
+0x3f00 0x0d
+0x3f04 0x02
+0x3f05 0x1e
+0x3f08 0x04
+0x4500 0x59
+0x4501 0xb4
+0x4509 0x20
+0x4603 0x00
+0x4809 0x01
+0x4837 0x35
+0x5000 0x06
+0x5780 0x7f
+0x5781 0x06
+0x5782 0x04
+0x5783 0x02
+0x5784 0x01
+0x5785 0x16
+0x5786 0x12
+0x5787 0x08
+0x5788 0x02
+0x57a0 0x00
+0x57a1 0x74
+0x57a2 0x01
+0x57a3 0xf4
+0x57a4 0xf0
+0x6000 0x00
+0x6002 0x00
+0x36e9 0x51
+0x36f9 0x04

+ 166 - 0
drivers/SC2310/SC2310_mipi2lane_1920x1088_raw12_30fps_init.txt

@@ -0,0 +1,166 @@
+0x36e9 0x80
+0x36f9 0x80
+0x3001 0xfe
+0x3018 0x33
+0x301c 0x78
+0x301f 0x77
+0x3031 0x0c
+0x3037 0x42
+0x3038 0x22
+0x303f 0x01
+0x3200 0x00
+0x3201 0x04
+0x3202 0x00
+0x3203 0x00
+0x3204 0x07
+0x3205 0x8b
+0x3206 0x04
+0x3207 0x47
+0x3208 0x07
+0x3209 0x80
+0x320a 0x04
+0x320b 0x40
+0x320c 0x04
+0x320d 0x4c
+0x3211 0x04
+0x3213 0x04
+0x3301 0x10
+0x3302 0x10
+0x3303 0x18
+0x3306 0x60
+0x3308 0x08
+0x3309 0x30
+0x330a 0x00
+0x330b 0xc8
+0x330e 0x28
+0x3314 0x04
+0x331b 0x83
+0x331e 0x11
+0x331f 0x29
+0x3320 0x01
+0x3324 0x02
+0x3325 0x02
+0x3326 0x00
+0x3333 0x30
+0x3334 0x40
+0x333d 0x08
+0x3341 0x07
+0x3343 0x03
+0x3364 0x1d
+0x3366 0x80
+0x3367 0x08
+0x3368 0x04
+0x3369 0x00
+0x336a 0x00
+0x336b 0x00
+0x336c 0x42
+0x337f 0x03
+0x3380 0x1b
+0x33aa 0x00
+0x33b6 0x07
+0x33b7 0x07
+0x33b8 0x10
+0x33b9 0x10
+0x33ba 0x10
+0x33bb 0x07
+0x33bc 0x07
+0x33bd 0x20
+0x33be 0x20
+0x33bf 0x20
+0x360f 0x05
+0x3621 0xac
+0x3622 0xe6
+0x3623 0x18
+0x3624 0x47
+0x3630 0xc8
+0x3631 0x88
+0x3632 0x18
+0x3633 0x22
+0x3634 0x44
+0x3635 0x40
+0x3636 0x65
+0x3637 0x17
+0x3638 0x25
+0x363b 0x08
+0x363c 0x05
+0x363d 0x05
+0x3640 0x00
+0x366e 0x04
+0x3670 0x4a
+0x3671 0xf6
+0x3672 0x16
+0x3673 0x16
+0x3674 0xc8
+0x3675 0x54
+0x3676 0x18
+0x3677 0x22
+0x3678 0x33
+0x3679 0x44
+0x367a 0x40
+0x367b 0x40
+0x367c 0x40
+0x367d 0x58
+0x367e 0x40
+0x367f 0x58
+0x3696 0x83
+0x3697 0x87
+0x3698 0x9f
+0x36a0 0x58
+0x36a1 0x78
+0x36eb 0x0b
+0x36ec 0x0f
+0x36fa 0xa8
+0x3802 0x00
+0x3907 0x01
+0x3908 0x01
+0x391e 0x00
+0x391f 0xc0
+0x3933 0x28
+0x3934 0x0a
+0x3940 0x1b
+0x3941 0x40
+0x3942 0x08
+0x3943 0x0e
+0x3e00 0x00
+0x3e01 0x01
+0x3e02 0x40
+0x3e03 0x0b
+0x3e06 0x00
+0x3e07 0x80
+0x3e08 0x03
+0x3e09 0x40
+0x3e0e 0x66
+0x3e14 0xb0
+0x3e1e 0x35
+0x3e25 0x03
+0x3e26 0x40
+0x3f00 0x0d
+0x3f04 0x02
+0x3f05 0x1e
+0x3f08 0x04
+0x4500 0x59
+0x4501 0xb4
+0x4509 0x20
+0x4603 0x00
+0x4809 0x01
+0x4837 0x35
+0x5000 0x06
+0x5780 0x7f
+0x5781 0x06
+0x5782 0x04
+0x5783 0x02
+0x5784 0x01
+0x5785 0x16
+0x5786 0x12
+0x5787 0x08
+0x5788 0x02
+0x57a0 0x00
+0x57a1 0x74
+0x57a2 0x01
+0x57a3 0xf4
+0x57a4 0xf0
+0x6000 0x00
+0x6002 0x00
+0x36e9 0x23
+0x36f9 0x05
+

+ 168 - 0
drivers/SC2310/SC2310_mipi2lane_640x480_raw12_30fps_init.txt

@@ -0,0 +1,168 @@
+0x0100 0x00
+0x36e9 0x80
+0x36f9 0x80
+0x3001 0xfe
+0x3018 0x33
+0x301c 0x78
+0x301f 0x77
+0x3031 0x0c
+0x3037 0x42
+0x3038 0x22
+0x303f 0x01
+0x3200 0x02
+0x3201 0x80
+0x3202 0x01
+0x3203 0x2c
+0x3204 0x05
+0x3205 0x07
+0x3206 0x03
+0x3207 0x13
+0x3208 0x02
+0x3209 0x80
+0x320a 0x01
+0x320b 0xe0
+0x320c 0x04
+0x320d 0x4c
+0x3210 0x00
+0x3211 0x04
+0x3212 0x00
+0x3213 0x04
+0x3301 0x10
+0x3302 0x10
+0x3303 0x18
+0x3306 0x60
+0x3308 0x08
+0x3309 0x30
+0x330a 0x00
+0x330b 0xc8
+0x330e 0x28
+0x3314 0x04
+0x331b 0x83
+0x331e 0x11
+0x331f 0x29
+0x3320 0x01
+0x3324 0x02
+0x3325 0x02
+0x3326 0x00
+0x3333 0x30
+0x3334 0x40
+0x333d 0x08
+0x3341 0x07
+0x3343 0x03
+0x3364 0x1d
+0x3366 0x80
+0x3367 0x08
+0x3368 0x04
+0x3369 0x00
+0x336a 0x00
+0x336b 0x00
+0x336c 0x42
+0x337f 0x03
+0x3380 0x1b
+0x33aa 0x00
+0x33b6 0x07
+0x33b7 0x07
+0x33b8 0x10
+0x33b9 0x10
+0x33ba 0x10
+0x33bb 0x07
+0x33bc 0x07
+0x33bd 0x20
+0x33be 0x20
+0x33bf 0x20
+0x360f 0x05
+0x3621 0xac
+0x3622 0xe6
+0x3623 0x18
+0x3624 0x47
+0x3630 0xc8
+0x3631 0x88
+0x3632 0x18
+0x3633 0x22
+0x3634 0x44
+0x3635 0x40
+0x3636 0x65
+0x3637 0x17
+0x3638 0x25
+0x363b 0x08
+0x363c 0x05
+0x363d 0x05
+0x3640 0x00
+0x366e 0x04
+0x3670 0x4a
+0x3671 0xf6
+0x3672 0x16
+0x3673 0x16
+0x3674 0xc8
+0x3675 0x54
+0x3676 0x18
+0x3677 0x22
+0x3678 0x33
+0x3679 0x44
+0x367a 0x40
+0x367b 0x40
+0x367c 0x40
+0x367d 0x58
+0x367e 0x40
+0x367f 0x58
+0x3696 0x83
+0x3697 0x87
+0x3698 0x9f
+0x36a0 0x58
+0x36a1 0x78
+0x36eb 0x0b
+0x36ec 0x0f
+0x36fa 0xa8
+0x3802 0x00
+0x3907 0x01
+0x3908 0x01
+0x391e 0x00
+0x391f 0xc0
+0x3933 0x28
+0x3934 0x0a
+0x3940 0x1b
+0x3941 0x40
+0x3942 0x08
+0x3943 0x0e
+0x3e00 0x00
+0x3e01 0x01
+0x3e02 0x40
+0x3e03 0x0b
+0x3e06 0x00
+0x3e07 0x80
+0x3e08 0x03
+0x3e09 0x40
+0x3e0e 0x66
+0x3e14 0xb0
+0x3e1e 0x35
+0x3e25 0x03
+0x3e26 0x40
+0x3f00 0x0d
+0x3f04 0x02
+0x3f05 0x1e
+0x3f08 0x04
+0x4500 0x59
+0x4501 0xb4
+0x4509 0x20
+0x4603 0x00
+0x4809 0x01
+0x4837 0x35
+0x5000 0x06
+0x5780 0x7f
+0x5781 0x06
+0x5782 0x04
+0x5783 0x02
+0x5784 0x01
+0x5785 0x16
+0x5786 0x12
+0x5787 0x08
+0x5788 0x02
+0x57a0 0x00
+0x57a1 0x74
+0x57a2 0x01
+0x57a3 0xf4
+0x57a4 0xf0
+0x6000 0x00
+0x6002 0x00
+0x36e9 0x23
+0x36f9 0x05

+ 241 - 0
drivers/SC2310/SC2310_priv.h

@@ -0,0 +1,241 @@
+/******************************************************************************\
+|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon")       *|
+|* All Rights Reserved.                                                       *|
+|*                                                                            *|
+|* The material in this file is confidential and contains trade secrets of    *|
+|* of VeriSilicon.  This is proprietary information owned or licensed by      *|
+|* VeriSilicon.  No part of this work may be disclosed, reproduced, copied,   *|
+|* transmitted, or used in any way for any purpose, without the express       *|
+|* written permission of VeriSilicon.                                         *|
+|*                                                                            *|
+\******************************************************************************/
+/**
+ * @file SC2310_priv.h
+ *
+ * @brief Interface description for image sensor specific implementation (iss).
+ *
+ *****************************************************************************/
+/**
+ * @page module_name_page Module Name
+ * Describe here what this module does.
+ *
+ * For a detailed list of functions and implementation detail refer to:
+ * - @ref module_name
+ *
+ * @defgroup sc2310_priv
+ * @{
+ *
+ */
+#ifndef __SC2310_PRIV_H__
+#define __SC2310_PRIV_H__
+
+#include <ebase/types.h>
+#include <common/return_codes.h>
+#include <hal/hal_api.h>
+#include <isi/isi_common.h>
+#include "vvsensor.h"
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define SC2310_PIDH                         (0x300A)  //R  - Product ID High Byte MSBs
+#define SC2310_PIDL                         (0x300B)  //R  - Product ID Low Byte LSBs
+
+/*****************************************************************************
+ * Default values
+ *****************************************************************************/
+
+ // Make sure that these static settings are reflecting the capabilities defined
+// in IsiGetCapsIss (further dynamic setup may alter these default settings but
+// often does not if there is no choice available).
+
+/*****************************************************************************
+ * SC control registers
+ *****************************************************************************/
+#define SC2310_PIDH_DEFAULT                        (0x27) //read only
+#define SC2310_PIDL_DEFAULT                        (0x70) //read only
+
+typedef struct SC2310_Context_s
+{
+    IsiSensorContext_t  IsiCtx;                 /**< common context of ISI and ISI driver layer; @note: MUST BE FIRST IN DRIVER CONTEXT */
+
+    struct vvcam_mode_info SensorMode;
+    uint32_t            KernelDriverFlag;
+    char                SensorRegCfgFile[128];
+
+    uint32_t              HdrMode;
+    uint32_t              Resolution;
+    uint32_t              MaxFps;
+    uint32_t              MinFps;
+    uint32_t              CurrFps;
+    //// modify below here ////
+
+    IsiSensorConfig_t   Config;                 /**< sensor configuration */
+    bool_t              Configured;             /**< flags that config was applied to sensor */
+    bool_t              Streaming;              /**< flags that csensor is streaming data */
+    bool_t              TestPattern;            /**< flags that sensor is streaming test-pattern */
+
+    bool_t              isAfpsRun;              /**< if true, just do anything required for Afps parameter calculation, but DON'T access SensorHW! */
+
+    float               one_line_exp_time;
+    uint16_t            MaxIntegrationLine;
+    uint16_t            MinIntegrationLine;
+    uint32_t            gain_accuracy;
+
+    uint16_t            FrameLengthLines;       /**< frame line length */
+    uint16_t            CurFrameLengthLines;
+
+    float               AecMinGain;
+    float               AecMaxGain;
+    float               AecMinIntegrationTime;
+    float               AecMaxIntegrationTime;
+
+    float               AecIntegrationTimeIncrement; /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+    float               AecGainIncrement;            /**< _smallest_ increment the sensor/driver can handle (e.g. used for sliders in the application) */
+
+    float               AecCurIntegrationTime;
+    float               AecCurVSIntegrationTime;
+    float               AecCurLongIntegrationTime;
+    float               AecCurGain;
+    float               AecCurVSGain;
+    float               AecCurLongGain;
+
+    uint32_t            LastExpLine;
+    uint32_t            LastVsExpLine;
+    uint32_t            LastLongExpLine;
+
+    uint32_t            LastGain;
+    uint32_t            LastVsGain;
+    uint32_t            LastLongGain;
+
+    bool                GroupHold;
+    uint32_t            OldGain;
+    uint32_t            OldVsGain;
+    uint32_t            OldIntegrationTime;
+    uint32_t            OldVsIntegrationTime;
+    uint32_t            OldGainHcg;
+    uint32_t            OldAGainHcg;
+    uint32_t            OldGainLcg;
+    uint32_t            OldAGainLcg;
+    int                 subdev;
+    uint8_t             pattern;
+
+    float               CurHdrRatio;
+} SC2310_Context_t;
+
+static RESULT SC2310_IsiCreateSensorIss(IsiSensorInstanceConfig_t *
+                          pConfig);
+
+static RESULT SC2310_IsiInitSensorIss(IsiSensorHandle_t handle);
+
+static RESULT SC2310_IsiReleaseSensorIss(IsiSensorHandle_t handle);
+
+static RESULT SC2310_IsiGetCapsIss(IsiSensorHandle_t handle,
+                         IsiSensorCaps_t * pIsiSensorCaps);
+
+static RESULT SC2310_IsiSetupSensorIss(IsiSensorHandle_t handle,
+                         const IsiSensorConfig_t *
+                         pConfig);
+
+static RESULT SC2310_IsiSensorSetStreamingIss(IsiSensorHandle_t handle,
+                               bool_t on);
+
+static RESULT SC2310_IsiSensorSetPowerIss(IsiSensorHandle_t handle,
+                            bool_t on);
+
+static RESULT SC2310_IsiGetSensorRevisionIss(IsiSensorHandle_t handle,
+                               uint32_t * p_value);
+
+static RESULT SC2310_IsiSetBayerPattern(IsiSensorHandle_t handle,
+                          uint8_t pattern);
+
+static RESULT SC2310_IsiGetGainLimitsIss(IsiSensorHandle_t handle,
+                             float *pMinGain,
+                             float *pMaxGain);
+
+static RESULT SC2310_IsiGetIntegrationTimeLimitsIss(IsiSensorHandle_t
+                                 handle,
+                                 float
+                                 *pMinIntegrationTime,
+                                 float
+                                 *pMaxIntegrationTime);
+
+static RESULT SC2310_IsiExposureControlIss(IsiSensorHandle_t handle,
+                            float NewGain,
+                            float NewIntegrationTime,
+                            uint8_t *
+                            pNumberOfFramesToSkip,
+                            float *pSetGain,
+                            float *pSetIntegrationTime,
+                            float *hdr_ratio);
+
+static RESULT SC2310_IsiGetGainIss(IsiSensorHandle_t handle,
+                        float *pSetGain);
+
+static RESULT SC2310_IsiGetVSGainIss(IsiSensorHandle_t handle,
+                          float *pSetGain);
+
+static RESULT SC2310_IsiGetGainIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT SC2310_IsiSetGainIss(IsiSensorHandle_t handle,
+                        float NewGain, float *pSetGain,
+                        float *hdr_ratio);
+
+static RESULT SC2310_IsiSetVSGainIss(IsiSensorHandle_t handle,
+                          float NewIntegrationTime,
+                          float NewGain, float *pSetGain,
+                          float *hdr_ratio);
+
+static RESULT SC2310_IsiGetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float
+                               *pSetIntegrationTime);
+
+static RESULT SC2310_IsiGetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             *pSetIntegrationTime);
+
+static RESULT SC2310_IsiGetIntegrationTimeIncrementIss(IsiSensorHandle_t handle,
+                             float *pIncr);
+
+static RESULT SC2310_IsiSetIntegrationTimeIss(IsiSensorHandle_t handle,
+                               float NewIntegrationTime,
+                               float
+                               *pSetIntegrationTime,
+                               uint8_t *
+                               pNumberOfFramesToSkip,
+                               float *hdr_ratio);
+
+static RESULT SC2310_IsiSetVSIntegrationTimeIss(IsiSensorHandle_t
+                             handle,
+                             float
+                             NewIntegrationTime,
+                             float
+                             *pSetIntegrationTime,
+                             uint8_t *
+                             pNumberOfFramesToSkip,
+                             float *hdr_ratio);
+
+RESULT SC2310_IsiGetResolutionIss(IsiSensorHandle_t handle, uint16_t *pwidth, uint16_t *pheight);
+
+static RESULT SC2310_IsiResetSensorIss(IsiSensorHandle_t handle);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* @} sc2310priv */
+
+#endif    /* __SC2310PRIV_H__ */
+

+ 1377 - 0
drivers/SC2310/sc2310.h

@@ -0,0 +1,1377 @@
+/*
+ * Support for OmniVision SC2310 5M camera sensor.
+ *
+ * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ */
+
+#ifndef __SC2310_H__
+#define __SC2310_H__
+
+#define SC2310_NAME		"sc2310"
+
+#define SC2310_POWER_UP_RETRY_NUM 5
+
+/* Defines for register writes and register array processing */
+#define I2C_MSG_LENGTH		0x2
+#define I2C_RETRY_COUNT		5
+
+#define SC2310_FOCAL_LENGTH_NUM	334	/*3.34mm*/
+#define SC2310_FOCAL_LENGTH_DEM	100
+#define SC2310_F_NUMBER_DEFAULT_NUM	24
+#define SC2310_F_NUMBER_DEM	10
+
+#define MAX_FMTS		1
+
+/* sensor_mode_data read_mode adaptation */
+#define SC2310_READ_MODE_BINNING_ON	0x0400
+#define SC2310_READ_MODE_BINNING_OFF	0x00
+#define SC2310_INTEGRATION_TIME_MARGIN	8
+
+#define SC2310_MAX_EXPOSURE_VALUE	0xFFF1
+#define SC2310_MAX_GAIN_VALUE		0xFF
+
+/*
+ * focal length bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define SC2310_FOCAL_LENGTH_DEFAULT 0x1B70064
+
+/*
+ * current f-number bits definition:
+ * bits 31-16: numerator, bits 15-0: denominator
+ */
+#define SC2310_F_NUMBER_DEFAULT 0x18000a
+
+/*
+ * f-number range bits definition:
+ * bits 31-24: max f-number numerator
+ * bits 23-16: max f-number denominator
+ * bits 15-8: min f-number numerator
+ * bits 7-0: min f-number denominator
+ */
+#define SC2310_F_NUMBER_RANGE 0x180a180a
+#define SC2310_ID	0x5690
+
+#define SC2310_FINE_INTG_TIME_MIN 0
+#define SC2310_FINE_INTG_TIME_MAX_MARGIN 0
+#define SC2310_COARSE_INTG_TIME_MIN 1
+#define SC2310_COARSE_INTG_TIME_MAX_MARGIN 6
+
+#define SC2310_BIN_FACTOR_MAX 4
+/*
+ * SC2310 System control registers
+ */
+#define SC2310_SW_SLEEP				0x0100
+#define SC2310_SW_RESET				0x0103
+#define SC2310_SW_STREAM			0x0100
+
+#define SC2310_SC_CMMN_CHIP_ID_H		0x300A
+#define SC2310_SC_CMMN_CHIP_ID_L		0x300B
+#define SC2310_SC_CMMN_SCCB_ID			0x300C
+#define SC2310_SC_CMMN_SUB_ID			0x302A /* process, version*/
+/*Bit[7:4] Group control, Bit[3:0] Group ID*/
+#define SC2310_GROUP_ACCESS			0x3208
+/*
+*Bit[3:0] Bit[19:16] of exposure,
+*remaining 16 bits lies in Reg0x3501&Reg0x3502
+*/
+#define SC2310_EXPOSURE_H			0x3500
+#define SC2310_EXPOSURE_M			0x3501
+#define SC2310_EXPOSURE_L			0x3502
+/*Bit[1:0] means Bit[9:8] of gain*/
+#define SC2310_AGC_H				0x350A
+#define SC2310_AGC_L				0x350B /*Bit[7:0] of gain*/
+
+#define SC2310_HORIZONTAL_START_H		0x3800 /*Bit[11:8]*/
+#define SC2310_HORIZONTAL_START_L		0x3801 /*Bit[7:0]*/
+#define SC2310_VERTICAL_START_H			0x3802 /*Bit[11:8]*/
+#define SC2310_VERTICAL_START_L			0x3803 /*Bit[7:0]*/
+#define SC2310_HORIZONTAL_END_H			0x3804 /*Bit[11:8]*/
+#define SC2310_HORIZONTAL_END_L			0x3805 /*Bit[7:0]*/
+#define SC2310_VERTICAL_END_H			0x3806 /*Bit[11:8]*/
+#define SC2310_VERTICAL_END_L			0x3807 /*Bit[7:0]*/
+#define SC2310_HORIZONTAL_OUTPUT_SIZE_H		0x3808 /*Bit[3:0]*/
+#define SC2310_HORIZONTAL_OUTPUT_SIZE_L		0x3809 /*Bit[7:0]*/
+#define SC2310_VERTICAL_OUTPUT_SIZE_H		0x380a /*Bit[3:0]*/
+#define SC2310_VERTICAL_OUTPUT_SIZE_L		0x380b /*Bit[7:0]*/
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define SC2310_TIMING_HTS_H			0x380C
+/*High 8-bit, and low 8-bit HTS address is 0x380d*/
+#define SC2310_TIMING_HTS_L			0x380D
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define SC2310_TIMING_VTS_H			0x380e
+/*High 8-bit, and low 8-bit HTS address is 0x380f*/
+#define SC2310_TIMING_VTS_L			0x380f
+
+#define SC2310_MWB_RED_GAIN_H			0x3400
+#define SC2310_MWB_GREEN_GAIN_H			0x3402
+#define SC2310_MWB_BLUE_GAIN_H			0x3404
+#define SC2310_MWB_GAIN_MAX			0x0fff
+
+#define SC2310_START_STREAMING			0x01
+#define SC2310_STOP_STREAMING			0x00
+
+#define VCM_ADDR           0x0c
+#define VCM_CODE_MSB       0x04
+
+#define SC2310_INVALID_CONFIG	0xffffffff
+
+#define SC2310_VCM_SLEW_STEP			0x30F0
+#define SC2310_VCM_SLEW_STEP_MAX		0x7
+#define SC2310_VCM_SLEW_STEP_MASK		0x7
+#define SC2310_VCM_CODE				0x30F2
+#define SC2310_VCM_SLEW_TIME			0x30F4
+#define SC2310_VCM_SLEW_TIME_MAX		0xffff
+#define SC2310_VCM_ENABLE			0x8000
+
+#define SC2310_VCM_MAX_FOCUS_NEG       -1023
+#define SC2310_VCM_MAX_FOCUS_POS       1023
+
+#define DLC_ENABLE 1
+#define DLC_DISABLE 0
+#define VCM_PROTECTION_OFF     0xeca3
+#define VCM_PROTECTION_ON      0xdc51
+#define VCM_DEFAULT_S 0x0
+#define vcm_step_s(a) (u8)(a & 0xf)
+#define vcm_step_mclk(a) (u8)((a >> 4) & 0x3)
+#define vcm_dlc_mclk(dlc, mclk) (u16)((dlc << 3) | mclk | 0xa104)
+#define vcm_tsrc(tsrc) (u16)(tsrc << 3 | 0xf200)
+#define vcm_val(data, s) (u16)(data << 4 | s)
+#define DIRECT_VCM vcm_dlc_mclk(0, 0)
+
+/* Defines for OTP Data Registers */
+#define SC2310_FRAME_OFF_NUM		0x4202
+#define SC2310_OTP_BYTE_MAX		32	//change to 32 as needed by otpdata
+#define SC2310_OTP_SHORT_MAX		16
+#define SC2310_OTP_START_ADDR		0x3D00
+#define SC2310_OTP_END_ADDR		0x3D0F
+#define SC2310_OTP_DATA_SIZE		320
+#define SC2310_OTP_PROGRAM_REG      	0x3D80
+#define SC2310_OTP_READ_REG		0x3D81	// 1:Enable 0:disable
+#define SC2310_OTP_BANK_REG		0x3D84	//otp bank and mode
+#define SC2310_OTP_READY_REG_DONE	1
+#define SC2310_OTP_BANK_MAX		28
+#define SC2310_OTP_BANK_SIZE		16	//16 bytes per bank
+#define SC2310_OTP_READ_ONETIME		16
+#define SC2310_OTP_MODE_READ		1
+
+typedef enum SC2310_EXPOSURE_SETTING_e {
+	SC2310_ANALOG_GAIN = 1 << 0,
+	SC2310_INTEGRATION_TIME = 1 << 1,
+	SC2310_DIGITAL_GAIN = 1 << 2,
+}SC2310_EXPOSURE_SETTING_t;
+
+#if 0
+struct regval_list {
+	u16 reg_num;
+	u8 value;
+};
+
+struct sc2310_resolution {
+	u8 *desc;
+	const struct sc2310_reg *regs;
+	int res;
+	int width;
+	int height;
+	int fps;
+	int pix_clk_freq;
+	u16 pixels_per_line;
+	u16 lines_per_frame;
+	u8 bin_factor_x;
+	u8 bin_factor_y;
+	u8 bin_mode;
+	bool used;
+};
+
+struct sc2310_format {
+	u8 *desc;
+	u32 pixelformat;
+	struct sc2310_reg *regs;
+};
+
+enum vcm_type {
+	VCM_UNKNOWN,
+	VCM_AD5823,
+	VCM_DW9714,
+};
+
+/*
+ * sc2310 device structure.
+ */
+struct sc2310_device {
+	struct v4l2_subdev sd;
+	struct media_pad pad;
+	struct v4l2_mbus_framefmt format;
+	struct mutex input_lock;
+	struct v4l2_ctrl_handler ctrl_handler;
+
+	struct camera_sensor_platform_data *platform_data;
+	struct timespec timestamp_t_focus_abs;
+	int vt_pix_clk_freq_mhz;
+	int fmt_idx;
+	int run_mode;
+	int otp_size;
+	u8 *otp_data;
+	u32 focus;
+	s16 number_of_steps;
+	u8 res;
+	u8 type;
+	bool vcm_update;
+	enum vcm_type vcm;
+};
+
+enum sc2310_tok_type {
+	SC2310_8BIT  = 0x0001,
+	SC2310_16BIT = 0x0002,
+	SC2310_32BIT = 0x0004,
+	SC2310_TOK_TERM   = 0xf000,	/* terminating token for reg list */
+	SC2310_TOK_DELAY  = 0xfe00,	/* delay token for reg list */
+	SC2310_TOK_MASK = 0xfff0
+};
+
+/**
+ * struct sc2310_reg - MI sensor  register format
+ * @type: type of the register
+ * @reg: 16-bit offset to register
+ * @val: 8/16/32-bit register value
+ *
+ * Define a structure for sensor register initialization values
+ */
+struct sc2310_reg {
+	enum sc2310_tok_type type;
+	u16 reg;
+	u32 val;	/* @set value for read/mod/write, @mask */
+};
+
+#define to_sc2310_sensor(x) container_of(x, struct sc2310_device, sd)
+
+#define SC2310_MAX_WRITE_BUF_SIZE	30
+
+struct sc2310_write_buffer {
+	u16 addr;
+	u8 data[SC2310_MAX_WRITE_BUF_SIZE];
+};
+
+struct sc2310_write_ctrl {
+	int index;
+	struct sc2310_write_buffer buffer;
+};
+
+static const struct i2c_device_id sc2310_id[] = {
+	{SC2310_NAME, 0},
+	{}
+};
+
+static struct sc2310_reg const sc2310_global_setting[] = {
+	{SC2310_8BIT, 0x0103, 0x01},
+	{SC2310_8BIT, 0x3001, 0x0a},
+	{SC2310_8BIT, 0x3002, 0x80},
+	{SC2310_8BIT, 0x3006, 0x00},
+	{SC2310_8BIT, 0x3011, 0x21},
+	{SC2310_8BIT, 0x3012, 0x09},
+	{SC2310_8BIT, 0x3013, 0x10},
+	{SC2310_8BIT, 0x3014, 0x00},
+	{SC2310_8BIT, 0x3015, 0x08},
+	{SC2310_8BIT, 0x3016, 0xf0},
+	{SC2310_8BIT, 0x3017, 0xf0},
+	{SC2310_8BIT, 0x3018, 0xf0},
+	{SC2310_8BIT, 0x301b, 0xb4},
+	{SC2310_8BIT, 0x301d, 0x02},
+	{SC2310_8BIT, 0x3021, 0x00},
+	{SC2310_8BIT, 0x3022, 0x01},
+	{SC2310_8BIT, 0x3028, 0x44},
+	{SC2310_8BIT, 0x3098, 0x02},
+	{SC2310_8BIT, 0x3099, 0x19},
+	{SC2310_8BIT, 0x309a, 0x02},
+	{SC2310_8BIT, 0x309b, 0x01},
+	{SC2310_8BIT, 0x309c, 0x00},
+	{SC2310_8BIT, 0x30a0, 0xd2},
+	{SC2310_8BIT, 0x30a2, 0x01},
+	{SC2310_8BIT, 0x30b2, 0x00},
+	{SC2310_8BIT, 0x30b3, 0x7d},
+	{SC2310_8BIT, 0x30b4, 0x03},
+	{SC2310_8BIT, 0x30b5, 0x04},
+	{SC2310_8BIT, 0x30b6, 0x01},
+	{SC2310_8BIT, 0x3104, 0x21},
+	{SC2310_8BIT, 0x3106, 0x00},
+	{SC2310_8BIT, 0x3400, 0x04},
+	{SC2310_8BIT, 0x3401, 0x00},
+	{SC2310_8BIT, 0x3402, 0x04},
+	{SC2310_8BIT, 0x3403, 0x00},
+	{SC2310_8BIT, 0x3404, 0x04},
+	{SC2310_8BIT, 0x3405, 0x00},
+	{SC2310_8BIT, 0x3406, 0x01},
+	{SC2310_8BIT, 0x3500, 0x00},
+	{SC2310_8BIT, 0x3503, 0x07},
+	{SC2310_8BIT, 0x3504, 0x00},
+	{SC2310_8BIT, 0x3505, 0x00},
+	{SC2310_8BIT, 0x3506, 0x00},
+	{SC2310_8BIT, 0x3507, 0x02},
+	{SC2310_8BIT, 0x3508, 0x00},
+	{SC2310_8BIT, 0x3509, 0x10},
+	{SC2310_8BIT, 0x350a, 0x00},
+	{SC2310_8BIT, 0x350b, 0x40},
+	{SC2310_8BIT, 0x3601, 0x0a},
+	{SC2310_8BIT, 0x3602, 0x38},
+	{SC2310_8BIT, 0x3612, 0x80},
+	{SC2310_8BIT, 0x3620, 0x54},
+	{SC2310_8BIT, 0x3621, 0xc7},
+	{SC2310_8BIT, 0x3622, 0x0f},
+	{SC2310_8BIT, 0x3625, 0x10},
+	{SC2310_8BIT, 0x3630, 0x55},
+	{SC2310_8BIT, 0x3631, 0xf4},
+	{SC2310_8BIT, 0x3632, 0x00},
+	{SC2310_8BIT, 0x3633, 0x34},
+	{SC2310_8BIT, 0x3634, 0x02},
+	{SC2310_8BIT, 0x364d, 0x0d},
+	{SC2310_8BIT, 0x364f, 0xdd},
+	{SC2310_8BIT, 0x3660, 0x04},
+	{SC2310_8BIT, 0x3662, 0x10},
+	{SC2310_8BIT, 0x3663, 0xf1},
+	{SC2310_8BIT, 0x3665, 0x00},
+	{SC2310_8BIT, 0x3666, 0x20},
+	{SC2310_8BIT, 0x3667, 0x00},
+	{SC2310_8BIT, 0x366a, 0x80},
+	{SC2310_8BIT, 0x3680, 0xe0},
+	{SC2310_8BIT, 0x3681, 0x00},
+	{SC2310_8BIT, 0x3700, 0x42},
+	{SC2310_8BIT, 0x3701, 0x14},
+	{SC2310_8BIT, 0x3702, 0xa0},
+	{SC2310_8BIT, 0x3703, 0xd8},
+	{SC2310_8BIT, 0x3704, 0x78},
+	{SC2310_8BIT, 0x3705, 0x02},
+	{SC2310_8BIT, 0x370a, 0x00},
+	{SC2310_8BIT, 0x370b, 0x20},
+	{SC2310_8BIT, 0x370c, 0x0c},
+	{SC2310_8BIT, 0x370d, 0x11},
+	{SC2310_8BIT, 0x370e, 0x00},
+	{SC2310_8BIT, 0x370f, 0x40},
+	{SC2310_8BIT, 0x3710, 0x00},
+	{SC2310_8BIT, 0x371a, 0x1c},
+	{SC2310_8BIT, 0x371b, 0x05},
+	{SC2310_8BIT, 0x371c, 0x01},
+	{SC2310_8BIT, 0x371e, 0xa1},
+	{SC2310_8BIT, 0x371f, 0x0c},
+	{SC2310_8BIT, 0x3721, 0x00},
+	{SC2310_8BIT, 0x3724, 0x10},
+	{SC2310_8BIT, 0x3726, 0x00},
+	{SC2310_8BIT, 0x372a, 0x01},
+	{SC2310_8BIT, 0x3730, 0x10},
+	{SC2310_8BIT, 0x3738, 0x22},
+	{SC2310_8BIT, 0x3739, 0xe5},
+	{SC2310_8BIT, 0x373a, 0x50},
+	{SC2310_8BIT, 0x373b, 0x02},
+	{SC2310_8BIT, 0x373c, 0x41},
+	{SC2310_8BIT, 0x373f, 0x02},
+	{SC2310_8BIT, 0x3740, 0x42},
+	{SC2310_8BIT, 0x3741, 0x02},
+	{SC2310_8BIT, 0x3742, 0x18},
+	{SC2310_8BIT, 0x3743, 0x01},
+	{SC2310_8BIT, 0x3744, 0x02},
+	{SC2310_8BIT, 0x3747, 0x10},
+	{SC2310_8BIT, 0x374c, 0x04},
+	{SC2310_8BIT, 0x3751, 0xf0},
+	{SC2310_8BIT, 0x3752, 0x00},
+	{SC2310_8BIT, 0x3753, 0x00},
+	{SC2310_8BIT, 0x3754, 0xc0},
+	{SC2310_8BIT, 0x3755, 0x00},
+	{SC2310_8BIT, 0x3756, 0x1a},
+	{SC2310_8BIT, 0x3758, 0x00},
+	{SC2310_8BIT, 0x3759, 0x0f},
+	{SC2310_8BIT, 0x376b, 0x44},
+	{SC2310_8BIT, 0x375c, 0x04},
+	{SC2310_8BIT, 0x3774, 0x10},
+	{SC2310_8BIT, 0x3776, 0x00},
+	{SC2310_8BIT, 0x377f, 0x08},
+	{SC2310_8BIT, 0x3780, 0x22},
+	{SC2310_8BIT, 0x3781, 0x0c},
+	{SC2310_8BIT, 0x3784, 0x2c},
+	{SC2310_8BIT, 0x3785, 0x1e},
+	{SC2310_8BIT, 0x378f, 0xf5},
+	{SC2310_8BIT, 0x3791, 0xb0},
+	{SC2310_8BIT, 0x3795, 0x00},
+	{SC2310_8BIT, 0x3796, 0x64},
+	{SC2310_8BIT, 0x3797, 0x11},
+	{SC2310_8BIT, 0x3798, 0x30},
+	{SC2310_8BIT, 0x3799, 0x41},
+	{SC2310_8BIT, 0x379a, 0x07},
+	{SC2310_8BIT, 0x379b, 0xb0},
+	{SC2310_8BIT, 0x379c, 0x0c},
+	{SC2310_8BIT, 0x37c5, 0x00},
+	{SC2310_8BIT, 0x37c6, 0x00},
+	{SC2310_8BIT, 0x37c7, 0x00},
+	{SC2310_8BIT, 0x37c9, 0x00},
+	{SC2310_8BIT, 0x37ca, 0x00},
+	{SC2310_8BIT, 0x37cb, 0x00},
+	{SC2310_8BIT, 0x37de, 0x00},
+	{SC2310_8BIT, 0x37df, 0x00},
+	{SC2310_8BIT, 0x3800, 0x00},
+	{SC2310_8BIT, 0x3801, 0x00},
+	{SC2310_8BIT, 0x3802, 0x00},
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3810, 0x00},
+	{SC2310_8BIT, 0x3812, 0x00},
+	{SC2310_8BIT, 0x3823, 0x00},
+	{SC2310_8BIT, 0x3824, 0x00},
+	{SC2310_8BIT, 0x3825, 0x00},
+	{SC2310_8BIT, 0x3826, 0x00},
+	{SC2310_8BIT, 0x3827, 0x00},
+	{SC2310_8BIT, 0x382a, 0x04},
+	{SC2310_8BIT, 0x3a04, 0x06},
+	{SC2310_8BIT, 0x3a05, 0x14},
+	{SC2310_8BIT, 0x3a06, 0x00},
+	{SC2310_8BIT, 0x3a07, 0xfe},
+	{SC2310_8BIT, 0x3b00, 0x00},
+	{SC2310_8BIT, 0x3b02, 0x00},
+	{SC2310_8BIT, 0x3b03, 0x00},
+	{SC2310_8BIT, 0x3b04, 0x00},
+	{SC2310_8BIT, 0x3b05, 0x00},
+	{SC2310_8BIT, 0x3e07, 0x20},
+	{SC2310_8BIT, 0x4000, 0x08},
+	{SC2310_8BIT, 0x4001, 0x04},
+	{SC2310_8BIT, 0x4002, 0x45},
+	{SC2310_8BIT, 0x4004, 0x08},
+	{SC2310_8BIT, 0x4005, 0x18},
+	{SC2310_8BIT, 0x4006, 0x20},
+	{SC2310_8BIT, 0x4008, 0x24},
+	{SC2310_8BIT, 0x4009, 0x10},
+	{SC2310_8BIT, 0x400c, 0x00},
+	{SC2310_8BIT, 0x400d, 0x00},
+	{SC2310_8BIT, 0x4058, 0x00},
+	{SC2310_8BIT, 0x404e, 0x37},
+	{SC2310_8BIT, 0x404f, 0x8f},
+	{SC2310_8BIT, 0x4058, 0x00},
+	{SC2310_8BIT, 0x4101, 0xb2},
+	{SC2310_8BIT, 0x4303, 0x00},
+	{SC2310_8BIT, 0x4304, 0x08},
+	{SC2310_8BIT, 0x4307, 0x31},
+	{SC2310_8BIT, 0x4311, 0x04},
+	{SC2310_8BIT, 0x4315, 0x01},
+	{SC2310_8BIT, 0x4511, 0x05},
+	{SC2310_8BIT, 0x4512, 0x01},
+	{SC2310_8BIT, 0x4806, 0x00},
+	{SC2310_8BIT, 0x4816, 0x52},
+	{SC2310_8BIT, 0x481f, 0x30},
+	{SC2310_8BIT, 0x4826, 0x2c},
+	{SC2310_8BIT, 0x4831, 0x64},
+	{SC2310_8BIT, 0x4d00, 0x04},
+	{SC2310_8BIT, 0x4d01, 0x71},
+	{SC2310_8BIT, 0x4d02, 0xfd},
+	{SC2310_8BIT, 0x4d03, 0xf5},
+	{SC2310_8BIT, 0x4d04, 0x0c},
+	{SC2310_8BIT, 0x4d05, 0xcc},
+	{SC2310_8BIT, 0x4837, 0x0a},
+	{SC2310_8BIT, 0x5000, 0x06},
+	{SC2310_8BIT, 0x5001, 0x01},
+	{SC2310_8BIT, 0x5003, 0x20},
+	{SC2310_8BIT, 0x5046, 0x0a},
+	{SC2310_8BIT, 0x5013, 0x00},
+	{SC2310_8BIT, 0x5046, 0x0a},
+	{SC2310_8BIT, 0x5780, 0x1c},
+	{SC2310_8BIT, 0x5786, 0x20},
+	{SC2310_8BIT, 0x5787, 0x10},
+	{SC2310_8BIT, 0x5788, 0x18},
+	{SC2310_8BIT, 0x578a, 0x04},
+	{SC2310_8BIT, 0x578b, 0x02},
+	{SC2310_8BIT, 0x578c, 0x02},
+	{SC2310_8BIT, 0x578e, 0x06},
+	{SC2310_8BIT, 0x578f, 0x02},
+	{SC2310_8BIT, 0x5790, 0x02},
+	{SC2310_8BIT, 0x5791, 0xff},
+	{SC2310_8BIT, 0x5842, 0x01},
+	{SC2310_8BIT, 0x5843, 0x2b},
+	{SC2310_8BIT, 0x5844, 0x01},
+	{SC2310_8BIT, 0x5845, 0x92},
+	{SC2310_8BIT, 0x5846, 0x01},
+	{SC2310_8BIT, 0x5847, 0x8f},
+	{SC2310_8BIT, 0x5848, 0x01},
+	{SC2310_8BIT, 0x5849, 0x0c},
+	{SC2310_8BIT, 0x5e00, 0x00},
+	{SC2310_8BIT, 0x5e10, 0x0c},
+	{SC2310_8BIT, 0x0100, 0x00},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 654x496 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct sc2310_reg const sc2310_654x496[] = {
+	{SC2310_8BIT, 0x3501, 0x3d},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe6},
+	{SC2310_8BIT, 0x3709, 0xc7},
+	{SC2310_8BIT, 0x3803, 0x00},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xa3},
+	{SC2310_8BIT, 0x3808, 0x02},
+	{SC2310_8BIT, 0x3809, 0x90},
+	{SC2310_8BIT, 0x380a, 0x01},
+	{SC2310_8BIT, 0x380b, 0xf0},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x08},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x04},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 1296x976 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+*DS from 2592x1952
+*/
+static struct sc2310_reg const sc2310_1296x976[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+
+	{SC2310_8BIT, 0x3800, 0x00},
+	{SC2310_8BIT, 0x3801, 0x00},
+	{SC2310_8BIT, 0x3802, 0x00},
+	{SC2310_8BIT, 0x3803, 0x00},
+
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xA3},
+
+	{SC2310_8BIT, 0x3808, 0x05},
+	{SC2310_8BIT, 0x3809, 0x10},
+	{SC2310_8BIT, 0x380a, 0x03},
+	{SC2310_8BIT, 0x380b, 0xD0},
+
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+
+	{SC2310_8BIT, 0x3810, 0x00},
+	{SC2310_8BIT, 0x3811, 0x10},
+	{SC2310_8BIT, 0x3812, 0x00},
+	{SC2310_8BIT, 0x3813, 0x02},
+
+	{SC2310_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC2310_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+
+};
+
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2564x1956
+ */
+static struct sc2310_reg const sc2310_336x256[] = {
+	{SC2310_8BIT, 0x3501, 0x3d},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe6},
+	{SC2310_8BIT, 0x3709, 0xc7},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xa3},
+	{SC2310_8BIT, 0x3808, 0x01},
+	{SC2310_8BIT, 0x3809, 0x50},
+	{SC2310_8BIT, 0x380a, 0x01},
+	{SC2310_8BIT, 0x380b, 0x00},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x1E},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x04},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 336x256 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2368x1956
+ */
+static struct sc2310_reg const sc2310_368x304[] = {
+	{SC2310_8BIT, 0x3501, 0x3d},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe6},
+	{SC2310_8BIT, 0x3709, 0xc7},
+	{SC2310_8BIT, 0x3808, 0x01},
+	{SC2310_8BIT, 0x3809, 0x70},
+	{SC2310_8BIT, 0x380a, 0x01},
+	{SC2310_8BIT, 0x380b, 0x30},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x80},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x04},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * sc2310_192x160 30fps 17ms VBlanking 2lane 10Bit (Scaling)
+ DS from 2460x1956
+ */
+static struct sc2310_reg const sc2310_192x160[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x80},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xA3},
+	{SC2310_8BIT, 0x3808, 0x00},
+	{SC2310_8BIT, 0x3809, 0xC0},
+	{SC2310_8BIT, 0x380a, 0x00},
+	{SC2310_8BIT, 0x380b, 0xA0},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x40},
+	{SC2310_8BIT, 0x3813, 0x00},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x04},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+
+static struct sc2310_reg const sc2310_736x496[] = {
+	{SC2310_8BIT, 0x3501, 0x3d},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe6},
+	{SC2310_8BIT, 0x3709, 0xc7},
+	{SC2310_8BIT, 0x3803, 0x68},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0x3b},
+	{SC2310_8BIT, 0x3808, 0x02},
+	{SC2310_8BIT, 0x3809, 0xe0},
+	{SC2310_8BIT, 0x380a, 0x01},
+	{SC2310_8BIT, 0x380b, 0xf0},
+	{SC2310_8BIT, 0x380c, 0x0a}, /*hts*/
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07}, /*vts*/
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x08},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x04},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+static struct sc2310_reg const sc2310_736x496[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe6},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0x00},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xa3},
+	{SC2310_8BIT, 0x3808, 0x02},
+	{SC2310_8BIT, 0x3809, 0xe0},
+	{SC2310_8BIT, 0x380a, 0x01},
+	{SC2310_8BIT, 0x380b, 0xf0},
+	{SC2310_8BIT, 0x380c, 0x0d},
+	{SC2310_8BIT, 0x380d, 0xb0},
+	{SC2310_8BIT, 0x380e, 0x05},
+	{SC2310_8BIT, 0x380f, 0xf2},
+	{SC2310_8BIT, 0x3811, 0x08},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x31},
+	{SC2310_8BIT, 0x3815, 0x31},
+	{SC2310_8BIT, 0x3820, 0x01},
+	{SC2310_8BIT, 0x3821, 0x1f},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+*/
+/*
+ * 976x556 30fps 8.8ms VBlanking 2lane 10Bit (Scaling)
+ */
+static struct sc2310_reg const sc2310_976x556[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0xf0},
+	{SC2310_8BIT, 0x3806, 0x06},
+	{SC2310_8BIT, 0x3807, 0xa7},
+	{SC2310_8BIT, 0x3808, 0x03},
+	{SC2310_8BIT, 0x3809, 0xd0},
+	{SC2310_8BIT, 0x380a, 0x02},
+	{SC2310_8BIT, 0x380b, 0x2C},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x10},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*DS from 2624x1492*/
+static struct sc2310_reg const sc2310_1296x736[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+
+	{SC2310_8BIT, 0x3800, 0x00},
+	{SC2310_8BIT, 0x3801, 0x00},
+	{SC2310_8BIT, 0x3802, 0x00},
+	{SC2310_8BIT, 0x3803, 0x00},
+
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xA3},
+
+	{SC2310_8BIT, 0x3808, 0x05},
+	{SC2310_8BIT, 0x3809, 0x10},
+	{SC2310_8BIT, 0x380a, 0x02},
+	{SC2310_8BIT, 0x380b, 0xe0},
+
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+
+	{SC2310_8BIT, 0x3813, 0xE8},
+
+	{SC2310_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC2310_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+static struct sc2310_reg const sc2310_1636p_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0xf0},
+	{SC2310_8BIT, 0x3806, 0x06},
+	{SC2310_8BIT, 0x3807, 0xa7},
+	{SC2310_8BIT, 0x3808, 0x06},
+	{SC2310_8BIT, 0x3809, 0x64},
+	{SC2310_8BIT, 0x380a, 0x04},
+	{SC2310_8BIT, 0x380b, 0x48},
+	{SC2310_8BIT, 0x380c, 0x0a}, /*hts*/
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07}, /*vts*/
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x02},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+static struct sc2310_reg const sc2310_1616x1216_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x80},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3800, 0x00},	/*{3800,3801} Array X start*/
+	{SC2310_8BIT, 0x3801, 0x08},	/* 04 //{3800,3801} Array X start*/
+	{SC2310_8BIT, 0x3802, 0x00},	/*{3802,3803} Array Y start*/
+	{SC2310_8BIT, 0x3803, 0x04},	/* 00  //{3802,3803} Array Y start*/
+	{SC2310_8BIT, 0x3804, 0x0a},	/*{3804,3805} Array X end*/
+	{SC2310_8BIT, 0x3805, 0x37},	/* 3b  //{3804,3805} Array X end*/
+	{SC2310_8BIT, 0x3806, 0x07},	/*{3806,3807} Array Y end*/
+	{SC2310_8BIT, 0x3807, 0x9f},	/* a3  //{3806,3807} Array Y end*/
+	{SC2310_8BIT, 0x3808, 0x06},	/*{3808,3809} Final output H size*/
+	{SC2310_8BIT, 0x3809, 0x50},	/*{3808,3809} Final output H size*/
+	{SC2310_8BIT, 0x380a, 0x04},	/*{380a,380b} Final output V size*/
+	{SC2310_8BIT, 0x380b, 0xc0},	/*{380a,380b} Final output V size*/
+	{SC2310_8BIT, 0x380c, 0x0a},	/*{380c,380d} HTS*/
+	{SC2310_8BIT, 0x380d, 0x80},	/*{380c,380d} HTS*/
+	{SC2310_8BIT, 0x380e, 0x07},	/*{380e,380f} VTS*/
+	{SC2310_8BIT, 0x380f, 0xc0},	/* bc	//{380e,380f} VTS*/
+	{SC2310_8BIT, 0x3810, 0x00},	/*{3810,3811} windowing X offset*/
+	{SC2310_8BIT, 0x3811, 0x10},	/*{3810,3811} windowing X offset*/
+	{SC2310_8BIT, 0x3812, 0x00},	/*{3812,3813} windowing Y offset*/
+	{SC2310_8BIT, 0x3813, 0x06},	/*{3812,3813} windowing Y offset*/
+	{SC2310_8BIT, 0x3814, 0x11},	/*X subsample control*/
+	{SC2310_8BIT, 0x3815, 0x11},	/*Y subsample control*/
+	{SC2310_8BIT, 0x3820, 0x00},	/*FLIP/Binnning control*/
+	{SC2310_8BIT, 0x3821, 0x1e},	/*MIRROR control*/
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x5041, 0x84},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+
+/*
+ * 1940x1096 30fps 8.8ms VBlanking 2lane 10bit (Scaling)
+ */
+static struct sc2310_reg const sc2310_1940x1096[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0xf0},
+	{SC2310_8BIT, 0x3806, 0x06},
+	{SC2310_8BIT, 0x3807, 0xa7},
+	{SC2310_8BIT, 0x3808, 0x07},
+	{SC2310_8BIT, 0x3809, 0x94},
+	{SC2310_8BIT, 0x380a, 0x04},
+	{SC2310_8BIT, 0x380b, 0x48},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x02},
+	{SC2310_8BIT, 0x3813, 0x02},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x80},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+static struct sc2310_reg const sc2310_2592x1456_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3800, 0x00},
+	{SC2310_8BIT, 0x3801, 0x00},
+	{SC2310_8BIT, 0x3802, 0x00},
+	{SC2310_8BIT, 0x3803, 0xf0},
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3806, 0x06},
+	{SC2310_8BIT, 0x3807, 0xa4},
+	{SC2310_8BIT, 0x3808, 0x0a},
+	{SC2310_8BIT, 0x3809, 0x20},
+	{SC2310_8BIT, 0x380a, 0x05},
+	{SC2310_8BIT, 0x380b, 0xb0},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x10},
+	{SC2310_8BIT, 0x3813, 0x00},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+static struct sc2310_reg const sc2310_2576x1456_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3800, 0x00},
+	{SC2310_8BIT, 0x3801, 0x00},
+	{SC2310_8BIT, 0x3802, 0x00},
+	{SC2310_8BIT, 0x3803, 0xf0},
+	{SC2310_8BIT, 0x3804, 0x0a},
+	{SC2310_8BIT, 0x3805, 0x3f},
+	{SC2310_8BIT, 0x3806, 0x06},
+	{SC2310_8BIT, 0x3807, 0xa4},
+	{SC2310_8BIT, 0x3808, 0x0a},
+	{SC2310_8BIT, 0x3809, 0x10},
+	{SC2310_8BIT, 0x380a, 0x05},
+	{SC2310_8BIT, 0x380b, 0xb0},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x18},
+	{SC2310_8BIT, 0x3813, 0x00},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 2592x1944 30fps 0.6ms VBlanking 2lane 10Bit
+ */
+static struct sc2310_reg const sc2310_2592x1944_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0x00},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xa3},
+	{SC2310_8BIT, 0x3808, 0x0a},
+	{SC2310_8BIT, 0x3809, 0x20},
+	{SC2310_8BIT, 0x380a, 0x07},
+	{SC2310_8BIT, 0x380b, 0x98},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x10},
+	{SC2310_8BIT, 0x3813, 0x00},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 11:9 Full FOV Output, expected FOV Res: 2346x1920
+ * ISP Effect Res: 1408x1152
+ * Sensor out: 1424x1168, DS From: 2380x1952
+ *
+ * WA: Left Offset: 8, Hor scal: 64
+ */
+static struct sc2310_reg const sc2310_1424x1168_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{SC2310_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{SC2310_8BIT, 0x3801, 0x50}, /* 80 */
+	{SC2310_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{SC2310_8BIT, 0x3803, 0x02}, /* 2 */
+	{SC2310_8BIT, 0x3804, 0x09}, /* TIMING_X_ADDR_END */
+	{SC2310_8BIT, 0x3805, 0xdd}, /* 2525 */
+	{SC2310_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{SC2310_8BIT, 0x3807, 0xa1}, /* 1953 */
+	{SC2310_8BIT, 0x3808, 0x05}, /* TIMING_X_OUTPUT_SIZE */
+	{SC2310_8BIT, 0x3809, 0x90}, /* 1424 */
+	{SC2310_8BIT, 0x380a, 0x04}, /* TIMING_Y_OUTPUT_SIZE */
+	{SC2310_8BIT, 0x380b, 0x90}, /* 1168 */
+	{SC2310_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{SC2310_8BIT, 0x3811, 0x02}, /* 2 */
+	{SC2310_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{SC2310_8BIT, 0x3813, 0x00}, /* 0 */
+	{SC2310_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{SC2310_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+/*
+ * 3:2 Full FOV Output, expected FOV Res: 2560x1706
+ * ISP Effect Res: 720x480
+ * Sensor out: 736x496, DS From 2616x1764
+ */
+static struct sc2310_reg const sc2310_736x496_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x3b}, /* long exposure[15:8] */
+	{SC2310_8BIT, 0x3502, 0x80}, /* long exposure[7:0] */
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3800, 0x00}, /* TIMING_X_ADDR_START */
+	{SC2310_8BIT, 0x3801, 0x02}, /* 2 */
+	{SC2310_8BIT, 0x3802, 0x00}, /* TIMING_Y_ADDR_START */
+	{SC2310_8BIT, 0x3803, 0x62}, /* 98 */
+	{SC2310_8BIT, 0x3804, 0x0a}, /* TIMING_X_ADDR_END */
+	{SC2310_8BIT, 0x3805, 0x3b}, /* 2619 */
+	{SC2310_8BIT, 0x3806, 0x07}, /* TIMING_Y_ADDR_END */
+	{SC2310_8BIT, 0x3807, 0x43}, /* 1859 */
+	{SC2310_8BIT, 0x3808, 0x02}, /* TIMING_X_OUTPUT_SIZE */
+	{SC2310_8BIT, 0x3809, 0xe0}, /* 736 */
+	{SC2310_8BIT, 0x380a, 0x01}, /* TIMING_Y_OUTPUT_SIZE */
+	{SC2310_8BIT, 0x380b, 0xf0}, /* 496 */
+	{SC2310_8BIT, 0x380c, 0x0a}, /* TIMING_HTS */
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07}, /* TIMING_VTS */
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3810, 0x00}, /* TIMING_ISP_X_WIN */
+	{SC2310_8BIT, 0x3811, 0x02}, /* 2 */
+	{SC2310_8BIT, 0x3812, 0x00}, /* TIMING_ISP_Y_WIN */
+	{SC2310_8BIT, 0x3813, 0x00}, /* 0 */
+	{SC2310_8BIT, 0x3814, 0x11}, /* TIME_X_INC */
+	{SC2310_8BIT, 0x3815, 0x11}, /* TIME_Y_INC */
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x5041, 0x84}, /* scale is auto enabled */
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+static struct sc2310_reg const sc2310_2576x1936_30fps[] = {
+	{SC2310_8BIT, 0x3501, 0x7b},
+	{SC2310_8BIT, 0x3502, 0x00},
+	{SC2310_8BIT, 0x3708, 0xe2},
+	{SC2310_8BIT, 0x3709, 0xc3},
+	{SC2310_8BIT, 0x3803, 0x00},
+	{SC2310_8BIT, 0x3806, 0x07},
+	{SC2310_8BIT, 0x3807, 0xa3},
+	{SC2310_8BIT, 0x3808, 0x0a},
+	{SC2310_8BIT, 0x3809, 0x10},
+	{SC2310_8BIT, 0x380a, 0x07},
+	{SC2310_8BIT, 0x380b, 0x90},
+	{SC2310_8BIT, 0x380c, 0x0a},
+	{SC2310_8BIT, 0x380d, 0x80},
+	{SC2310_8BIT, 0x380e, 0x07},
+	{SC2310_8BIT, 0x380f, 0xc0},
+	{SC2310_8BIT, 0x3811, 0x18},
+	{SC2310_8BIT, 0x3813, 0x00},
+	{SC2310_8BIT, 0x3814, 0x11},
+	{SC2310_8BIT, 0x3815, 0x11},
+	{SC2310_8BIT, 0x3820, 0x00},
+	{SC2310_8BIT, 0x3821, 0x1e},
+	{SC2310_8BIT, 0x5002, 0x00},
+	{SC2310_8BIT, 0x0100, 0x01},
+	{SC2310_TOK_TERM, 0, 0}
+};
+
+struct sc2310_resolution sc2310_res_preview[] = {
+	{
+		.desc = "sc2310_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_736x496_30fps,
+	},
+	{
+		.desc = "sc2310_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_1616x1216_30fps,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2576,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2576x1456_30fps,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2576,
+		.height = 1936,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2576x1936_30fps,
+	},
+};
+#define N_RES_PREVIEW (ARRAY_SIZE(sc2310_res_preview))
+
+struct sc2310_resolution sc2310_res_still[] = {
+	{
+		.desc = "sc2310_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_736x496_30fps,
+	},
+	{
+		.desc = "sc2310_1424x1168_30fps",
+		.width = 1424,
+		.height = 1168,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_1424x1168_30fps,
+	},
+	{
+		.desc = "sc2310_1616x1216_30fps",
+		.width = 1616,
+		.height = 1216,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_1616x1216_30fps,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2592x1456_30fps,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2592x1944_30fps,
+	},
+};
+#define N_RES_STILL (ARRAY_SIZE(sc2310_res_still))
+
+struct sc2310_resolution sc2310_res_video[] = {
+	{
+		.desc = "sc2310_736x496_30fps",
+		.width = 736,
+		.height = 496,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc2310_736x496,
+	},
+	{
+		.desc = "sc2310_336x256_30fps",
+		.width = 336,
+		.height = 256,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc2310_336x256,
+	},
+	{
+		.desc = "sc2310_368x304_30fps",
+		.width = 368,
+		.height = 304,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc2310_368x304,
+	},
+	{
+		.desc = "sc2310_192x160_30fps",
+		.width = 192,
+		.height = 160,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 1,
+		.regs = sc2310_192x160,
+	},
+	{
+		.desc = "sc2310_1296x736_30fps",
+		.width = 1296,
+		.height = 736,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = sc2310_1296x736,
+	},
+	{
+		.desc = "sc2310_1296x976_30fps",
+		.width = 1296,
+		.height = 976,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 2,
+		.bin_factor_y = 2,
+		.bin_mode = 0,
+		.regs = sc2310_1296x976,
+	},
+	{
+		.desc = "sc2310_1636P_30fps",
+		.width = 1636,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_1636p_30fps,
+	},
+	{
+		.desc = "sc2310_1080P_30fps",
+		.width = 1940,
+		.height = 1096,
+		.fps = 30,
+		.pix_clk_freq = 160,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_1940x1096,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2592,
+		.height = 1456,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2592x1456_30fps,
+	},
+	{
+		.desc = "sc2310_5M_30fps",
+		.width = 2592,
+		.height = 1944,
+		.pix_clk_freq = 160,
+		.fps = 30,
+		.used = 0,
+		.pixels_per_line = 2688,
+		.lines_per_frame = 1984,
+		.bin_factor_x = 1,
+		.bin_factor_y = 1,
+		.bin_mode = 0,
+		.regs = sc2310_2592x1944_30fps,
+	},
+};
+
+#define N_RES_VIDEO (ARRAY_SIZE(sc2310_res_video))
+
+static struct sc2310_resolution *sc2310_res = sc2310_res_preview;
+static unsigned long N_RES = N_RES_PREVIEW;
+#endif
+#endif

Some files were not shown because too many files changed in this diff