From aa6571d7835b130a344e63bba6a66648ec8d9ad9 Mon Sep 17 00:00:00 2001 From: Viktor <35473052+viktorxda@users.noreply.github.com> Date: Sat, 5 Aug 2023 14:55:12 +0200 Subject: [PATCH] Packages: add Sigmastar infinity6 sensor source --- .../kernel/ssc335.generic.config.rotek | 2576 -------- .../kernel/ssc335.generic.config.tiandy | 2652 -------- .../kernel/ssc335de.generic.config.kama | 2654 -------- general/package/Config.in | 1 + .../sigmastar-osdrv-infinity6b0/Config.in | 1 + .../files/script/load_sigmastar | 7 +- .../files/sensors/configs/gc2063.bin | Bin 0 -> 86944 bytes .../files/sensors/configs/imx307.bin | Bin 0 -> 86944 bytes .../files/sensors/kmod/sensor_gc2053_mipi.ko | Bin 10240 -> 0 bytes .../files/sensors/kmod/sensor_gc4653_mipi.ko | Bin 9764 -> 0 bytes .../files/sensors/kmod/sensor_imx307_mipi.ko | Bin 20228 -> 0 bytes .../files/sensors/kmod/sensor_imx335_mipi.ko | Bin 20688 -> 0 bytes .../files/sensors/kmod/sensor_sc2239_mipi.ko | Bin 10432 -> 0 bytes .../files/sensors/kmod/sensor_sc2335_mipi.ko | Bin 10556 -> 0 bytes .../files/sensors/kmod/sensor_sc3335_mipi.ko | Bin 10348 -> 0 bytes .../sigmastar-osdrv-infinity6b0.mk | 1 - .../sigmastar-osdrv-infinity6e/Config.in | 1 + .../files/script/load_sigmastar | 3 +- .../files/sensors/configs/imx335.bin | Bin 0 -> 86916 bytes .../files/sensors/kmod/sensor_imx274_mipi.ko | Bin 24968 -> 0 bytes .../files/sensors/kmod/sensor_imx335_mipi.ko | Bin 20572 -> 0 bytes .../files/sensors/kmod/sensor_imx347_mipi.ko | Bin 17704 -> 0 bytes .../files/sensors/kmod/sensor_imx415_mipi.ko | Bin 29232 -> 0 bytes .../files/sensors/kmod/sensor_sc8235_mipi.ko | Bin 31144 -> 0 bytes .../sigmastar-osdrv-infinity6e.mk | 1 - .../package/sigmastar-osdrv-sensor/Config.in | 5 + .../sigmastar-osdrv-sensor.mk | 20 + .../src/infinity6b0/Makefile | 9 + .../infinity6b0/include/drv_ms_cus_sensor.h | 1029 ++++ .../src/infinity6b0/include/drv_sensor.h | 53 + .../infinity6b0/include/drv_sensor_common.h | 379 ++ .../include/drv_sensor_init_table.h | 114 + .../src/infinity6b0/include/sensor_i2c_api.h | 168 + .../infinity6b0/sensor/sensor_gc2053_mipi.c | 1291 ++++ .../infinity6b0/sensor/sensor_gc4653_mipi.c | 1108 ++++ .../infinity6b0/sensor/sensor_imx307_mipi.c | 3208 ++++++++++ .../infinity6b0/sensor/sensor_imx335_mipi.c | 3707 ++++++++++++ .../infinity6b0/sensor/sensor_sc2239_mipi.c | 1086 ++++ .../infinity6b0/sensor/sensor_sc2335_mipi.c | 1107 ++++ .../infinity6b0/sensor/sensor_sc3335_mipi.c | 1118 ++++ .../src/infinity6e/Makefile | 9 + .../infinity6e/include/drv_ms_cus_sensor.h | 1045 ++++ .../src/infinity6e/include/drv_sensor.h | 53 + .../infinity6e/include/drv_sensor_common.h | 379 ++ .../include/drv_sensor_init_table.h | 114 + .../src/infinity6e/include/sensor_i2c_api.h | 168 + .../infinity6e/sensor/sensor_imx274_mipi.c | 4112 +++++++++++++ .../infinity6e/sensor/sensor_imx335_mipi.c | 3458 +++++++++++ .../infinity6e/sensor/sensor_imx347_mipi.c | 2199 +++++++ .../infinity6e/sensor/sensor_imx415_mipi.c | 5391 +++++++++++++++++ .../infinity6e/sensor/sensor_sc8235_mipi.c | 5134 ++++++++++++++++ 51 files changed, 36473 insertions(+), 7888 deletions(-) delete mode 100644 br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.rotek delete mode 100644 br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.tiandy delete mode 100644 br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335de.generic.config.kama create mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/gc2063.bin create mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/imx307.bin delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_gc2053_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_gc4653_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx307_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx335_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2239_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2335_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc3335_mipi.ko create mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/configs/imx335.bin delete mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx274_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx335_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx347_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx415_mipi.ko delete mode 100644 general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_sc8235_mipi.ko create mode 100644 general/package/sigmastar-osdrv-sensor/Config.in create mode 100644 general/package/sigmastar-osdrv-sensor/sigmastar-osdrv-sensor.mk create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/Makefile create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_ms_cus_sensor.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_common.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_init_table.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/sensor_i2c_api.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc2053_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc4653_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx307_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx335_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2239_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2335_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc3335_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/Makefile create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_ms_cus_sensor.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_common.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_init_table.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/include/sensor_i2c_api.h create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx274_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx335_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx347_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx415_mipi.c create mode 100644 general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_sc8235_mipi.c diff --git a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.rotek b/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.rotek deleted file mode 100644 index a7a5d8ce..00000000 --- a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.rotek +++ /dev/null @@ -1,2576 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/arm 4.9.84 Kernel Configuration -# -CONFIG_ARM=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_GENERIC_BUG=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_EXTABLE_SORT=y - -# -# General setup -# -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -# CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_LZ4=y -# CONFIG_KERNEL_GZIP is not set -# CONFIG_KERNEL_LZMA is not set -CONFIG_KERNEL_XZ=y -# CONFIG_KERNEL_LZO is not set -# CONFIG_KERNEL_LZ4 is not set -CONFIG_DEFAULT_HOSTNAME="(none)" -# CONFIG_SWAP is not set -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_CROSS_MEMORY_ATTACH is not set -# CONFIG_FHANDLE is not set -# CONFIG_USELIB is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_HANDLE_DOMAIN_IRQ=y -# CONFIG_IRQ_DOMAIN_DEBUG is not set -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y - -# -# Timers subsystem -# -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_PREEMPT_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_SRCU=y -# CONFIG_TASKS_RCU is not set -CONFIG_RCU_STALL_COMMON=y -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_EXPEDITE_BOOT is not set -# CONFIG_BUILD_BIN2C is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_NMI_LOG_BUF_SHIFT=13 -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_CGROUPS=y -# CONFIG_MEMCG is not set -# CONFIG_BLK_CGROUP is not set -# CONFIG_CGROUP_SCHED is not set -# CONFIG_CGROUP_PIDS is not set -# CONFIG_CGROUP_FREEZER is not set -# CONFIG_CPUSETS is not set -# CONFIG_CGROUP_DEVICE is not set -# CONFIG_CGROUP_CPUACCT is not set -# CONFIG_CGROUP_PERF is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CHECKPOINT_RESTORE is not set -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_IPC_NS=y -# CONFIG_USER_NS is not set -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="/src/rootfs" -CONFIG_INITRAMFS_ROOT_UID=0 -CONFIG_INITRAMFS_ROOT_GID=0 -# CONFIG_RD_GZIP is not set -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -# CONFIG_RD_LZ4 is not set -# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_HAVE_UID16=y -CONFIG_BPF=y -CONFIG_EXPERT=y -CONFIG_UID16=y -CONFIG_MULTIUSER=y -# CONFIG_SGETMASK_SYSCALL is not set -CONFIG_SYSFS_SYSCALL=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y -# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set -CONFIG_KALLSYMS_BASE_RELATIVE=y -CONFIG_PRINTK=y -CONFIG_PRINTK_NMI=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_BASE_FULL is not set -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_SHMEM=y -CONFIG_AIO=y -# CONFIG_ADVISE_SYSCALLS is not set -# CONFIG_USERFAULTFD is not set -CONFIG_MEMBARRIER=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_SLUB_DEBUG is not set -CONFIG_COMPAT_BRK=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SYSTEM_DATA_VERIFICATION is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -# CONFIG_UPROBES is not set -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_NMI=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_GCC_PLUGINS=y -# CONFIG_GCC_PLUGINS is not set -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_CC_STACKPROTECTOR=y -# CONFIG_CC_STACKPROTECTOR_NONE is not set -CONFIG_CC_STACKPROTECTOR_REGULAR=y -# CONFIG_CC_STACKPROTECTOR_STRONG is not set -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_HAVE_EXIT_THREAD=y -CONFIG_ARCH_MMAP_RND_BITS_MIN=8 -CONFIG_ARCH_MMAP_RND_BITS_MAX=16 -CONFIG_ARCH_MMAP_RND_BITS=8 -# CONFIG_HAVE_ARCH_HASH is not set -# CONFIG_ISA_BUS_API is not set -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OLD_SIGACTION=y -# CONFIG_CPU_NO_EFFICIENT_FFS is not set -# CONFIG_HAVE_ARCH_VMAP_STACK is not set - -# -# GCOV-based kernel profiling -# -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=1 -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_MODULE_SIG is not set -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -# CONFIG_LBDAF is not set -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set -# CONFIG_BLK_CMDLINE_PARSER is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_EFI_PARTITION=y - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_DEADLINE=y -# CONFIG_IOSCHED_CFQ is not set -CONFIG_DEFAULT_DEADLINE=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="deadline" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -# CONFIG_FREEZER is not set - -# -# System Type -# -CONFIG_MMU=y -# CONFIG_ARCH_INFINITY2 is not set -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_GEMINI is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_KS8695 is not set -# CONFIG_ARCH_W90X900 is not set -# CONFIG_ARCH_LPC32XX is not set -# CONFIG_ARCH_PXA is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_S3C24XX is not set -# CONFIG_ARCH_DAVINCI is not set -# CONFIG_ARCH_OMAP1 is not set - -# -# Multiple platform selection -# - -# -# CPU Core family selection -# -# CONFIG_ARCH_MULTI_V6 is not set -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_MULTI_V6_V7=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -# CONFIG_ARCH_VIRT is not set -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_ARTPEC is not set -# CONFIG_ARCH_AT91 is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_BERLIN is not set -# CONFIG_ARCH_DIGICOLOR is not set -# CONFIG_ARCH_HIGHBANK is not set -# CONFIG_ARCH_HISI is not set -# CONFIG_ARCH_KEYSTONE is not set -# CONFIG_ARCH_MESON is not set -CONFIG_ARCH_SSTAR=y -# CONFIG_SS_DUALOS is not set - -# -# Options -# -CONFIG_SS_DTB_NAME="infinity6b0-ssc009b-s01a" -CONFIG_SS_BUILTIN_DTB=y -CONFIG_MS_KERNEL_TYPE="" -CONFIG_SSTAR_CHIP_NAME="infinity6b0" -CONFIG_SSTAR_SHORT_NAME="I6B0" -# CONFIG_MP_IRQ_TRACE is not set -CONFIG_SKIP_SQUASHFS_BAD_BLOCK=y - -# -# Fast boot -# -# CONFIG_SS_BUILTIN_UNFDT is not set -# CONFIG_FB_DTS_SKIP_CRC is not set -# CONFIG_FB_DTS_SCAN_MEMORY_ONCE is not set -# CONFIG_FB_DTS_SKIP_ATAGS_TO_FDT is not set -CONFIG_DISABLE_CLK_DEBUGFS_SUPPORT=y -CONFIG_DEFERRED_INIICALLS=y -# CONFIG_DEFERRED_INIICALLS_SLAB_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PARAM_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PPERF_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_MORE_SYSFS is not set -# CONFIG_DEFERRED_CREATE_DTS_SYSNODE is not set -# CONFIG_CRYPTO_MANAGER_NO_TESTS_THREAD is not set -CONFIG_ARCH_INFINITY6B0=y -CONFIG_SS_PROFILING_TIME=y -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_MEDIATEK is not set - -# -# TI OMAP/AM/DM/DRA Family -# -# CONFIG_ARCH_OMAP3 is not set -# CONFIG_ARCH_OMAP4 is not set -# CONFIG_SOC_OMAP5 is not set -# CONFIG_SOC_AM33XX is not set -# CONFIG_SOC_AM43XX is not set -# CONFIG_SOC_DRA7XX is not set -# CONFIG_ARCH_MMP is not set -# CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_ROCKCHIP is not set -# CONFIG_ARCH_SOCFPGA is not set -# CONFIG_PLAT_SPEAR is not set -# CONFIG_ARCH_STI is not set -# CONFIG_ARCH_S5PV210 is not set -# CONFIG_ARCH_EXYNOS is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_SIRF is not set -# CONFIG_ARCH_TANGO is not set -# CONFIG_ARCH_TEGRA is not set -# CONFIG_ARCH_UNIPHIER is not set -# CONFIG_ARCH_U8500 is not set -# CONFIG_ARCH_VEXPRESS is not set -# CONFIG_ARCH_WM8850 is not set -# CONFIG_ARCH_ZX is not set -# CONFIG_ARCH_ZYNQ is not set - -# -# Processor Type -# -CONFIG_CPU_V7=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_HAS_ASID=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y - -# -# Processor Features -# -# CONFIG_ARM_LPAE is not set -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_ARM_THUMB=y -CONFIG_ARM_THUMBEE=y -CONFIG_ARM_VIRT_EXT=y -# CONFIG_SWP_EMULATE is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_KUSER_HELPERS=y -CONFIG_VDSO=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -# CONFIG_CACHE_L2X0 is not set -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -# CONFIG_DEBUG_RODATA is not set -CONFIG_MULTI_IRQ_HANDLER=y -# CONFIG_ARM_ERRATA_430973 is not set -# CONFIG_ARM_ERRATA_720789 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_775420 is not set -# CONFIG_ARM_ERRATA_773022 is not set -# CONFIG_ARM_ERRATA_818325_852422 is not set -# CONFIG_ARM_ERRATA_821420 is not set -# CONFIG_ARM_ERRATA_825619 is not set -# CONFIG_ARM_ERRATA_852421 is not set -# CONFIG_ARM_ERRATA_852423 is not set - -# -# Bus support -# -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_PCCARD is not set - -# -# Kernel Features -# -CONFIG_HAVE_SMP=y -# CONFIG_SMP is not set -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_VMSPLIT_3G=y -# CONFIG_VMSPLIT_3G_OPT is not set -# CONFIG_VMSPLIT_2G is not set -# CONFIG_VMSPLIT_1G is not set -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_ARM_PSCI is not set -CONFIG_ARCH_NR_GPIO=0 -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -CONFIG_HZ_FIXED=0 -CONFIG_HZ_100=y -# CONFIG_HZ_200 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_500 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=100 -CONFIG_SCHED_HRTICK=y -CONFIG_THUMB2_KERNEL=y -CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11=y -CONFIG_ARM_ASM_UNIFIED=y -CONFIG_ARM_PATCH_IDIV=y -CONFIG_AEABI=y -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -CONFIG_HAVE_ARCH_PFN_VALID=y -# CONFIG_HIGHMEM is not set -CONFIG_CPU_SW_DOMAIN_PAN=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -# CONFIG_ARM_MODULE_PLTS is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_NO_BOOTMEM=y -CONFIG_MEMORY_ISOLATION=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_COMPACTION=y -CONFIG_MIGRATION=y -# CONFIG_PHYS_ADDR_T_64BIT is not set -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_CLEANCACHE is not set -CONFIG_CMA=y -CONFIG_CMA_DEBUG=y -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_AREAS=1 -# CONFIG_ZPOOL is not set -# CONFIG_ZBUD is not set -# CONFIG_ZSMALLOC is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_IDLE_PAGE_TRACKING is not set -CONFIG_FORCE_MAX_ZONEORDER=10 -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_UACCESS_WITH_MEMCPY is not set -# CONFIG_SECCOMP is not set -CONFIG_SWIOTLB=y -CONFIG_IOMMU_HELPER=y -# CONFIG_PARAVIRT is not set -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -# CONFIG_XEN is not set - -# -# Boot options -# -CONFIG_USE_OF=y -CONFIG_ATAGS=y -# CONFIG_DEPRECATED_PARAM_STRUCT is not set -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_CMDLINE="" -# CONFIG_KEXEC is not set -# CONFIG_CRASH_DUMP is not set -CONFIG_AUTO_ZRELADDR=y -# CONFIG_EFI is not set - -# -# CPU Power Management -# - -# -# CPU Frequency scaling -# -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_STAT_DETAILS=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set - -# -# CPU frequency scaling drivers -# -# CONFIG_CPUFREQ_DT is not set -# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set -# CONFIG_QORIQ_CPUFREQ is not set - -# -# CPU Idle -# -# CONFIG_CPU_IDLE is not set -# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set - -# -# Floating point emulation -# - -# -# At least one emulation must be selected -# -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_NEON=y -CONFIG_KERNEL_MODE_NEON=y - -# -# Userspace binary formats -# -CONFIG_BINFMT_ELF=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -# CONFIG_BINFMT_FLAT is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_COREDUMP=y - -# -# Power management options -# -# CONFIG_SUSPEND is not set -# CONFIG_PM is not set -# CONFIG_APM_EMULATION is not set -CONFIG_PM_OPP=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_CPU_SUSPEND is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -# CONFIG_XFRM_USER is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -# CONFIG_IP_FIB_TRIE_STATS is not set -# CONFIG_IP_MULTIPLE_TABLES is not set -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -# CONFIG_IP_PNP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_IP_MROUTE is not set -CONFIG_SYN_COOKIES=y -# CONFIG_NET_UDP_TUNNEL is not set -# CONFIG_NET_FOU is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_DIAG is not set -CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BIC is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_CDG is not set -# CONFIG_TCP_CONG_BBR is not set -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NET_PTP_CLASSIFY is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_BRIDGE=y -CONFIG_HAVE_NET_DSA=y -# CONFIG_NET_DSA is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -CONFIG_DNS_RESOLVER=y -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_MPLS is not set -# CONFIG_HSR is not set -# CONFIG_NET_SWITCHDEV is not set -# CONFIG_NET_L3_MASTER_DEV is not set -# CONFIG_NET_NCSI is not set -# CONFIG_SOCK_CGROUP_DATA is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CGROUP_NET_CLASSID is not set -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_JIT is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -# CONFIG_STREAM_PARSER is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=y -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -# CONFIG_CFG80211_INTERNAL_REGDB is not set -CONFIG_CFG80211_CRDA_SUPPORT=y -CONFIG_CFG80211_WEXT=y -# CONFIG_LIB80211 is not set -# CONFIG_MAC80211 is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_WIMAX is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set -# CONFIG_LWTUNNEL is not set -# CONFIG_DST_CACHE is not set -# CONFIG_NET_DEVLINK is not set -CONFIG_MAY_USE_DEVLINK=y -CONFIG_HAVE_CBPF_JIT=y - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_STANDALONE is not set -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -# CONFIG_FW_LOADER is not set -# CONFIG_ALLOW_DEV_COREDUMP is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_SPI=y -# CONFIG_DMA_SHARED_BUFFER is not set -CONFIG_DMA_CMA=y - -# -# Default contiguous memory area size: -# -CONFIG_CMA_SIZE_MBYTES=2 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=4 - -# -# Bus devices -# -# CONFIG_ARM_CCI400_PMU is not set -# CONFIG_ARM_CCI5xx_PMU is not set -# CONFIG_ARM_CCN is not set -# CONFIG_BRCMSTB_GISB_ARB is not set -# CONFIG_VEXPRESS_CONFIG is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_TESTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_AFS_PARTS is not set -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_PARTITIONED_MASTER is not set - -# -# RAM/ROM/Flash chip drivers -# -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_RAM=y -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP_OF=y -CONFIG_MTD_PLATRAM=y - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_SST25L is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOCG3 is not set -CONFIG_MTD_NAND_ECC=y -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND=y -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_NAND_DENALI_DT is not set -# CONFIG_MTD_NAND_GPIO is not set -# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set -CONFIG_MTD_NAND_IDS=y -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_BRCMNAND is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_NAND_HISI504 is not set -# CONFIG_MTD_NAND_MTK is not set -# CONFIG_MTD_ONENAND is not set - -# -# LPDDR & LPDDR2 PCM memory drivers -# -# CONFIG_MTD_LPDDR is not set -# CONFIG_MTD_LPDDR2_NVM is not set -CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_MT81xx_NOR is not set -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -# CONFIG_SPI_CADENCE_QUADSPI is not set -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_MTD_UBI_BLOCK is not set -CONFIG_DTC=y -CONFIG_OF=y -# CONFIG_OF_UNITTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_NET=y -CONFIG_OF_MDIO=y -CONFIG_OF_RESERVED_MEM=y -# CONFIG_OF_OVERLAY is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=65536 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_MG_DISK is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_NVME_TARGET is not set - -# -# Misc devices -# -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_AT25 is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_TI_ST is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set - -# -# Intel MIC Bus Driver -# - -# -# SCIF Bus Driver -# - -# -# VOP Bus Driver -# - -# -# Intel MIC Host Driver -# - -# -# Intel MIC Card Driver -# - -# -# SCIF Driver -# - -# -# Intel MIC Coprocessor State Management (COSM) Drivers -# - -# -# VOP Driver -# -# CONFIG_ECHO is not set -# CONFIG_CXL_BASE is not set -# CONFIG_CXL_AFU_DRIVER_OPS is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=m -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=m -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_MQ_DEFAULT is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=m -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_DH is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -# CONFIG_ATA is not set -# CONFIG_MD is not set -# CONFIG_TARGET_CORE is not set -CONFIG_NETDEVICES=y -CONFIG_MII=y -# CONFIG_NET_CORE is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_ETHERNET is not set -CONFIG_PHYLIB=y -CONFIG_SWPHY=y - -# -# MDIO bus device drivers -# -# CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MDIO_HISI_FEMAC is not set - -# -# MII PHY device drivers -# -# CONFIG_AMD_PHY is not set -# CONFIG_AQUANTIA_PHY is not set -# CONFIG_AT803X_PHY is not set -# CONFIG_BCM7XXX_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -CONFIG_FIXED_PHY=y -# CONFIG_ICPLUS_PHY is not set -# CONFIG_INTEL_XWAY_PHY is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_MICROCHIP_PHY is not set -# CONFIG_MICROSEMI_PHY is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_STE10XP is not set -# CONFIG_TERANETICS_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_XILINX_GMII2RGMII is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set -# CONFIG_USB_NET_DRIVERS is not set -CONFIG_WLAN=y -CONFIG_WLAN_VENDOR_ADMTEK=y -CONFIG_WLAN_VENDOR_ATH=y -# CONFIG_ATH_DEBUG is not set -# CONFIG_ATH6KL is not set -CONFIG_WLAN_VENDOR_ATMEL=y -CONFIG_WLAN_VENDOR_BROADCOM=y -# CONFIG_BRCMFMAC is not set -CONFIG_WLAN_VENDOR_CISCO=y -CONFIG_WLAN_VENDOR_INTEL=y -CONFIG_WLAN_VENDOR_INTERSIL=y -# CONFIG_HOSTAP is not set -CONFIG_WLAN_VENDOR_MARVELL=y -# CONFIG_LIBERTAS is not set -# CONFIG_MWIFIEX is not set -CONFIG_WLAN_VENDOR_MEDIATEK=y -CONFIG_WLAN_VENDOR_RALINK=y -CONFIG_WLAN_VENDOR_REALTEK=y -CONFIG_WLAN_VENDOR_RSI=y -CONFIG_WLAN_VENDOR_ST=y -CONFIG_WLAN_VENDOR_TI=y -CONFIG_WLAN_VENDOR_ZYDAS=y -# CONFIG_USB_ZD1201 is not set -# CONFIG_USB_NET_RNDIS_WLAN is not set - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_ISDN is not set -# CONFIG_NVM is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVMEM=y -# CONFIG_DEVKMEM is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_BCM63XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -# CONFIG_SERIAL_ST_ASC is not set -# CONFIG_SERIAL_STM32 is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_HVC_DCC is not set -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -# CONFIG_XILLYBUS is not set - -# -# I2C support -# -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -# CONFIG_I2C_COMPAT is not set -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_SMBUS is not set - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_RK3X is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_AXI_SPI_ENGINE is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_CADENCE is not set -# CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_ROCKCHIP is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -# CONFIG_SPI_ZYNQMP_GQSPI is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_LOOPBACK_TEST is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_GPIOLIB=y -CONFIG_OF_GPIO=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers -# -# CONFIG_GPIO_74XX_MMIO is not set -# CONFIG_GPIO_ALTERA is not set -# CONFIG_GPIO_DWAPB is not set -# CONFIG_GPIO_EM is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_GRGPIO is not set -# CONFIG_GPIO_MOCKUP is not set -# CONFIG_GPIO_MPC8XXX is not set -# CONFIG_GPIO_XILINX is not set -# CONFIG_GPIO_ZEVIO is not set -# CONFIG_GPIO_ZX is not set - -# -# I2C GPIO expanders -# -# CONFIG_GPIO_ADP5588 is not set -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_SX150X is not set -# CONFIG_GPIO_TPIC2810 is not set -# CONFIG_GPIO_TS4900 is not set - -# -# MFD GPIO expanders -# -# CONFIG_HTC_EGPIO is not set - -# -# SPI GPIO expanders -# -# CONFIG_GPIO_74X164 is not set -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_PISOSR is not set - -# -# SPI or I2C GPIO expanders -# -# CONFIG_GPIO_MCP23S08 is not set - -# -# USB GPIO expanders -# -# CONFIG_W1 is not set -# CONFIG_POWER_AVS is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=y -CONFIG_WATCHDOG_NOWAYOUT=y -# CONFIG_WATCHDOG_SYSFS is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_GPIO_WATCHDOG is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_MEN_A21_WDT is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set - -# -# Watchdog Pretimeout Governors -# -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_AS3722 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_MFD_ASIC3 is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_EXYNOS_LPASS is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_INTEL_SOC_PMIC is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77620 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_PM8921_CORE is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RTSX_USB is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_RK808 is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_T7L66XB is not set -# CONFIG_MFD_TC6387XB is not set -# CONFIG_MFD_TC6393XB is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_REGULATOR is not set -# CONFIG_MEDIA_SUPPORT is not set - -# -# Graphics support -# -# CONFIG_DRM is not set - -# -# ACP (Audio CoProcessor) Configuration -# - -# -# Frame buffer Devices -# -CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_CMDLINE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FB_DDC is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_VGASTATE is not set -# CONFIG_LOGO is not set -# CONFIG_SOUND is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_MP_USB_MSTAR=y -CONFIG_USB_COMMON=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -# -# Miscellaneous USB options -# -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -# CONFIG_USB_EHCI_SUSPEND_PORT is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_FOTG210_HCD is not set -# CONFIG_USB_MAX3421_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_TEST_MODE is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -# CONFIG_USB_STORAGE is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set - -# -# USB Physical Layer drivers -# -# CONFIG_USB_PHY is not set -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_ULPI is not set -# CONFIG_USB_GADGET is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_UWB is not set -CONFIG_MMC=y -CONFIG_SS_FAST_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_PWRSEQ_EMMC=y -CONFIG_PWRSEQ_SIMPLE=y - -# -# MMC/SD/SDIO Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=8 -CONFIG_MMC_BLOCK_BOUNCE=y -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set - -# -# MMC/SD/SDIO Host Controller Drivers -# -# CONFIG_MMC_SDHCI is not set -# CONFIG_MMC_SPI is not set -# CONFIG_MMC_DW is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_MTK is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV8803 is not set - -# -# SPI RTC drivers -# -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1302 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6916 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RX6110 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_MCP795 is not set -CONFIG_RTC_I2C_AND_SPI=y - -# -# SPI and I2C RTC drivers -# -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_BQ4802 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set - -# -# on-CPU RTC drivers -# -# CONFIG_RTC_DRV_SNVS is not set - -# -# HID Sensor RTC drivers -# -# CONFIG_DMADEVICES is not set - -# -# DMABUF options -# -# CONFIG_SYNC_FILE is not set -# CONFIG_AUXDISPLAY is not set -CONFIG_UIO=y -CONFIG_UIO_PDRV_GENIRQ=y -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_PRUSS is not set -# CONFIG_VIRT_DRIVERS is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -CONFIG_STAGING=y -# CONFIG_PRISM2_USB is not set -# CONFIG_COMEDI is not set -# CONFIG_RTLLIB is not set -# CONFIG_R8712U is not set -# CONFIG_R8188EU is not set - -# -# Speakup console speech -# -# CONFIG_STAGING_MEDIA is not set - -# -# Android -# -# CONFIG_ASHMEM is not set -# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set -# CONFIG_ION is not set -# CONFIG_STAGING_BOARD is not set -# CONFIG_LTE_GDM724X is not set -# CONFIG_MTD_SPINAND_MT29F is not set -# CONFIG_LNET is not set -# CONFIG_GS_FPGABOOT is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_FB_TFT is not set -# CONFIG_WILC1000_SDIO is not set -# CONFIG_WILC1000_SPI is not set -# CONFIG_MOST is not set -# CONFIG_KS7010 is not set -# CONFIG_GREYBUS is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y - -# -# Common Clock Framework -# -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_CLK_QORIQ is not set -# CONFIG_COMMON_CLK_NXP is not set -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_COMMON_CLK_PXA is not set -# CONFIG_COMMON_CLK_PIC32 is not set - -# -# Hardware Spinlock drivers -# - -# -# Clock Source drivers -# -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -# CONFIG_ARM_TIMER_SP804 is not set -# CONFIG_ATMEL_PIT is not set -# CONFIG_SH_TIMER_CMT is not set -# CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SH_TIMER_TMU is not set -# CONFIG_EM_TIMER_STI is not set -# CONFIG_MAILBOX is not set -# CONFIG_IOMMU_SUPPORT is not set - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# - -# -# SOC (System On Chip) specific Drivers -# - -# -# Broadcom SoC drivers -# -# CONFIG_SOC_BRCMSTB is not set -# CONFIG_SUNXI_SRAM is not set -# CONFIG_SOC_TI is not set -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -CONFIG_PWM=y -CONFIG_PWM_SYSFS=y -# CONFIG_PWM_FSL_FTM is not set -# CONFIG_PWM_PCA9685 is not set -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_MAX_NR=1 -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_FMC is not set - -# -# PHY Subsystem -# -# CONFIG_GENERIC_PHY is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_BCM_KONA_USB2_PHY is not set -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# -# Performance monitor support -# -CONFIG_ARM_PMU=y -# CONFIG_RAS is not set - -# -# Android -# -CONFIG_ANDROID=y -# CONFIG_ANDROID_BINDER_IPC is not set -CONFIG_NVMEM=y -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set - -# -# FPGA Configuration Support -# -# CONFIG_FPGA is not set -CONFIG_MSTAR_DRIVERS=y -# CONFIG_CAM_DRIVERS is not set -# CONFIG_DLA_DRIVER is not set -# CONFIG_MS_PIU_TIMER is not set -CONFIG_MS_MSYS=y -CONFIG_MS_ZEN=y -# CONFIG_MS_MSYS_LOG is not set -# CONFIG_MSYS_PERF_TEST is not set -# CONFIG_MSYS_BENCH_MEMORY_FUNC is not set -# CONFIG_MSYS_MIU_PROTECT is not set -# CONFIG_MSYS_DMEM_SYSFS_ALL is not set -CONFIG_MS_SERIAL=y -# CONFIG_MS_USCLK is not set -CONFIG_MS_FLASH_ISP=y -CONFIG_MS_FLASH_ISP_MXP_PARTS=y -CONFIG_MS_PWM=y -CONFIG_MS_SPINAND=y -# CONFIG_NAND_SINGLE_READ is not set -# CONFIG_NAND_DUAL_READ is not set -# CONFIG_NAND_QUAL_READ is not set -CONFIG_AUTO_DETECT=y -# CONFIG_NAND_QUAL_WRITE is not set -CONFIG_AUTO_DETECT_WRITE=y -CONFIG_MS_SPI_INFINITY=y -# CONFIG_CAM_CLK is not set -# CONFIG_MS_EMMC is not set -CONFIG_MS_SDMMC=y -CONFIG_MS_EMAC=y -# CONFIG_EMAC_SUPPLY_RNG is not set -# CONFIG_MSTAR_HW_TX_CHECKSUM is not set -# CONFIG_K3_RX_SWPATCH is not set -CONFIG_DISCONNECT_DELAY_S=1 -# CONFIG_MSTAR_EEE is not set -# CONFIG_EMAC_PHY_RESTART_AN is not set -# CONFIG_MS_IRCUT is not set -CONFIG_MS_RTC=y -# CONFIG_RTC_INNER is not set -CONFIG_RTCPWC_INNER=y -# CONFIG_RTCPWC_SW_RST_OFF is not set -# CONFIG_RTCPWC_INNER_EHHE is not set -CONFIG_MS_CRYPTO=y -# CONFIG_SS_AESDMA_INTR is not set -# CONFIG_SS_RNG is not set -CONFIG_CRYPTODEV=y -CONFIG_MS_CPU_FREQ=y -CONFIG_MS_IVE=y -CONFIG_MS_NOTIFY=m -CONFIG_SS_ISP_ISRCB=y -CONFIG_MSTAR_MIU=y -CONFIG_SSC007A_S01A=y -CONFIG_MS_BDMA=y -# CONFIG_MS_BDMA_LINE_OFFSET_ON is not set -CONFIG_MS_MOVE_DMA=y -# CONFIG_MS_IR is not set -CONFIG_MS_I2C=y -# CONFIG_MS_I2C_INT_ISR is not set -CONFIG_MS_GPIO=y -CONFIG_MS_SW_I2C=y -CONFIG_MS_PADMUX=y -CONFIG_MS_WATCHDOG=y -CONFIG_MS_SAR=y -# CONFIG_MS_SARKEY is not set -CONFIG_MSTAR_MMAHEAP=y -CONFIG_SSTAR_NETPHY=y -CONFIG_SS_VOLTAGE_CTRL=y -# CONFIG_SS_SWTOE is not set -# CONFIG_MS_EMAC_TOE is not set - -# -# Firmware Drivers -# -# CONFIG_FIRMWARE_MEMMAP is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_HAVE_ARM_SMCCC=y - -# -# File systems -# -CONFIG_DCACHE_WORD_ACCESS=y -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -# CONFIG_EXT4_FS is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_F2FS_FS is not set -CONFIG_FS_POSIX_ACL=y -# CONFIG_EXPORTFS_BLOCK_OPS is not set -CONFIG_FILE_LOCKING=y -CONFIG_MANDATORY_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set -# CONFIG_OVERLAY_FS is not set - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_CHILDREN is not set -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_CONFIGFS_FS=y -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -CONFIG_JFFS2_COMPRESSION_OPTIONS=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JFFS2_LZO=y -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -# CONFIG_JFFS2_CMODE_NONE is not set -CONFIG_JFFS2_CMODE_PRIORITY=y -# CONFIG_JFFS2_CMODE_SIZE is not set -# CONFIG_JFFS2_CMODE_FAVOURLZO is not set -CONFIG_UBIFS_FS=y -CONFIG_UBIFS_FS_ADVANCED_COMPR=y -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_ATIME_SUPPORT is not set -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=y -# CONFIG_SQUASHFS_FILE_CACHE is not set -CONFIG_SQUASHFS_FILE_DIRECT=y -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y -CONFIG_SQUASHFS_EMBEDDED=y -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V2=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -# CONFIG_NFS_SWAP is not set -# CONFIG_NFS_V4_1 is not set -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -# CONFIG_NFSD is not set -CONFIG_GRACE_PERIOD=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -# CONFIG_SUNRPC_DEBUG is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=m -# CONFIG_DLM is not set - -# -# Kernel hacking -# - -# -# printk and dmesg options -# -# CONFIG_PRINTK_TIME is not set -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3 -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_DYNAMIC_DEBUG is not set - -# -# Compile-time checks and compiler options -# -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_GDB_SCRIPTS is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=4096 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_PAGE_OWNER is not set -CONFIG_DEBUG_FS=y -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y - -# -# Memory Debugging -# -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SLUB_STATS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_SHIRQ is not set - -# -# Debug Lockups and Hangs -# -CONFIG_LOCKUP_DETECTOR=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHED_INFO is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -# CONFIG_DEBUG_TIMEKEEPING is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_PREEMPT is not set - -# -# Lock Debugging (spinlocks, mutexes, etc...) -# -CONFIG_DEBUG_RT_MUTEXES=y -CONFIG_DEBUG_SPINLOCK=y -CONFIG_DEBUG_MUTEXES=y -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PI_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set - -# -# RCU Debugging -# -# CONFIG_PROVE_RCU is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_TORTURE_TEST is not set -# CONFIG_RCU_PERF_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_LATENCYTOP is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set - -# -# Runtime Testing -# -# CONFIG_LKDTM is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_BITMAP is not set -# CONFIG_TEST_UUID is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_HASH is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_USER_COPY is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_MEMTEST is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set -# CONFIG_UBSAN is not set -CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y -# CONFIG_STRICT_DEVMEM is not set -# CONFIG_ARM_PTDUMP is not set -CONFIG_ARM_UNWIND=y -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_LL is not set -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -# CONFIG_DEBUG_UART_8250 is not set -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_DEBUG_SET_MODULE_RONX is not set -# CONFIG_CORESIGHT is not set - -# -# Security options -# -CONFIG_KEYS=y -# CONFIG_PERSISTENT_KEYRINGS is not set -# CONFIG_BIG_KEYS is not set -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_KEY_DH_OPERATIONS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y -CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y -# CONFIG_HARDENED_USERCOPY is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_KPP2=y -# CONFIG_CRYPTO_RSA is not set -# CONFIG_CRYPTO_DH is not set -# CONFIG_CRYPTO_ECDH is not set -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_GF128MUL is not set -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_MCRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set -# CONFIG_CRYPTO_KEYWRAP is not set - -# -# Hash modes -# -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_CRC32 is not set -# CONFIG_CRYPTO_CRCT10DIF is not set -# CONFIG_CRYPTO_GHASH is not set -# CONFIG_CRYPTO_POLY1305 is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_SHA1 is not set -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_SHA3 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_CHACHA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -# CONFIG_CRYPTO_DRBG_HASH is not set -# CONFIG_CRYPTO_DRBG_CTR is not set -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -# CONFIG_CRYPTO_USER_API_RNG is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -# CONFIG_CRYPTO_HW is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set - -# -# Certificates for signature checking -# -# CONFIG_ARM_CRYPTO is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_RATIONAL=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_IA64 is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -# CONFIG_XZ_DEC_SPARC is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_ASSOCIATIVE_ARRAY=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DQL=y -CONFIG_NLATTR=y -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set -# CONFIG_IRQ_POLL is not set -CONFIG_LIBFDT=y -CONFIG_OID_REGISTRY=y -# CONFIG_SG_SPLIT is not set -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_SBITMAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.tiandy b/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.tiandy deleted file mode 100644 index 247a06b1..00000000 --- a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335.generic.config.tiandy +++ /dev/null @@ -1,2652 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/arm 4.9.84 Kernel Configuration -# -CONFIG_ARM=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_GENERIC_BUG=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_EXTABLE_SORT=y - -# -# General setup -# -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -# CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_LZ4=y -# CONFIG_KERNEL_GZIP is not set -# CONFIG_KERNEL_LZMA is not set -CONFIG_KERNEL_XZ=y -# CONFIG_KERNEL_LZO is not set -# CONFIG_KERNEL_LZ4 is not set -CONFIG_DEFAULT_HOSTNAME="ipcam" -# CONFIG_SWAP is not set -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_CROSS_MEMORY_ATTACH is not set -# CONFIG_FHANDLE is not set -# CONFIG_USELIB is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_HANDLE_DOMAIN_IRQ=y -# CONFIG_IRQ_DOMAIN_DEBUG is not set -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y - -# -# Timers subsystem -# -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_PREEMPT_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_SRCU=y -# CONFIG_TASKS_RCU is not set -CONFIG_RCU_STALL_COMMON=y -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_EXPEDITE_BOOT is not set -# CONFIG_BUILD_BIN2C is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_NMI_LOG_BUF_SHIFT=13 -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_CGROUPS=y -# CONFIG_MEMCG is not set -# CONFIG_BLK_CGROUP is not set -# CONFIG_CGROUP_SCHED is not set -# CONFIG_CGROUP_PIDS is not set -# CONFIG_CGROUP_FREEZER is not set -# CONFIG_CPUSETS is not set -# CONFIG_CGROUP_DEVICE is not set -# CONFIG_CGROUP_CPUACCT is not set -# CONFIG_CGROUP_PERF is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CHECKPOINT_RESTORE is not set -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_IPC_NS=y -# CONFIG_USER_NS is not set -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_RD_GZIP is not set -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -# CONFIG_RD_LZ4 is not set -# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_HAVE_UID16=y -CONFIG_BPF=y -CONFIG_EXPERT=y -CONFIG_UID16=y -CONFIG_MULTIUSER=y -# CONFIG_SGETMASK_SYSCALL is not set -CONFIG_SYSFS_SYSCALL=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y -# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set -CONFIG_KALLSYMS_BASE_RELATIVE=y -CONFIG_PRINTK=y -CONFIG_PRINTK_NMI=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_BASE_FULL is not set -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_SHMEM=y -CONFIG_AIO=y -# CONFIG_ADVISE_SYSCALLS is not set -# CONFIG_USERFAULTFD is not set -CONFIG_MEMBARRIER=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_SLUB_DEBUG is not set -CONFIG_COMPAT_BRK=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SYSTEM_DATA_VERIFICATION is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -# CONFIG_UPROBES is not set -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_NMI=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_GCC_PLUGINS=y -# CONFIG_GCC_PLUGINS is not set -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_CC_STACKPROTECTOR=y -# CONFIG_CC_STACKPROTECTOR_NONE is not set -CONFIG_CC_STACKPROTECTOR_REGULAR=y -# CONFIG_CC_STACKPROTECTOR_STRONG is not set -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_HAVE_EXIT_THREAD=y -CONFIG_ARCH_MMAP_RND_BITS_MIN=8 -CONFIG_ARCH_MMAP_RND_BITS_MAX=16 -CONFIG_ARCH_MMAP_RND_BITS=8 -# CONFIG_HAVE_ARCH_HASH is not set -# CONFIG_ISA_BUS_API is not set -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OLD_SIGACTION=y -# CONFIG_CPU_NO_EFFICIENT_FFS is not set -# CONFIG_HAVE_ARCH_VMAP_STACK is not set - -# -# GCOV-based kernel profiling -# -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=1 -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_MODULE_SIG is not set -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -# CONFIG_LBDAF is not set -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set -# CONFIG_BLK_CMDLINE_PARSER is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_EFI_PARTITION=y - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_DEADLINE=y -# CONFIG_IOSCHED_CFQ is not set -CONFIG_DEFAULT_DEADLINE=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="deadline" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -# CONFIG_FREEZER is not set - -# -# System Type -# -CONFIG_MMU=y -# CONFIG_ARCH_INFINITY2 is not set -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_GEMINI is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_KS8695 is not set -# CONFIG_ARCH_W90X900 is not set -# CONFIG_ARCH_LPC32XX is not set -# CONFIG_ARCH_PXA is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_S3C24XX is not set -# CONFIG_ARCH_DAVINCI is not set -# CONFIG_ARCH_OMAP1 is not set - -# -# Multiple platform selection -# - -# -# CPU Core family selection -# -# CONFIG_ARCH_MULTI_V6 is not set -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_MULTI_V6_V7=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -# CONFIG_ARCH_VIRT is not set -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_ARTPEC is not set -# CONFIG_ARCH_AT91 is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_BERLIN is not set -# CONFIG_ARCH_DIGICOLOR is not set -# CONFIG_ARCH_HIGHBANK is not set -# CONFIG_ARCH_HISI is not set -# CONFIG_ARCH_KEYSTONE is not set -# CONFIG_ARCH_MESON is not set -CONFIG_ARCH_SSTAR=y -# CONFIG_SS_DUALOS is not set - -# -# Options -# -CONFIG_SS_DTB_NAME="infinity6b0-ssc009a-s01a-qfn88-tiandy" -CONFIG_SS_BUILTIN_DTB=y -CONFIG_MS_KERNEL_TYPE="" -CONFIG_SSTAR_CHIP_NAME="infinity6b0" -CONFIG_SSTAR_SHORT_NAME="I6B0" -# CONFIG_MP_IRQ_TRACE is not set -CONFIG_SKIP_SQUASHFS_BAD_BLOCK=y - -# -# Fast boot -# -# CONFIG_SS_BUILTIN_UNFDT is not set -# CONFIG_FB_DTS_SKIP_CRC is not set -# CONFIG_FB_DTS_SCAN_MEMORY_ONCE is not set -# CONFIG_FB_DTS_SKIP_ATAGS_TO_FDT is not set -CONFIG_DISABLE_CLK_DEBUGFS_SUPPORT=y -CONFIG_DEFERRED_INIICALLS=y -# CONFIG_DEFERRED_INIICALLS_SLAB_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PARAM_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PPERF_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_MORE_SYSFS is not set -# CONFIG_DEFERRED_CREATE_DTS_SYSNODE is not set -# CONFIG_CRYPTO_MANAGER_NO_TESTS_THREAD is not set -CONFIG_ARCH_INFINITY6B0=y -CONFIG_SS_PROFILING_TIME=y -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_MEDIATEK is not set - -# -# TI OMAP/AM/DM/DRA Family -# -# CONFIG_ARCH_OMAP3 is not set -# CONFIG_ARCH_OMAP4 is not set -# CONFIG_SOC_OMAP5 is not set -# CONFIG_SOC_AM33XX is not set -# CONFIG_SOC_AM43XX is not set -# CONFIG_SOC_DRA7XX is not set -# CONFIG_ARCH_MMP is not set -# CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_ROCKCHIP is not set -# CONFIG_ARCH_SOCFPGA is not set -# CONFIG_PLAT_SPEAR is not set -# CONFIG_ARCH_STI is not set -# CONFIG_ARCH_S5PV210 is not set -# CONFIG_ARCH_EXYNOS is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_SIRF is not set -# CONFIG_ARCH_TANGO is not set -# CONFIG_ARCH_TEGRA is not set -# CONFIG_ARCH_UNIPHIER is not set -# CONFIG_ARCH_U8500 is not set -# CONFIG_ARCH_VEXPRESS is not set -# CONFIG_ARCH_WM8850 is not set -# CONFIG_ARCH_ZX is not set -# CONFIG_ARCH_ZYNQ is not set - -# -# Processor Type -# -CONFIG_CPU_V7=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_HAS_ASID=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y - -# -# Processor Features -# -# CONFIG_ARM_LPAE is not set -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_ARM_THUMB=y -CONFIG_ARM_THUMBEE=y -CONFIG_ARM_VIRT_EXT=y -# CONFIG_SWP_EMULATE is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_KUSER_HELPERS=y -CONFIG_VDSO=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -# CONFIG_CACHE_L2X0 is not set -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -# CONFIG_DEBUG_RODATA is not set -CONFIG_MULTI_IRQ_HANDLER=y -# CONFIG_ARM_ERRATA_430973 is not set -# CONFIG_ARM_ERRATA_720789 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_775420 is not set -# CONFIG_ARM_ERRATA_773022 is not set -# CONFIG_ARM_ERRATA_818325_852422 is not set -# CONFIG_ARM_ERRATA_821420 is not set -# CONFIG_ARM_ERRATA_825619 is not set -# CONFIG_ARM_ERRATA_852421 is not set -# CONFIG_ARM_ERRATA_852423 is not set - -# -# Bus support -# -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_PCCARD is not set - -# -# Kernel Features -# -CONFIG_HAVE_SMP=y -# CONFIG_SMP is not set -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_VMSPLIT_3G=y -# CONFIG_VMSPLIT_3G_OPT is not set -# CONFIG_VMSPLIT_2G is not set -# CONFIG_VMSPLIT_1G is not set -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_ARM_PSCI is not set -CONFIG_ARCH_NR_GPIO=0 -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -CONFIG_HZ_FIXED=0 -CONFIG_HZ_100=y -# CONFIG_HZ_200 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_500 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=100 -CONFIG_SCHED_HRTICK=y -CONFIG_THUMB2_KERNEL=y -CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11=y -CONFIG_ARM_ASM_UNIFIED=y -CONFIG_ARM_PATCH_IDIV=y -CONFIG_AEABI=y -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -CONFIG_HAVE_ARCH_PFN_VALID=y -# CONFIG_HIGHMEM is not set -CONFIG_CPU_SW_DOMAIN_PAN=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -# CONFIG_ARM_MODULE_PLTS is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_NO_BOOTMEM=y -CONFIG_MEMORY_ISOLATION=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_COMPACTION=y -CONFIG_MIGRATION=y -# CONFIG_PHYS_ADDR_T_64BIT is not set -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_CLEANCACHE is not set -CONFIG_CMA=y -CONFIG_CMA_DEBUG=y -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_AREAS=1 -# CONFIG_ZPOOL is not set -# CONFIG_ZBUD is not set -# CONFIG_ZSMALLOC is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_IDLE_PAGE_TRACKING is not set -CONFIG_FORCE_MAX_ZONEORDER=10 -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_UACCESS_WITH_MEMCPY is not set -# CONFIG_SECCOMP is not set -CONFIG_SWIOTLB=y -CONFIG_IOMMU_HELPER=y -# CONFIG_PARAVIRT is not set -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -# CONFIG_XEN is not set - -# -# Boot options -# -CONFIG_USE_OF=y -CONFIG_ATAGS=y -# CONFIG_DEPRECATED_PARAM_STRUCT is not set -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_CMDLINE="" -# CONFIG_KEXEC is not set -# CONFIG_CRASH_DUMP is not set -CONFIG_AUTO_ZRELADDR=y -# CONFIG_EFI is not set - -# -# CPU Power Management -# - -# -# CPU Frequency scaling -# -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_STAT_DETAILS=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set - -# -# CPU frequency scaling drivers -# -# CONFIG_CPUFREQ_DT is not set -# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set -# CONFIG_QORIQ_CPUFREQ is not set - -# -# CPU Idle -# -# CONFIG_CPU_IDLE is not set -# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set - -# -# Floating point emulation -# - -# -# At least one emulation must be selected -# -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_NEON=y -CONFIG_KERNEL_MODE_NEON=y - -# -# Userspace binary formats -# -CONFIG_BINFMT_ELF=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -# CONFIG_BINFMT_FLAT is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_COREDUMP=y - -# -# Power management options -# -# CONFIG_SUSPEND is not set -# CONFIG_PM is not set -# CONFIG_APM_EMULATION is not set -CONFIG_PM_OPP=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_CPU_SUSPEND is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -# CONFIG_XFRM_USER is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -# CONFIG_IP_FIB_TRIE_STATS is not set -# CONFIG_IP_MULTIPLE_TABLES is not set -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_IP_MROUTE is not set -CONFIG_SYN_COOKIES=y -# CONFIG_NET_UDP_TUNNEL is not set -# CONFIG_NET_FOU is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -# CONFIG_TCP_CONG_BIC is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_CDG is not set -# CONFIG_TCP_CONG_BBR is not set -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NET_PTP_CLASSIFY is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_BRIDGE=y -CONFIG_HAVE_NET_DSA=y -# CONFIG_NET_DSA is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_MPLS is not set -# CONFIG_HSR is not set -# CONFIG_NET_SWITCHDEV is not set -# CONFIG_NET_L3_MASTER_DEV is not set -# CONFIG_NET_NCSI is not set -# CONFIG_SOCK_CGROUP_DATA is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CGROUP_NET_CLASSID is not set -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_JIT is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -# CONFIG_STREAM_PARSER is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=m -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -# CONFIG_CFG80211_INTERNAL_REGDB is not set -CONFIG_CFG80211_CRDA_SUPPORT=y -CONFIG_CFG80211_WEXT=y -# CONFIG_LIB80211 is not set -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_MINSTREL_HT=y -# CONFIG_MAC80211_RC_MINSTREL_VHT is not set -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -CONFIG_MAC80211_MESH=y -# CONFIG_MAC80211_DEBUGFS is not set -# CONFIG_MAC80211_MESSAGE_TRACING is not set -# CONFIG_MAC80211_DEBUG_MENU is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_WIMAX is not set -CONFIG_RFKILL=y -CONFIG_RFKILL_GPIO=y -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set -# CONFIG_LWTUNNEL is not set -# CONFIG_DST_CACHE is not set -# CONFIG_NET_DEVLINK is not set -CONFIG_MAY_USE_DEVLINK=y -CONFIG_HAVE_CBPF_JIT=y - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_STANDALONE is not set -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -# CONFIG_FW_LOADER is not set -# CONFIG_ALLOW_DEV_COREDUMP is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_SPI=y -# CONFIG_DMA_SHARED_BUFFER is not set -CONFIG_DMA_CMA=y - -# -# Default contiguous memory area size: -# -CONFIG_CMA_SIZE_MBYTES=2 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=4 - -# -# Bus devices -# -# CONFIG_ARM_CCI400_PMU is not set -# CONFIG_ARM_CCI5xx_PMU is not set -# CONFIG_ARM_CCN is not set -# CONFIG_BRCMSTB_GISB_ARB is not set -# CONFIG_VEXPRESS_CONFIG is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -CONFIG_MTD_TESTS=m -# CONFIG_MTD_SS_TESTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_AFS_PARTS is not set -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_PARTITIONED_MASTER is not set - -# -# RAM/ROM/Flash chip drivers -# -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_RAM=y -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP_OF=y -CONFIG_MTD_PLATRAM=y - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_SST25L is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOCG3 is not set -CONFIG_MTD_NAND_ECC=m -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND=m -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_NAND_DENALI_DT is not set -# CONFIG_MTD_NAND_GPIO is not set -# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set -CONFIG_MTD_NAND_IDS=m -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_BRCMNAND is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_NAND_HISI504 is not set -# CONFIG_MTD_NAND_MTK is not set -# CONFIG_MTD_ONENAND is not set - -# -# LPDDR & LPDDR2 PCM memory drivers -# -# CONFIG_MTD_LPDDR is not set -# CONFIG_MTD_LPDDR2_NVM is not set -CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_MT81xx_NOR is not set -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -# CONFIG_SPI_CADENCE_QUADSPI is not set -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_MTD_UBI_BLOCK is not set -CONFIG_DTC=y -CONFIG_OF=y -# CONFIG_OF_UNITTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_NET=y -CONFIG_OF_MDIO=y -CONFIG_OF_RESERVED_MEM=y -# CONFIG_OF_OVERLAY is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=65536 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_MG_DISK is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_NVME_TARGET is not set - -# -# Misc devices -# -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -CONFIG_EEPROM_AT24=m -# CONFIG_EEPROM_AT25 is not set -CONFIG_EEPROM_LEGACY=m -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_TI_ST is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set - -# -# Intel MIC Bus Driver -# - -# -# SCIF Bus Driver -# - -# -# VOP Bus Driver -# - -# -# Intel MIC Host Driver -# - -# -# Intel MIC Card Driver -# - -# -# SCIF Driver -# - -# -# Intel MIC Coprocessor State Management (COSM) Drivers -# - -# -# VOP Driver -# -# CONFIG_ECHO is not set -# CONFIG_CXL_BASE is not set -# CONFIG_CXL_AFU_DRIVER_OPS is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_MQ_DEFAULT is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_DH is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -# CONFIG_ATA is not set -# CONFIG_MD is not set -# CONFIG_TARGET_CORE is not set -CONFIG_NETDEVICES=y -CONFIG_MII=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -# CONFIG_DUMMY is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_VXLAN is not set -# CONFIG_MACSEC is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -CONFIG_TUN=m -# CONFIG_TUN_VNET_CROSS_LE is not set -# CONFIG_VETH is not set -# CONFIG_NLMON is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_ETHERNET is not set -CONFIG_PHYLIB=y -CONFIG_SWPHY=y - -# -# MDIO bus device drivers -# -# CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MDIO_HISI_FEMAC is not set - -# -# MII PHY device drivers -# -# CONFIG_AMD_PHY is not set -# CONFIG_AQUANTIA_PHY is not set -# CONFIG_AT803X_PHY is not set -# CONFIG_BCM7XXX_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -CONFIG_FIXED_PHY=y -# CONFIG_ICPLUS_PHY is not set -# CONFIG_INTEL_XWAY_PHY is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_MICROCHIP_PHY is not set -# CONFIG_MICROSEMI_PHY is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_STE10XP is not set -# CONFIG_TERANETICS_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_XILINX_GMII2RGMII is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -# -# Host-side USB support is needed for USB Network Adapter support -# -CONFIG_USB_NET_DRIVERS=m -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_RTL8152 is not set -# CONFIG_USB_LAN78XX is not set -CONFIG_USB_USBNET=m -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_AX88179_178A=m -CONFIG_USB_NET_CDCETHER=m -# CONFIG_USB_NET_CDC_EEM is not set -CONFIG_USB_NET_CDC_NCM=m -# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SR9700 is not set -# CONFIG_USB_NET_SR9800 is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_GL620A is not set -CONFIG_USB_NET_NET1080=m -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -CONFIG_USB_NET_RNDIS_HOST=m -CONFIG_USB_NET_CDC_SUBSET_ENABLE=m -CONFIG_USB_NET_CDC_SUBSET=m -# CONFIG_USB_ALI_M5632 is not set -# CONFIG_USB_AN2720 is not set -# CONFIG_USB_BELKIN is not set -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_EPSON2888 is not set -# CONFIG_USB_KC2190 is not set -CONFIG_USB_NET_ZAURUS=m -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_QMI_WWAN is not set -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_VL600 is not set -# CONFIG_USB_NET_CH9200 is not set -CONFIG_WLAN=y -# CONFIG_WLAN_VENDOR_ADMTEK is not set -# CONFIG_WLAN_VENDOR_ATH is not set -# CONFIG_WLAN_VENDOR_ATMEL is not set -# CONFIG_WLAN_VENDOR_BROADCOM is not set -# CONFIG_WLAN_VENDOR_CISCO is not set -# CONFIG_WLAN_VENDOR_INTEL is not set -# CONFIG_WLAN_VENDOR_INTERSIL is not set -# CONFIG_WLAN_VENDOR_MARVELL is not set -CONFIG_WLAN_VENDOR_MEDIATEK=y -# CONFIG_MT7601U is not set -CONFIG_WLAN_VENDOR_RALINK=y -# CONFIG_RT2X00 is not set -CONFIG_WLAN_VENDOR_REALTEK=y -# CONFIG_RTL8187 is not set -# CONFIG_RTL_CARDS is not set -# CONFIG_RTL8XXXU is not set -# CONFIG_WLAN_VENDOR_RSI is not set -# CONFIG_WLAN_VENDOR_ST is not set -# CONFIG_WLAN_VENDOR_TI is not set -# CONFIG_WLAN_VENDOR_ZYDAS is not set -# CONFIG_MAC80211_HWSIM is not set -CONFIG_USB_NET_RNDIS_WLAN=m - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_ISDN is not set -# CONFIG_NVM is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVMEM=y -# CONFIG_DEVKMEM is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_BCM63XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -# CONFIG_SERIAL_ST_ASC is not set -# CONFIG_SERIAL_STM32 is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_HVC_DCC is not set -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -# CONFIG_XILLYBUS is not set - -# -# I2C support -# -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -# CONFIG_I2C_COMPAT is not set -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_SMBUS is not set - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_RK3X is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -CONFIG_I2C_TINY_USB=m - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_AXI_SPI_ENGINE is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_CADENCE is not set -# CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_ROCKCHIP is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -# CONFIG_SPI_ZYNQMP_GQSPI is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_LOOPBACK_TEST is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_GPIOLIB=y -CONFIG_OF_GPIO=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers -# -# CONFIG_GPIO_74XX_MMIO is not set -# CONFIG_GPIO_ALTERA is not set -# CONFIG_GPIO_DWAPB is not set -# CONFIG_GPIO_EM is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_GRGPIO is not set -# CONFIG_GPIO_MOCKUP is not set -# CONFIG_GPIO_MPC8XXX is not set -# CONFIG_GPIO_XILINX is not set -# CONFIG_GPIO_ZEVIO is not set -# CONFIG_GPIO_ZX is not set - -# -# I2C GPIO expanders -# -# CONFIG_GPIO_ADP5588 is not set -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_SX150X is not set -# CONFIG_GPIO_TPIC2810 is not set -# CONFIG_GPIO_TS4900 is not set - -# -# MFD GPIO expanders -# -# CONFIG_HTC_EGPIO is not set - -# -# SPI GPIO expanders -# -# CONFIG_GPIO_74X164 is not set -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_PISOSR is not set - -# -# SPI or I2C GPIO expanders -# -# CONFIG_GPIO_MCP23S08 is not set - -# -# USB GPIO expanders -# -# CONFIG_W1 is not set -# CONFIG_POWER_AVS is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WATCHDOG_NOWAYOUT is not set -# CONFIG_WATCHDOG_SYSFS is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_GPIO_WATCHDOG is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_MEN_A21_WDT is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set - -# -# Watchdog Pretimeout Governors -# -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_AS3722 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_MFD_ASIC3 is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_EXYNOS_LPASS is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_INTEL_SOC_PMIC is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77620 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_PM8921_CORE is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RTSX_USB is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_RK808 is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_T7L66XB is not set -# CONFIG_MFD_TC6387XB is not set -# CONFIG_MFD_TC6393XB is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_REGULATOR is not set -# CONFIG_MEDIA_SUPPORT is not set - -# -# Graphics support -# -# CONFIG_DRM is not set - -# -# ACP (Audio CoProcessor) Configuration -# - -# -# Frame buffer Devices -# -CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_CMDLINE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FB_DDC is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_VGASTATE is not set -# CONFIG_LOGO is not set -# CONFIG_SOUND is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_MP_USB_MSTAR=y -CONFIG_USB_COMMON=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -# -# Miscellaneous USB options -# -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -# CONFIG_USB_EHCI_SUSPEND_PORT is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_FOTG210_HCD is not set -# CONFIG_USB_MAX3421_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_TEST_MODE is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -# CONFIG_USB_UAS is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set - -# -# USB Physical Layer drivers -# -# CONFIG_USB_PHY is not set -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_ULPI is not set -# CONFIG_USB_GADGET is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_UWB is not set -CONFIG_MMC=y -CONFIG_SS_FAST_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_PWRSEQ_EMMC=y -CONFIG_PWRSEQ_SIMPLE=y - -# -# MMC/SD/SDIO Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=8 -CONFIG_MMC_BLOCK_BOUNCE=y -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set - -# -# MMC/SD/SDIO Host Controller Drivers -# -# CONFIG_MMC_SDHCI is not set -# CONFIG_MMC_SPI is not set -# CONFIG_MMC_DW is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_MTK is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -CONFIG_RTC_DRV_HYM8563=y -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV8803 is not set - -# -# SPI RTC drivers -# -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1302 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6916 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RX6110 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_MCP795 is not set -CONFIG_RTC_I2C_AND_SPI=y - -# -# SPI and I2C RTC drivers -# -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_BQ4802 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set - -# -# on-CPU RTC drivers -# -# CONFIG_RTC_DRV_SNVS is not set - -# -# HID Sensor RTC drivers -# -# CONFIG_DMADEVICES is not set - -# -# DMABUF options -# -# CONFIG_SYNC_FILE is not set -# CONFIG_AUXDISPLAY is not set -CONFIG_UIO=y -CONFIG_UIO_PDRV_GENIRQ=y -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_PRUSS is not set -# CONFIG_VIRT_DRIVERS is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -CONFIG_STAGING=y -# CONFIG_PRISM2_USB is not set -# CONFIG_COMEDI is not set -# CONFIG_RTLLIB is not set -# CONFIG_R8712U is not set -# CONFIG_R8188EU is not set -# CONFIG_VT6656 is not set - -# -# Speakup console speech -# -# CONFIG_STAGING_MEDIA is not set - -# -# Android -# -# CONFIG_ASHMEM is not set -# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set -# CONFIG_ION is not set -# CONFIG_STAGING_BOARD is not set -# CONFIG_LTE_GDM724X is not set -# CONFIG_MTD_SPINAND_MT29F is not set -# CONFIG_LNET is not set -# CONFIG_GS_FPGABOOT is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_FB_TFT is not set -# CONFIG_WILC1000_SDIO is not set -# CONFIG_WILC1000_SPI is not set -# CONFIG_MOST is not set -# CONFIG_KS7010 is not set -# CONFIG_GREYBUS is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y - -# -# Common Clock Framework -# -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_CLK_QORIQ is not set -# CONFIG_COMMON_CLK_NXP is not set -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_COMMON_CLK_PXA is not set -# CONFIG_COMMON_CLK_PIC32 is not set - -# -# Hardware Spinlock drivers -# - -# -# Clock Source drivers -# -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -# CONFIG_ARM_TIMER_SP804 is not set -# CONFIG_ATMEL_PIT is not set -# CONFIG_SH_TIMER_CMT is not set -# CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SH_TIMER_TMU is not set -# CONFIG_EM_TIMER_STI is not set -# CONFIG_MAILBOX is not set -# CONFIG_IOMMU_SUPPORT is not set - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# - -# -# SOC (System On Chip) specific Drivers -# - -# -# Broadcom SoC drivers -# -# CONFIG_SOC_BRCMSTB is not set -# CONFIG_SUNXI_SRAM is not set -# CONFIG_SOC_TI is not set -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -CONFIG_PWM=y -CONFIG_PWM_SYSFS=y -# CONFIG_PWM_FSL_FTM is not set -# CONFIG_PWM_PCA9685 is not set -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_MAX_NR=1 -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_FMC is not set - -# -# PHY Subsystem -# -# CONFIG_GENERIC_PHY is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_BCM_KONA_USB2_PHY is not set -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# -# Performance monitor support -# -CONFIG_ARM_PMU=y -# CONFIG_RAS is not set - -# -# Android -# -CONFIG_ANDROID=y -# CONFIG_ANDROID_BINDER_IPC is not set -CONFIG_NVMEM=m -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set - -# -# FPGA Configuration Support -# -# CONFIG_FPGA is not set -CONFIG_MSTAR_DRIVERS=y -# CONFIG_CAM_DRIVERS is not set -# CONFIG_DLA_DRIVER is not set -# CONFIG_MS_PIU_TIMER is not set -CONFIG_MS_MSYS=y -CONFIG_MS_ZEN=y -# CONFIG_MS_MSYS_LOG is not set -# CONFIG_MSYS_PERF_TEST is not set -# CONFIG_MSYS_BENCH_MEMORY_FUNC is not set -# CONFIG_MSYS_MIU_PROTECT is not set -# CONFIG_MSYS_DMEM_SYSFS_ALL is not set -CONFIG_MS_SERIAL=y -# CONFIG_MS_USCLK is not set -CONFIG_MS_FLASH_ISP=y -CONFIG_MS_FLASH_ISP_MXP_PARTS=y -CONFIG_MS_PWM=y -# CONFIG_PWM_NEW is not set -CONFIG_MS_SPINAND=m -# CONFIG_NAND_SINGLE_READ is not set -# CONFIG_NAND_DUAL_READ is not set -# CONFIG_NAND_QUAL_READ is not set -CONFIG_AUTO_DETECT=y -# CONFIG_NAND_QUAL_WRITE is not set -CONFIG_AUTO_DETECT_WRITE=y -CONFIG_MS_SPI_INFINITY=y -# CONFIG_SS_MSPI is not set -# CONFIG_CAM_CLK is not set -# CONFIG_MS_EMMC is not set -CONFIG_MS_SDMMC=y -CONFIG_MS_EMAC=y -# CONFIG_EMAC_SUPPLY_RNG is not set -# CONFIG_MSTAR_HW_TX_CHECKSUM is not set -# CONFIG_K3_RX_SWPATCH is not set -CONFIG_DISCONNECT_DELAY_S=1 -# CONFIG_MSTAR_EEE is not set -# CONFIG_EMAC_PHY_RESTART_AN is not set -# CONFIG_MS_IRCUT is not set -CONFIG_MS_RTC=y -CONFIG_RTC_INNER=y -# CONFIG_RTCPWC_INNER is not set -CONFIG_MS_CRYPTO=y -# CONFIG_SS_AESDMA_INTR is not set -# CONFIG_SS_RNG is not set -CONFIG_CRYPTODEV=m -CONFIG_MS_CPU_FREQ=y -CONFIG_MS_IVE=y -CONFIG_MS_NOTIFY=m -CONFIG_SS_ISP_ISRCB=y -CONFIG_MSTAR_MIU=y -CONFIG_SSC007A_S01A=y -CONFIG_MS_BDMA=y -# CONFIG_MS_BDMA_LINE_OFFSET_ON is not set -CONFIG_MS_MOVE_DMA=y -# CONFIG_MS_IR is not set -CONFIG_MS_I2C=y -# CONFIG_MS_I2C_INT_ISR is not set -CONFIG_MS_GPIO=y -CONFIG_MS_SW_I2C=y -CONFIG_MS_PADMUX=y -CONFIG_MS_WATCHDOG=y -CONFIG_MS_SAR=y -# CONFIG_MS_SARKEY is not set -CONFIG_MSTAR_MMAHEAP=y -CONFIG_SSTAR_NETPHY=y -CONFIG_SS_VOLTAGE_CTRL=y -# CONFIG_SS_SWTOE is not set -# CONFIG_MS_EMAC_TOE is not set - -# -# Firmware Drivers -# -# CONFIG_FIRMWARE_MEMMAP is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_HAVE_ARM_SMCCC=y - -# -# File systems -# -CONFIG_DCACHE_WORD_ACCESS=y -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -# CONFIG_EXT4_FS is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -CONFIG_F2FS_FS=m -CONFIG_F2FS_STAT_FS=y -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_FS_POSIX_ACL=y -# CONFIG_F2FS_FS_SECURITY is not set -# CONFIG_F2FS_CHECK_FS is not set -# CONFIG_F2FS_FS_ENCRYPTION is not set -# CONFIG_F2FS_FAULT_INJECTION is not set -CONFIG_FS_POSIX_ACL=y -# CONFIG_EXPORTFS_BLOCK_OPS is not set -CONFIG_FILE_LOCKING=y -CONFIG_MANDATORY_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set -CONFIG_OVERLAY_FS=y - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=m -# CONFIG_MSDOS_FS is not set -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_CHILDREN is not set -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_CONFIGFS_FS=y -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -# CONFIG_JFFS2_FS_WRITEBUFFER is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -# CONFIG_UBIFS_FS is not set -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=y -# CONFIG_SQUASHFS_FILE_CACHE is not set -CONFIG_SQUASHFS_FILE_DIRECT=y -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y -CONFIG_SQUASHFS_EMBEDDED=y -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -# CONFIG_NFS_V2 is not set -CONFIG_NFS_V3=y -CONFIG_NFS_V3_ACL=y -# CONFIG_NFS_V4 is not set -# CONFIG_NFS_SWAP is not set -CONFIG_ROOT_NFS=y -# CONFIG_NFSD is not set -CONFIG_GRACE_PERIOD=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -# CONFIG_SUNRPC_DEBUG is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CIFS is not set -# CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_DEBUG is not set -# CONFIG_CIFS_SMB2 is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=y -# CONFIG_DLM is not set - -# -# Kernel hacking -# - -# -# printk and dmesg options -# -# CONFIG_PRINTK_TIME is not set -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3 -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_DYNAMIC_DEBUG is not set - -# -# Compile-time checks and compiler options -# -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_GDB_SCRIPTS is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=4096 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_PAGE_OWNER is not set -CONFIG_DEBUG_FS=y -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y - -# -# Memory Debugging -# -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SLUB_STATS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_SHIRQ is not set - -# -# Debug Lockups and Hangs -# -CONFIG_LOCKUP_DETECTOR=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHED_INFO is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -# CONFIG_DEBUG_TIMEKEEPING is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_PREEMPT is not set - -# -# Lock Debugging (spinlocks, mutexes, etc...) -# -CONFIG_DEBUG_RT_MUTEXES=y -CONFIG_DEBUG_SPINLOCK=y -CONFIG_DEBUG_MUTEXES=y -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PI_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set - -# -# RCU Debugging -# -# CONFIG_PROVE_RCU is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_TORTURE_TEST is not set -# CONFIG_RCU_PERF_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_LATENCYTOP is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set - -# -# Runtime Testing -# -# CONFIG_LKDTM is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_BITMAP is not set -# CONFIG_TEST_UUID is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_HASH is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_USER_COPY is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_MEMTEST is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set -# CONFIG_UBSAN is not set -CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y -# CONFIG_STRICT_DEVMEM is not set -# CONFIG_ARM_PTDUMP is not set -CONFIG_ARM_UNWIND=y -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_LL is not set -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -# CONFIG_DEBUG_UART_8250 is not set -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_DEBUG_SET_MODULE_RONX is not set -# CONFIG_CORESIGHT is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y -CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y -# CONFIG_HARDENED_USERCOPY is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_KPP2=y -# CONFIG_CRYPTO_RSA is not set -# CONFIG_CRYPTO_DH is not set -# CONFIG_CRYPTO_ECDH is not set -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -CONFIG_CRYPTO_GF128MUL=m -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_MCRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -CONFIG_CRYPTO_CCM=m -CONFIG_CRYPTO_GCM=m -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set -# CONFIG_CRYPTO_KEYWRAP is not set - -# -# Hash modes -# -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -CONFIG_CRYPTO_CRC32=y -# CONFIG_CRYPTO_CRCT10DIF is not set -CONFIG_CRYPTO_GHASH=m -# CONFIG_CRYPTO_POLY1305 is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_SHA1 is not set -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_SHA3 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_CHACHA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -# CONFIG_CRYPTO_DRBG_HASH is not set -# CONFIG_CRYPTO_DRBG_CTR is not set -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -# CONFIG_CRYPTO_USER_API_RNG is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -# CONFIG_CRYPTO_HW is not set - -# -# Certificates for signature checking -# -# CONFIG_ARM_CRYPTO is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_RATIONAL=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_IA64 is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -# CONFIG_XZ_DEC_SPARC is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DQL=y -CONFIG_NLATTR=y -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set -# CONFIG_IRQ_POLL is not set -CONFIG_LIBFDT=y -# CONFIG_SG_SPLIT is not set -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_SBITMAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335de.generic.config.kama b/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335de.generic.config.kama deleted file mode 100644 index d494a0b6..00000000 --- a/br-ext-chip-sigmastar/board/infinity6b0/kernel/ssc335de.generic.config.kama +++ /dev/null @@ -1,2654 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/arm 4.9.84 Kernel Configuration -# -CONFIG_ARM=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_GENERIC_BUG=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_EXTABLE_SORT=y - -# -# General setup -# -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -# CONFIG_COMPILE_TEST is not set -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_LZ4=y -# CONFIG_KERNEL_GZIP is not set -# CONFIG_KERNEL_LZMA is not set -CONFIG_KERNEL_XZ=y -# CONFIG_KERNEL_LZO is not set -# CONFIG_KERNEL_LZ4 is not set -CONFIG_DEFAULT_HOSTNAME="ipcam" -# CONFIG_SWAP is not set -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -# CONFIG_CROSS_MEMORY_ATTACH is not set -# CONFIG_FHANDLE is not set -# CONFIG_USELIB is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_HANDLE_DOMAIN_IRQ=y -# CONFIG_IRQ_DOMAIN_DEBUG is not set -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_SPARSE_IRQ=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GENERIC_CLOCKEVENTS=y - -# -# Timers subsystem -# -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set -# CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_PREEMPT_RCU=y -# CONFIG_RCU_EXPERT is not set -CONFIG_SRCU=y -# CONFIG_TASKS_RCU is not set -CONFIG_RCU_STALL_COMMON=y -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_EXPEDITE_BOOT is not set -# CONFIG_BUILD_BIN2C is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=15 -CONFIG_NMI_LOG_BUF_SHIFT=13 -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_CGROUPS=y -# CONFIG_MEMCG is not set -# CONFIG_BLK_CGROUP is not set -# CONFIG_CGROUP_SCHED is not set -# CONFIG_CGROUP_PIDS is not set -# CONFIG_CGROUP_FREEZER is not set -# CONFIG_CPUSETS is not set -# CONFIG_CGROUP_DEVICE is not set -# CONFIG_CGROUP_CPUACCT is not set -# CONFIG_CGROUP_PERF is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CHECKPOINT_RESTORE is not set -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_IPC_NS=y -# CONFIG_USER_NS is not set -CONFIG_PID_NS=y -CONFIG_NET_NS=y -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SYSFS_DEPRECATED is not set -# CONFIG_RELAY is not set -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -# CONFIG_RD_GZIP is not set -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -# CONFIG_RD_LZ4 is not set -# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_HAVE_UID16=y -CONFIG_BPF=y -CONFIG_EXPERT=y -CONFIG_UID16=y -CONFIG_MULTIUSER=y -# CONFIG_SGETMASK_SYSCALL is not set -CONFIG_SYSFS_SYSCALL=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y -# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set -CONFIG_KALLSYMS_BASE_RELATIVE=y -CONFIG_PRINTK=y -CONFIG_PRINTK_NMI=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -# CONFIG_BASE_FULL is not set -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_SHMEM=y -CONFIG_AIO=y -# CONFIG_ADVISE_SYSCALLS is not set -# CONFIG_USERFAULTFD is not set -CONFIG_MEMBARRIER=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_SLUB_DEBUG is not set -CONFIG_COMPAT_BRK=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -# CONFIG_SLAB_FREELIST_RANDOM is not set -# CONFIG_SYSTEM_DATA_VERIFICATION is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -CONFIG_JUMP_LABEL=y -# CONFIG_STATIC_KEYS_SELFTEST is not set -# CONFIG_UPROBES is not set -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_NMI=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_GCC_PLUGINS=y -# CONFIG_GCC_PLUGINS is not set -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_CC_STACKPROTECTOR=y -# CONFIG_CC_STACKPROTECTOR_NONE is not set -CONFIG_CC_STACKPROTECTOR_REGULAR=y -# CONFIG_CC_STACKPROTECTOR_STRONG is not set -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_HAVE_ARCH_MMAP_RND_BITS=y -CONFIG_HAVE_EXIT_THREAD=y -CONFIG_ARCH_MMAP_RND_BITS_MIN=8 -CONFIG_ARCH_MMAP_RND_BITS_MAX=16 -CONFIG_ARCH_MMAP_RND_BITS=8 -# CONFIG_HAVE_ARCH_HASH is not set -# CONFIG_ISA_BUS_API is not set -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OLD_SIGACTION=y -# CONFIG_CPU_NO_EFFICIENT_FFS is not set -# CONFIG_HAVE_ARCH_VMAP_STACK is not set - -# -# GCOV-based kernel profiling -# -# CONFIG_GCOV_KERNEL is not set -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=1 -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_MODULE_SIG is not set -# CONFIG_MODULE_COMPRESS is not set -# CONFIG_TRIM_UNUSED_KSYMS is not set -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_BLOCK=y -# CONFIG_LBDAF is not set -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set -# CONFIG_BLK_CMDLINE_PARSER is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y -CONFIG_EFI_PARTITION=y - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_DEADLINE=y -# CONFIG_IOSCHED_CFQ is not set -CONFIG_DEFAULT_DEADLINE=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="deadline" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -# CONFIG_FREEZER is not set - -# -# System Type -# -CONFIG_MMU=y -# CONFIG_ARCH_INFINITY2 is not set -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_GEMINI is not set -# CONFIG_ARCH_EBSA110 is not set -# CONFIG_ARCH_EP93XX is not set -# CONFIG_ARCH_FOOTBRIDGE is not set -# CONFIG_ARCH_NETX is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_KS8695 is not set -# CONFIG_ARCH_W90X900 is not set -# CONFIG_ARCH_LPC32XX is not set -# CONFIG_ARCH_PXA is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_S3C24XX is not set -# CONFIG_ARCH_DAVINCI is not set -# CONFIG_ARCH_OMAP1 is not set - -# -# Multiple platform selection -# - -# -# CPU Core family selection -# -# CONFIG_ARCH_MULTI_V6 is not set -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_MULTI_V6_V7=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -# CONFIG_ARCH_VIRT is not set -# CONFIG_ARCH_MVEBU is not set -# CONFIG_ARCH_ALPINE is not set -# CONFIG_ARCH_ARTPEC is not set -# CONFIG_ARCH_AT91 is not set -# CONFIG_ARCH_BCM is not set -# CONFIG_ARCH_BERLIN is not set -# CONFIG_ARCH_DIGICOLOR is not set -# CONFIG_ARCH_HIGHBANK is not set -# CONFIG_ARCH_HISI is not set -# CONFIG_ARCH_KEYSTONE is not set -# CONFIG_ARCH_MESON is not set -CONFIG_ARCH_SSTAR=y -# CONFIG_SS_DUALOS is not set - -# -# Options -# -CONFIG_SS_DTB_NAME="infinity6b0-ssc009b-s01a" -CONFIG_SS_BUILTIN_DTB=y -CONFIG_MS_KERNEL_TYPE="" -CONFIG_SSTAR_CHIP_NAME="infinity6b0" -CONFIG_SSTAR_SHORT_NAME="I6B0" -# CONFIG_MP_IRQ_TRACE is not set -CONFIG_SKIP_SQUASHFS_BAD_BLOCK=y - -# -# Fast boot -# -# CONFIG_SS_BUILTIN_UNFDT is not set -# CONFIG_FB_DTS_SKIP_CRC is not set -# CONFIG_FB_DTS_SCAN_MEMORY_ONCE is not set -# CONFIG_FB_DTS_SKIP_ATAGS_TO_FDT is not set -CONFIG_DISABLE_CLK_DEBUGFS_SUPPORT=y -CONFIG_DEFERRED_INIICALLS=y -# CONFIG_DEFERRED_INIICALLS_SLAB_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PARAM_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_PPERF_SYSFS is not set -# CONFIG_DEFERRED_INIICALLS_MORE_SYSFS is not set -# CONFIG_DEFERRED_CREATE_DTS_SYSNODE is not set -# CONFIG_CRYPTO_MANAGER_NO_TESTS_THREAD is not set -CONFIG_ARCH_INFINITY6B0=y -CONFIG_SS_PROFILING_TIME=y -# CONFIG_ARCH_MXC is not set -# CONFIG_ARCH_MEDIATEK is not set - -# -# TI OMAP/AM/DM/DRA Family -# -# CONFIG_ARCH_OMAP3 is not set -# CONFIG_ARCH_OMAP4 is not set -# CONFIG_SOC_OMAP5 is not set -# CONFIG_SOC_AM33XX is not set -# CONFIG_SOC_AM43XX is not set -# CONFIG_SOC_DRA7XX is not set -# CONFIG_ARCH_MMP is not set -# CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_ROCKCHIP is not set -# CONFIG_ARCH_SOCFPGA is not set -# CONFIG_PLAT_SPEAR is not set -# CONFIG_ARCH_STI is not set -# CONFIG_ARCH_S5PV210 is not set -# CONFIG_ARCH_EXYNOS is not set -# CONFIG_ARCH_RENESAS is not set -# CONFIG_ARCH_SUNXI is not set -# CONFIG_ARCH_SIRF is not set -# CONFIG_ARCH_TANGO is not set -# CONFIG_ARCH_TEGRA is not set -# CONFIG_ARCH_UNIPHIER is not set -# CONFIG_ARCH_U8500 is not set -# CONFIG_ARCH_VEXPRESS is not set -# CONFIG_ARCH_WM8850 is not set -# CONFIG_ARCH_ZX is not set -# CONFIG_ARCH_ZYNQ is not set - -# -# Processor Type -# -CONFIG_CPU_V7=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_HAS_ASID=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y - -# -# Processor Features -# -# CONFIG_ARM_LPAE is not set -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_ARM_THUMB=y -CONFIG_ARM_THUMBEE=y -CONFIG_ARM_VIRT_EXT=y -# CONFIG_SWP_EMULATE is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_KUSER_HELPERS=y -CONFIG_VDSO=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -# CONFIG_CACHE_L2X0 is not set -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -# CONFIG_DEBUG_RODATA is not set -CONFIG_MULTI_IRQ_HANDLER=y -# CONFIG_ARM_ERRATA_430973 is not set -# CONFIG_ARM_ERRATA_720789 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_775420 is not set -# CONFIG_ARM_ERRATA_773022 is not set -# CONFIG_ARM_ERRATA_818325_852422 is not set -# CONFIG_ARM_ERRATA_821420 is not set -# CONFIG_ARM_ERRATA_825619 is not set -# CONFIG_ARM_ERRATA_852421 is not set -# CONFIG_ARM_ERRATA_852423 is not set - -# -# Bus support -# -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -# CONFIG_PCCARD is not set - -# -# Kernel Features -# -CONFIG_HAVE_SMP=y -# CONFIG_SMP is not set -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_VMSPLIT_3G=y -# CONFIG_VMSPLIT_3G_OPT is not set -# CONFIG_VMSPLIT_2G is not set -# CONFIG_VMSPLIT_1G is not set -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_ARM_PSCI is not set -CONFIG_ARCH_NR_GPIO=0 -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -CONFIG_HZ_FIXED=0 -CONFIG_HZ_100=y -# CONFIG_HZ_200 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_300 is not set -# CONFIG_HZ_500 is not set -# CONFIG_HZ_1000 is not set -CONFIG_HZ=100 -CONFIG_SCHED_HRTICK=y -CONFIG_THUMB2_KERNEL=y -CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11=y -CONFIG_ARM_ASM_UNIFIED=y -CONFIG_ARM_PATCH_IDIV=y -CONFIG_AEABI=y -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -CONFIG_HAVE_ARCH_PFN_VALID=y -# CONFIG_HIGHMEM is not set -CONFIG_CPU_SW_DOMAIN_PAN=y -CONFIG_HW_PERF_EVENTS=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -# CONFIG_ARM_MODULE_PLTS is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_NO_BOOTMEM=y -CONFIG_MEMORY_ISOLATION=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_COMPACTION=y -CONFIG_MIGRATION=y -# CONFIG_PHYS_ADDR_T_64BIT is not set -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_CLEANCACHE is not set -CONFIG_CMA=y -CONFIG_CMA_DEBUG=y -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_AREAS=1 -# CONFIG_ZPOOL is not set -# CONFIG_ZBUD is not set -# CONFIG_ZSMALLOC is not set -CONFIG_GENERIC_EARLY_IOREMAP=y -# CONFIG_IDLE_PAGE_TRACKING is not set -CONFIG_FORCE_MAX_ZONEORDER=10 -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_UACCESS_WITH_MEMCPY is not set -# CONFIG_SECCOMP is not set -CONFIG_SWIOTLB=y -CONFIG_IOMMU_HELPER=y -# CONFIG_PARAVIRT is not set -# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -# CONFIG_XEN is not set - -# -# Boot options -# -CONFIG_USE_OF=y -CONFIG_ATAGS=y -# CONFIG_DEPRECATED_PARAM_STRUCT is not set -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_CMDLINE="" -# CONFIG_KEXEC is not set -# CONFIG_CRASH_DUMP is not set -CONFIG_AUTO_ZRELADDR=y -# CONFIG_EFI is not set - -# -# CPU Power Management -# - -# -# CPU Frequency scaling -# -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_STAT_DETAILS=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set - -# -# CPU frequency scaling drivers -# -# CONFIG_CPUFREQ_DT is not set -# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set -# CONFIG_QORIQ_CPUFREQ is not set - -# -# CPU Idle -# -# CONFIG_CPU_IDLE is not set -# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set - -# -# Floating point emulation -# - -# -# At least one emulation must be selected -# -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_NEON=y -CONFIG_KERNEL_MODE_NEON=y - -# -# Userspace binary formats -# -CONFIG_BINFMT_ELF=y -CONFIG_ELFCORE=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_BINFMT_SCRIPT=y -# CONFIG_BINFMT_FLAT is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_COREDUMP=y - -# -# Power management options -# -# CONFIG_SUSPEND is not set -# CONFIG_PM is not set -# CONFIG_APM_EMULATION is not set -CONFIG_PM_OPP=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_ARM_CPU_SUSPEND is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -# CONFIG_XFRM_USER is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -# CONFIG_IP_FIB_TRIE_STATS is not set -# CONFIG_IP_MULTIPLE_TABLES is not set -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_NET_IP_TUNNEL is not set -# CONFIG_IP_MROUTE is not set -CONFIG_SYN_COOKIES=y -# CONFIG_NET_UDP_TUNNEL is not set -# CONFIG_NET_FOU is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -# CONFIG_TCP_CONG_BIC is not set -CONFIG_TCP_CONG_CUBIC=y -# CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_HTCP is not set -# CONFIG_TCP_CONG_HSTCP is not set -# CONFIG_TCP_CONG_HYBLA is not set -# CONFIG_TCP_CONG_VEGAS is not set -# CONFIG_TCP_CONG_NV is not set -# CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_LP is not set -# CONFIG_TCP_CONG_VENO is not set -# CONFIG_TCP_CONG_YEAH is not set -# CONFIG_TCP_CONG_ILLINOIS is not set -# CONFIG_TCP_CONG_DCTCP is not set -# CONFIG_TCP_CONG_CDG is not set -# CONFIG_TCP_CONG_BBR is not set -CONFIG_DEFAULT_CUBIC=y -# CONFIG_DEFAULT_RENO is not set -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NET_PTP_CLASSIFY is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_BRIDGE=y -CONFIG_HAVE_NET_DSA=y -# CONFIG_NET_DSA is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -# CONFIG_NETLINK_DIAG is not set -# CONFIG_MPLS is not set -# CONFIG_HSR is not set -# CONFIG_NET_SWITCHDEV is not set -# CONFIG_NET_L3_MASTER_DEV is not set -# CONFIG_NET_NCSI is not set -# CONFIG_SOCK_CGROUP_DATA is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CGROUP_NET_CLASSID is not set -CONFIG_NET_RX_BUSY_POLL=y -CONFIG_BQL=y -# CONFIG_BPF_JIT is not set - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -# CONFIG_AF_KCM is not set -# CONFIG_STREAM_PARSER is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=m -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -# CONFIG_CFG80211_INTERNAL_REGDB is not set -CONFIG_CFG80211_CRDA_SUPPORT=y -CONFIG_CFG80211_WEXT=y -# CONFIG_LIB80211 is not set -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_MINSTREL_HT=y -# CONFIG_MAC80211_RC_MINSTREL_VHT is not set -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -CONFIG_MAC80211_MESH=y -# CONFIG_MAC80211_DEBUGFS is not set -# CONFIG_MAC80211_MESSAGE_TRACING is not set -# CONFIG_MAC80211_DEBUG_MENU is not set -CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 -# CONFIG_WIMAX is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set -# CONFIG_LWTUNNEL is not set -# CONFIG_DST_CACHE is not set -# CONFIG_NET_DEVLINK is not set -CONFIG_MAY_USE_DEVLINK=y -CONFIG_HAVE_CBPF_JIT=y - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER=y -CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_STANDALONE is not set -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -# CONFIG_FW_LOADER is not set -# CONFIG_ALLOW_DEV_COREDUMP is not set -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_SPI=y -# CONFIG_DMA_SHARED_BUFFER is not set -CONFIG_DMA_CMA=y - -# -# Default contiguous memory area size: -# -CONFIG_CMA_SIZE_MBYTES=2 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=4 - -# -# Bus devices -# -# CONFIG_ARM_CCI400_PMU is not set -# CONFIG_ARM_CCI5xx_PMU is not set -# CONFIG_ARM_CCN is not set -# CONFIG_BRCMSTB_GISB_ARB is not set -# CONFIG_VEXPRESS_CONFIG is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -CONFIG_MTD_TESTS=m -# CONFIG_MTD_SS_TESTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_AFS_PARTS is not set -# CONFIG_MTD_OF_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_PARTITIONED_MASTER is not set - -# -# RAM/ROM/Flash chip drivers -# -# CONFIG_MTD_CFI is not set -# CONFIG_MTD_JEDECPROBE is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_RAM=y -# CONFIG_MTD_ROM is not set -# CONFIG_MTD_ABSENT is not set - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP_OF=y -CONFIG_MTD_PLATRAM=y - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_DATAFLASH is not set -# CONFIG_MTD_M25P80 is not set -# CONFIG_MTD_SST25L is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOCG3 is not set -CONFIG_MTD_NAND_ECC=m -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND=m -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_NAND_DENALI_DT is not set -# CONFIG_MTD_NAND_GPIO is not set -# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set -CONFIG_MTD_NAND_IDS=m -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_BRCMNAND is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_NAND_HISI504 is not set -# CONFIG_MTD_NAND_MTK is not set -# CONFIG_MTD_ONENAND is not set - -# -# LPDDR & LPDDR2 PCM memory drivers -# -# CONFIG_MTD_LPDDR is not set -# CONFIG_MTD_LPDDR2_NVM is not set -CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_MT81xx_NOR is not set -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -# CONFIG_SPI_CADENCE_QUADSPI is not set -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_MTD_UBI_BLOCK is not set -CONFIG_DTC=y -CONFIG_OF=y -# CONFIG_OF_UNITTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_NET=y -CONFIG_OF_MDIO=y -CONFIG_OF_RESERVED_MEM=y -# CONFIG_OF_OVERLAY is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_NULL_BLK is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=65536 -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_MG_DISK is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_NVME_TARGET is not set - -# -# Misc devices -# -# CONFIG_AD525X_DPOT is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_TI_DAC7512 is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -CONFIG_EEPROM_AT24=m -# CONFIG_EEPROM_AT25 is not set -CONFIG_EEPROM_LEGACY=m -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_TI_ST is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set - -# -# Intel MIC Bus Driver -# - -# -# SCIF Bus Driver -# - -# -# VOP Bus Driver -# - -# -# Intel MIC Host Driver -# - -# -# Intel MIC Card Driver -# - -# -# SCIF Driver -# - -# -# Intel MIC Coprocessor State Management (COSM) Drivers -# - -# -# VOP Driver -# -# CONFIG_ECHO is not set -# CONFIG_CXL_BASE is not set -# CONFIG_CXL_AFU_DRIVER_OPS is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_NETLINK is not set -# CONFIG_SCSI_MQ_DEFAULT is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -# CONFIG_BLK_DEV_SR is not set -# CONFIG_CHR_DEV_SG is not set -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_DH is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -# CONFIG_ATA is not set -# CONFIG_MD is not set -# CONFIG_TARGET_CORE is not set -CONFIG_NETDEVICES=y -CONFIG_MII=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -# CONFIG_DUMMY is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_VXLAN is not set -# CONFIG_MACSEC is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -CONFIG_TUN=m -# CONFIG_TUN_VNET_CROSS_LE is not set -# CONFIG_VETH is not set -# CONFIG_NLMON is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_ETHERNET is not set -CONFIG_PHYLIB=y -CONFIG_SWPHY=y - -# -# MDIO bus device drivers -# -# CONFIG_MDIO_BCM_UNIMAC is not set -# CONFIG_MDIO_BITBANG is not set -# CONFIG_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MDIO_HISI_FEMAC is not set - -# -# MII PHY device drivers -# -# CONFIG_AMD_PHY is not set -# CONFIG_AQUANTIA_PHY is not set -# CONFIG_AT803X_PHY is not set -# CONFIG_BCM7XXX_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_DP83848_PHY is not set -# CONFIG_DP83867_PHY is not set -CONFIG_FIXED_PHY=y -# CONFIG_ICPLUS_PHY is not set -# CONFIG_INTEL_XWAY_PHY is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_MICROCHIP_PHY is not set -# CONFIG_MICROSEMI_PHY is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_STE10XP is not set -# CONFIG_TERANETICS_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_XILINX_GMII2RGMII is not set -# CONFIG_MICREL_KS8995MA is not set -# CONFIG_PPP is not set -# CONFIG_SLIP is not set - -# -# Host-side USB support is needed for USB Network Adapter support -# -CONFIG_USB_NET_DRIVERS=m -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_RTL8152 is not set -# CONFIG_USB_LAN78XX is not set -CONFIG_USB_USBNET=m -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_AX88179_178A=m -CONFIG_USB_NET_CDCETHER=m -# CONFIG_USB_NET_CDC_EEM is not set -CONFIG_USB_NET_CDC_NCM=m -# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SR9700 is not set -# CONFIG_USB_NET_SR9800 is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_GL620A is not set -CONFIG_USB_NET_NET1080=m -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -CONFIG_USB_NET_RNDIS_HOST=m -CONFIG_USB_NET_CDC_SUBSET_ENABLE=m -CONFIG_USB_NET_CDC_SUBSET=m -# CONFIG_USB_ALI_M5632 is not set -# CONFIG_USB_AN2720 is not set -# CONFIG_USB_BELKIN is not set -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_EPSON2888 is not set -# CONFIG_USB_KC2190 is not set -CONFIG_USB_NET_ZAURUS=m -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_QMI_WWAN is not set -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_VL600 is not set -# CONFIG_USB_NET_CH9200 is not set -CONFIG_WLAN=y -# CONFIG_WLAN_VENDOR_ADMTEK is not set -# CONFIG_WLAN_VENDOR_ATH is not set -# CONFIG_WLAN_VENDOR_ATMEL is not set -# CONFIG_WLAN_VENDOR_BROADCOM is not set -# CONFIG_WLAN_VENDOR_CISCO is not set -# CONFIG_WLAN_VENDOR_INTEL is not set -# CONFIG_WLAN_VENDOR_INTERSIL is not set -# CONFIG_WLAN_VENDOR_MARVELL is not set -CONFIG_WLAN_VENDOR_MEDIATEK=y -# CONFIG_MT7601U is not set -CONFIG_WLAN_VENDOR_RALINK=y -# CONFIG_RT2X00 is not set -CONFIG_WLAN_VENDOR_REALTEK=y -# CONFIG_RTL8187 is not set -# CONFIG_RTL_CARDS is not set -CONFIG_RTL8XXXU=m -CONFIG_RTL8XXXU_UNTESTED=y -# CONFIG_WLAN_VENDOR_RSI is not set -# CONFIG_WLAN_VENDOR_ST is not set -# CONFIG_WLAN_VENDOR_TI is not set -# CONFIG_WLAN_VENDOR_ZYDAS is not set -# CONFIG_MAC80211_HWSIM is not set -CONFIG_USB_NET_RNDIS_WLAN=m - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_ISDN is not set -# CONFIG_NVM is not set - -# -# Input device support -# -# CONFIG_INPUT is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVMEM=y -# CONFIG_DEVKMEM is not set - -# -# Serial drivers -# -# CONFIG_SERIAL_8250 is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_UARTLITE is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_SC16IS7XX is not set -# CONFIG_SERIAL_BCM63XX is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_FSL_LPUART is not set -# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set -# CONFIG_SERIAL_ST_ASC is not set -# CONFIG_SERIAL_STM32 is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_HVC_DCC is not set -# CONFIG_IPMI_HANDLER is not set -# CONFIG_HW_RANDOM is not set -# CONFIG_R3964 is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -# CONFIG_XILLYBUS is not set - -# -# I2C support -# -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -# CONFIG_I2C_COMPAT is not set -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -# CONFIG_I2C_HELPER_AUTO is not set -# CONFIG_I2C_SMBUS is not set - -# -# I2C Algorithms -# -# CONFIG_I2C_ALGOBIT is not set -# CONFIG_I2C_ALGOPCF is not set -# CONFIG_I2C_ALGOPCA is not set - -# -# I2C Hardware Bus support -# - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_EMEV2 is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_RK3X is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_ROBOTFUZZ_OSIF is not set -# CONFIG_I2C_TAOS_EVM is not set -CONFIG_I2C_TINY_USB=m - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_SLAVE is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_AXI_SPI_ENGINE is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_CADENCE is not set -# CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_ROCKCHIP is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -# CONFIG_SPI_ZYNQMP_GQSPI is not set - -# -# SPI Protocol Masters -# -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_LOOPBACK_TEST is not set -# CONFIG_SPI_TLE62X0 is not set -# CONFIG_SPMI is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_GPIOLIB=y -CONFIG_OF_GPIO=y -# CONFIG_DEBUG_GPIO is not set -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers -# -# CONFIG_GPIO_74XX_MMIO is not set -# CONFIG_GPIO_ALTERA is not set -# CONFIG_GPIO_DWAPB is not set -# CONFIG_GPIO_EM is not set -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_GRGPIO is not set -# CONFIG_GPIO_MOCKUP is not set -# CONFIG_GPIO_MPC8XXX is not set -# CONFIG_GPIO_XILINX is not set -# CONFIG_GPIO_ZEVIO is not set -# CONFIG_GPIO_ZX is not set - -# -# I2C GPIO expanders -# -# CONFIG_GPIO_ADP5588 is not set -# CONFIG_GPIO_ADNP is not set -# CONFIG_GPIO_MAX7300 is not set -# CONFIG_GPIO_MAX732X is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_GPIO_PCF857X is not set -# CONFIG_GPIO_SX150X is not set -# CONFIG_GPIO_TPIC2810 is not set -# CONFIG_GPIO_TS4900 is not set - -# -# MFD GPIO expanders -# -# CONFIG_HTC_EGPIO is not set - -# -# SPI GPIO expanders -# -# CONFIG_GPIO_74X164 is not set -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_PISOSR is not set - -# -# SPI or I2C GPIO expanders -# -# CONFIG_GPIO_MCP23S08 is not set - -# -# USB GPIO expanders -# -# CONFIG_W1 is not set -# CONFIG_POWER_AVS is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WATCHDOG_NOWAYOUT is not set -# CONFIG_WATCHDOG_SYSFS is not set - -# -# Watchdog Device Drivers -# -# CONFIG_SOFT_WATCHDOG is not set -# CONFIG_GPIO_WATCHDOG is not set -# CONFIG_XILINX_WATCHDOG is not set -# CONFIG_ZIIRAVE_WATCHDOG is not set -# CONFIG_CADENCE_WATCHDOG is not set -# CONFIG_DW_WATCHDOG is not set -# CONFIG_MAX63XX_WATCHDOG is not set -# CONFIG_MEN_A21_WDT is not set - -# -# USB-based Watchdog Cards -# -# CONFIG_USBPCWATCHDOG is not set - -# -# Watchdog Pretimeout Governors -# -# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set - -# -# Multifunction device drivers -# -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_MFD_AS3722 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MFD_ATMEL_HLCDC is not set -# CONFIG_MFD_BCM590XX is not set -# CONFIG_MFD_AXP20X_I2C is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_MFD_ASIC3 is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_DA9062 is not set -# CONFIG_MFD_DA9063 is not set -# CONFIG_MFD_DA9150 is not set -# CONFIG_MFD_DLN2 is not set -# CONFIG_MFD_EXYNOS_LPASS is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_MFD_HI6421_PMIC is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_INTEL_SOC_PMIC is not set -# CONFIG_MFD_KEMPLD is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX14577 is not set -# CONFIG_MFD_MAX77620 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX77843 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_MT6397 is not set -# CONFIG_MFD_MENF21BMC is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_PM8921_CORE is not set -# CONFIG_MFD_RT5033 is not set -# CONFIG_MFD_RTSX_USB is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_RK808 is not set -# CONFIG_MFD_RN5T618 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SKY81452 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_LP3943 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65086 is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TI_LP873X is not set -# CONFIG_MFD_TPS65218 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_T7L66XB is not set -# CONFIG_MFD_TC6387XB is not set -# CONFIG_MFD_TC6393XB is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_REGULATOR is not set -# CONFIG_MEDIA_SUPPORT is not set - -# -# Graphics support -# -# CONFIG_DRM is not set - -# -# ACP (Audio CoProcessor) Configuration -# - -# -# Frame buffer Devices -# -CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_CMDLINE=y -CONFIG_FB_NOTIFY=y -# CONFIG_FB_DDC is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_OPENCORES is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_IBM_GXT4500 is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_FB_SSD1307 is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_VGASTATE is not set -# CONFIG_LOGO is not set -# CONFIG_SOUND is not set -CONFIG_USB_OHCI_LITTLE_ENDIAN=y -CONFIG_USB_SUPPORT=y -CONFIG_MP_USB_MSTAR=y -CONFIG_USB_COMMON=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -# -# Miscellaneous USB options -# -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y -# CONFIG_USB_EHCI_SUSPEND_PORT is not set -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_FOTG210_HCD is not set -# CONFIG_USB_MAX3421_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_TEST_MODE is not set - -# -# USB Device Class drivers -# -# CONFIG_USB_ACM is not set -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -CONFIG_USB_STORAGE=m -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -# CONFIG_USB_UAS is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -# CONFIG_USBIP_CORE is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_DWC2 is not set -# CONFIG_USB_CHIPIDEA is not set -# CONFIG_USB_ISP1760 is not set - -# -# USB port drivers -# -# CONFIG_USB_SERIAL is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_SISUSBVGA is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_EHSET_TEST_FIXTURE is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HSIC_USB3503 is not set -# CONFIG_USB_HSIC_USB4604 is not set -# CONFIG_USB_LINK_LAYER_TEST is not set - -# -# USB Physical Layer drivers -# -# CONFIG_USB_PHY is not set -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_ULPI is not set -# CONFIG_USB_GADGET is not set -# CONFIG_USB_ULPI_BUS is not set -# CONFIG_UWB is not set -CONFIG_MMC=y -CONFIG_SS_FAST_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_PWRSEQ_EMMC=y -CONFIG_PWRSEQ_SIMPLE=y - -# -# MMC/SD/SDIO Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=8 -CONFIG_MMC_BLOCK_BOUNCE=y -# CONFIG_SDIO_UART is not set -# CONFIG_MMC_TEST is not set - -# -# MMC/SD/SDIO Host Controller Drivers -# -# CONFIG_MMC_SDHCI is not set -# CONFIG_MMC_SPI is not set -# CONFIG_MMC_DW is not set -# CONFIG_MMC_VUB300 is not set -# CONFIG_MMC_USHC is not set -# CONFIG_MMC_USDHI6ROL0 is not set -# CONFIG_MMC_MTK is not set -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_HCTOSYS_DEVICE="rtc0" -CONFIG_RTC_SYSTOHC=y -CONFIG_RTC_SYSTOHC_DEVICE="rtc0" -# CONFIG_RTC_DEBUG is not set - -# -# RTC interfaces -# -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set -# CONFIG_RTC_DRV_TEST is not set - -# -# I2C RTC drivers -# -# CONFIG_RTC_DRV_ABB5ZES3 is not set -# CONFIG_RTC_DRV_ABX80X is not set -# CONFIG_RTC_DRV_DS1307 is not set -# CONFIG_RTC_DRV_DS1374 is not set -# CONFIG_RTC_DRV_DS1672 is not set -# CONFIG_RTC_DRV_HYM8563 is not set -# CONFIG_RTC_DRV_MAX6900 is not set -# CONFIG_RTC_DRV_RS5C372 is not set -# CONFIG_RTC_DRV_ISL1208 is not set -# CONFIG_RTC_DRV_ISL12022 is not set -# CONFIG_RTC_DRV_X1205 is not set -# CONFIG_RTC_DRV_PCF8523 is not set -# CONFIG_RTC_DRV_PCF85063 is not set -# CONFIG_RTC_DRV_PCF8563 is not set -# CONFIG_RTC_DRV_PCF8583 is not set -# CONFIG_RTC_DRV_M41T80 is not set -# CONFIG_RTC_DRV_BQ32K is not set -# CONFIG_RTC_DRV_S35390A is not set -# CONFIG_RTC_DRV_FM3130 is not set -# CONFIG_RTC_DRV_RX8010 is not set -# CONFIG_RTC_DRV_RX8581 is not set -# CONFIG_RTC_DRV_RX8025 is not set -# CONFIG_RTC_DRV_EM3027 is not set -# CONFIG_RTC_DRV_RV8803 is not set - -# -# SPI RTC drivers -# -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1302 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1343 is not set -# CONFIG_RTC_DRV_DS1347 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6916 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RX4581 is not set -# CONFIG_RTC_DRV_RX6110 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_MCP795 is not set -CONFIG_RTC_I2C_AND_SPI=y - -# -# SPI and I2C RTC drivers -# -# CONFIG_RTC_DRV_DS3232 is not set -# CONFIG_RTC_DRV_PCF2127 is not set -# CONFIG_RTC_DRV_RV3029C2 is not set - -# -# Platform RTC drivers -# -# CONFIG_RTC_DRV_CMOS is not set -# CONFIG_RTC_DRV_DS1286 is not set -# CONFIG_RTC_DRV_DS1511 is not set -# CONFIG_RTC_DRV_DS1553 is not set -# CONFIG_RTC_DRV_DS1685_FAMILY is not set -# CONFIG_RTC_DRV_DS1742 is not set -# CONFIG_RTC_DRV_DS2404 is not set -# CONFIG_RTC_DRV_STK17TA8 is not set -# CONFIG_RTC_DRV_M48T86 is not set -# CONFIG_RTC_DRV_M48T35 is not set -# CONFIG_RTC_DRV_M48T59 is not set -# CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_BQ4802 is not set -# CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set -# CONFIG_RTC_DRV_ZYNQMP is not set - -# -# on-CPU RTC drivers -# -# CONFIG_RTC_DRV_SNVS is not set - -# -# HID Sensor RTC drivers -# -# CONFIG_DMADEVICES is not set - -# -# DMABUF options -# -# CONFIG_SYNC_FILE is not set -# CONFIG_AUXDISPLAY is not set -CONFIG_UIO=y -CONFIG_UIO_PDRV_GENIRQ=y -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_PRUSS is not set -# CONFIG_VIRT_DRIVERS is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -CONFIG_STAGING=y -# CONFIG_PRISM2_USB is not set -# CONFIG_COMEDI is not set -# CONFIG_RTLLIB is not set -# CONFIG_R8712U is not set -# CONFIG_R8188EU is not set -# CONFIG_VT6656 is not set - -# -# Speakup console speech -# -# CONFIG_STAGING_MEDIA is not set - -# -# Android -# -# CONFIG_ASHMEM is not set -# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set -# CONFIG_ION is not set -# CONFIG_STAGING_BOARD is not set -# CONFIG_LTE_GDM724X is not set -# CONFIG_MTD_SPINAND_MT29F is not set -# CONFIG_LNET is not set -# CONFIG_GS_FPGABOOT is not set -# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_FB_TFT is not set -# CONFIG_WILC1000_SDIO is not set -# CONFIG_WILC1000_SPI is not set -# CONFIG_MOST is not set -# CONFIG_KS7010 is not set -# CONFIG_GREYBUS is not set -# CONFIG_GOLDFISH is not set -# CONFIG_CHROME_PLATFORMS is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_COMMON_CLK=y - -# -# Common Clock Framework -# -# CONFIG_COMMON_CLK_SI5351 is not set -# CONFIG_COMMON_CLK_SI514 is not set -# CONFIG_COMMON_CLK_SI570 is not set -# CONFIG_COMMON_CLK_CDCE706 is not set -# CONFIG_COMMON_CLK_CDCE925 is not set -# CONFIG_COMMON_CLK_CS2000_CP is not set -# CONFIG_CLK_QORIQ is not set -# CONFIG_COMMON_CLK_NXP is not set -# CONFIG_COMMON_CLK_PWM is not set -# CONFIG_COMMON_CLK_PXA is not set -# CONFIG_COMMON_CLK_PIC32 is not set - -# -# Hardware Spinlock drivers -# - -# -# Clock Source drivers -# -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -# CONFIG_ARM_TIMER_SP804 is not set -# CONFIG_ATMEL_PIT is not set -# CONFIG_SH_TIMER_CMT is not set -# CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SH_TIMER_TMU is not set -# CONFIG_EM_TIMER_STI is not set -# CONFIG_MAILBOX is not set -# CONFIG_IOMMU_SUPPORT is not set - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# - -# -# SOC (System On Chip) specific Drivers -# - -# -# Broadcom SoC drivers -# -# CONFIG_SOC_BRCMSTB is not set -# CONFIG_SUNXI_SRAM is not set -# CONFIG_SOC_TI is not set -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -CONFIG_PWM=y -CONFIG_PWM_SYSFS=y -# CONFIG_PWM_FSL_FTM is not set -# CONFIG_PWM_PCA9685 is not set -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_ARM_GIC_MAX_NR=1 -# CONFIG_IPACK_BUS is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_FMC is not set - -# -# PHY Subsystem -# -# CONFIG_GENERIC_PHY is not set -# CONFIG_PHY_PXA_28NM_HSIC is not set -# CONFIG_PHY_PXA_28NM_USB2 is not set -# CONFIG_BCM_KONA_USB2_PHY is not set -# CONFIG_POWERCAP is not set -# CONFIG_MCB is not set - -# -# Performance monitor support -# -CONFIG_ARM_PMU=y -# CONFIG_RAS is not set - -# -# Android -# -CONFIG_ANDROID=y -# CONFIG_ANDROID_BINDER_IPC is not set -CONFIG_NVMEM=m -# CONFIG_STM is not set -# CONFIG_INTEL_TH is not set - -# -# FPGA Configuration Support -# -# CONFIG_FPGA is not set -CONFIG_MSTAR_DRIVERS=y -# CONFIG_CAM_DRIVERS is not set -# CONFIG_DLA_DRIVER is not set -# CONFIG_MS_PIU_TIMER is not set -CONFIG_MS_MSYS=y -CONFIG_MS_ZEN=y -# CONFIG_MS_MSYS_LOG is not set -# CONFIG_MSYS_PERF_TEST is not set -# CONFIG_MSYS_BENCH_MEMORY_FUNC is not set -# CONFIG_MSYS_MIU_PROTECT is not set -# CONFIG_MSYS_DMEM_SYSFS_ALL is not set -CONFIG_MS_SERIAL=y -# CONFIG_MS_USCLK is not set -CONFIG_MS_FLASH_ISP=y -CONFIG_MS_FLASH_ISP_MXP_PARTS=y -CONFIG_MS_PWM=y -# CONFIG_PWM_NEW is not set -CONFIG_MS_SPINAND=m -# CONFIG_NAND_SINGLE_READ is not set -# CONFIG_NAND_DUAL_READ is not set -# CONFIG_NAND_QUAL_READ is not set -CONFIG_AUTO_DETECT=y -# CONFIG_NAND_QUAL_WRITE is not set -CONFIG_AUTO_DETECT_WRITE=y -CONFIG_MS_SPI_INFINITY=y -# CONFIG_SS_MSPI is not set -# CONFIG_CAM_CLK is not set -# CONFIG_MS_EMMC is not set -CONFIG_MS_SDMMC=y -CONFIG_MS_EMAC=y -# CONFIG_EMAC_SUPPLY_RNG is not set -# CONFIG_MSTAR_HW_TX_CHECKSUM is not set -# CONFIG_K3_RX_SWPATCH is not set -CONFIG_DISCONNECT_DELAY_S=1 -# CONFIG_MSTAR_EEE is not set -# CONFIG_EMAC_PHY_RESTART_AN is not set -# CONFIG_MS_IRCUT is not set -CONFIG_MS_RTC=y -# CONFIG_RTC_INNER is not set -CONFIG_RTCPWC_INNER=y -# CONFIG_RTCPWC_SW_RST_OFF is not set -# CONFIG_RTCPWC_INNER_EHHE is not set -CONFIG_MS_CRYPTO=y -# CONFIG_SS_AESDMA_INTR is not set -# CONFIG_SS_RNG is not set -CONFIG_CRYPTODEV=m -CONFIG_MS_CPU_FREQ=y -CONFIG_MS_IVE=y -CONFIG_MS_NOTIFY=m -CONFIG_SS_ISP_ISRCB=y -CONFIG_MSTAR_MIU=y -CONFIG_SSC007A_S01A=y -CONFIG_MS_BDMA=y -# CONFIG_MS_BDMA_LINE_OFFSET_ON is not set -CONFIG_MS_MOVE_DMA=y -# CONFIG_MS_IR is not set -CONFIG_MS_I2C=y -# CONFIG_MS_I2C_INT_ISR is not set -CONFIG_MS_GPIO=y -CONFIG_MS_SW_I2C=y -CONFIG_MS_PADMUX=y -CONFIG_MS_WATCHDOG=y -CONFIG_MS_SAR=y -# CONFIG_MS_SARKEY is not set -CONFIG_MSTAR_MMAHEAP=y -CONFIG_SSTAR_NETPHY=y -CONFIG_SS_VOLTAGE_CTRL=y -# CONFIG_SS_SWTOE is not set -# CONFIG_MS_EMAC_TOE is not set - -# -# Firmware Drivers -# -# CONFIG_FIRMWARE_MEMMAP is not set -# CONFIG_FW_CFG_SYSFS is not set -CONFIG_HAVE_ARM_SMCCC=y - -# -# File systems -# -CONFIG_DCACHE_WORD_ACCESS=y -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -# CONFIG_EXT4_FS is not set -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -CONFIG_F2FS_FS=m -CONFIG_F2FS_STAT_FS=y -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_FS_POSIX_ACL=y -# CONFIG_F2FS_FS_SECURITY is not set -# CONFIG_F2FS_CHECK_FS is not set -# CONFIG_F2FS_FS_ENCRYPTION is not set -# CONFIG_F2FS_FAULT_INJECTION is not set -CONFIG_FS_POSIX_ACL=y -# CONFIG_EXPORTFS_BLOCK_OPS is not set -CONFIG_FILE_LOCKING=y -CONFIG_MANDATORY_FILE_LOCKING=y -# CONFIG_FS_ENCRYPTION is not set -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -# CONFIG_AUTOFS4_FS is not set -# CONFIG_FUSE_FS is not set -CONFIG_OVERLAY_FS=y - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# CD-ROM/DVD Filesystems -# -# CONFIG_ISO9660_FS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=m -# CONFIG_MSDOS_FS is not set -CONFIG_VFAT_FS=m -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -# CONFIG_FAT_DEFAULT_UTF8 is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_CHILDREN is not set -CONFIG_KERNFS=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TMPFS_XATTR=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_CONFIGFS_FS=y -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ORANGEFS_FS is not set -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -# CONFIG_JFFS2_FS_WRITEBUFFER is not set -# CONFIG_JFFS2_SUMMARY is not set -# CONFIG_JFFS2_FS_XATTR is not set -# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -CONFIG_JFFS2_ZLIB=y -# CONFIG_JFFS2_LZO is not set -CONFIG_JFFS2_RTIME=y -# CONFIG_JFFS2_RUBIN is not set -# CONFIG_UBIFS_FS is not set -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=y -# CONFIG_SQUASHFS_FILE_CACHE is not set -CONFIG_SQUASHFS_FILE_DIRECT=y -CONFIG_SQUASHFS_DECOMP_SINGLE=y -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZ4 is not set -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y -CONFIG_SQUASHFS_EMBEDDED=y -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -# CONFIG_NFS_V2 is not set -CONFIG_NFS_V3=y -CONFIG_NFS_V3_ACL=y -# CONFIG_NFS_V4 is not set -# CONFIG_NFS_SWAP is not set -CONFIG_ROOT_NFS=y -# CONFIG_NFSD is not set -CONFIG_GRACE_PERIOD=y -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -# CONFIG_SUNRPC_DEBUG is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CIFS is not set -# CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_DEBUG is not set -# CONFIG_CIFS_SMB2 is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -CONFIG_NLS_CODEPAGE_437=y -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -CONFIG_NLS_ISO8859_1=y -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=y -# CONFIG_DLM is not set - -# -# Kernel hacking -# - -# -# printk and dmesg options -# -# CONFIG_PRINTK_TIME is not set -CONFIG_MESSAGE_LOGLEVEL_DEFAULT=3 -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_DYNAMIC_DEBUG is not set - -# -# Compile-time checks and compiler options -# -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -# CONFIG_DEBUG_INFO_SPLIT is not set -# CONFIG_DEBUG_INFO_DWARF4 is not set -# CONFIG_GDB_SCRIPTS is not set -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=4096 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_PAGE_OWNER is not set -CONFIG_DEBUG_FS=y -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_SECTION_MISMATCH_WARN_ONLY=y -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y - -# -# Memory Debugging -# -# CONFIG_PAGE_EXTENSION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_PAGE_POISONING is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SLUB_STATS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_SHIRQ is not set - -# -# Debug Lockups and Hangs -# -CONFIG_LOCKUP_DETECTOR=y -# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_WQ_WATCHDOG is not set -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHED_INFO is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_SCHED_STACK_END_CHECK is not set -# CONFIG_DEBUG_TIMEKEEPING is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_PREEMPT is not set - -# -# Lock Debugging (spinlocks, mutexes, etc...) -# -CONFIG_DEBUG_RT_MUTEXES=y -CONFIG_DEBUG_SPINLOCK=y -CONFIG_DEBUG_MUTEXES=y -# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_LOCK_TORTURE_TEST is not set -CONFIG_STACKTRACE=y -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_BUGVERBOSE is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_DEBUG_PI_LIST is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set - -# -# RCU Debugging -# -# CONFIG_PROVE_RCU is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_TORTURE_TEST is not set -# CONFIG_RCU_PERF_TEST is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -# CONFIG_RCU_TRACE is not set -# CONFIG_RCU_EQS_DEBUG is not set -# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_LATENCYTOP is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set - -# -# Runtime Testing -# -# CONFIG_LKDTM is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_PERCPU_TEST is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_TEST_HEXDUMP is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_TEST_PRINTF is not set -# CONFIG_TEST_BITMAP is not set -# CONFIG_TEST_UUID is not set -# CONFIG_TEST_RHASHTABLE is not set -# CONFIG_TEST_HASH is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_TEST_LKM is not set -# CONFIG_TEST_USER_COPY is not set -# CONFIG_TEST_BPF is not set -# CONFIG_TEST_UDELAY is not set -# CONFIG_MEMTEST is not set -# CONFIG_TEST_STATIC_KEYS is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set -# CONFIG_UBSAN is not set -CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y -# CONFIG_STRICT_DEVMEM is not set -# CONFIG_ARM_PTDUMP is not set -CONFIG_ARM_UNWIND=y -# CONFIG_DEBUG_USER is not set -# CONFIG_DEBUG_LL is not set -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -# CONFIG_DEBUG_UART_8250 is not set -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -# CONFIG_PID_IN_CONTEXTIDR is not set -# CONFIG_DEBUG_SET_MODULE_RONX is not set -# CONFIG_CORESIGHT is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y -CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y -# CONFIG_HARDENED_USERCOPY is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_AKCIPHER2=y -CONFIG_CRYPTO_KPP2=y -# CONFIG_CRYPTO_RSA is not set -# CONFIG_CRYPTO_DH is not set -# CONFIG_CRYPTO_ECDH is not set -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -CONFIG_CRYPTO_GF128MUL=m -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_MCRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -CONFIG_CRYPTO_CCM=m -CONFIG_CRYPTO_GCM=m -# CONFIG_CRYPTO_CHACHA20POLY1305 is not set -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_ECHAINIV=m - -# -# Block modes -# -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CTR=y -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set -# CONFIG_CRYPTO_KEYWRAP is not set - -# -# Hash modes -# -CONFIG_CRYPTO_CMAC=y -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -CONFIG_CRYPTO_CRC32=y -# CONFIG_CRYPTO_CRCT10DIF is not set -CONFIG_CRYPTO_GHASH=m -# CONFIG_CRYPTO_POLY1305 is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_SHA1 is not set -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_SHA3 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_CHACHA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_842 is not set -# CONFIG_CRYPTO_LZ4 is not set -# CONFIG_CRYPTO_LZ4HC is not set - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_DRBG_HMAC=y -# CONFIG_CRYPTO_DRBG_HASH is not set -# CONFIG_CRYPTO_DRBG_CTR is not set -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_JITTERENTROPY=y -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -# CONFIG_CRYPTO_USER_API_RNG is not set -# CONFIG_CRYPTO_USER_API_AEAD is not set -# CONFIG_CRYPTO_HW is not set - -# -# Certificates for signature checking -# -# CONFIG_ARM_CRYPTO is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_RATIONAL=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_NET_UTILS=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set -# CONFIG_RANDOM32_SELFTEST is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_XZ_DEC=y -# CONFIG_XZ_DEC_X86 is not set -# CONFIG_XZ_DEC_POWERPC is not set -# CONFIG_XZ_DEC_IA64 is not set -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_ARMTHUMB=y -# CONFIG_XZ_DEC_SPARC is not set -CONFIG_XZ_DEC_BCJ=y -# CONFIG_XZ_DEC_TEST is not set -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_DMA=y -CONFIG_DQL=y -CONFIG_NLATTR=y -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set -# CONFIG_IRQ_POLL is not set -CONFIG_LIBFDT=y -# CONFIG_SG_SPLIT is not set -CONFIG_SG_POOL=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_SBITMAP=y -# CONFIG_VIRTUALIZATION is not set diff --git a/general/package/Config.in b/general/package/Config.in index eb7150a9..2df50963 100644 --- a/general/package/Config.in +++ b/general/package/Config.in @@ -85,6 +85,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/rtw-hostapd/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/sigmastar-osdrv-infinity6b0/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/sigmastar-osdrv-infinity6e/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/sigmastar-osdrv-msc313e/Config.in" +source "$BR2_EXTERNAL_GENERAL_PATH/package/sigmastar-osdrv-sensor/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/ssw101b/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/uacme-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/uqmi-openipc/Config.in" diff --git a/general/package/sigmastar-osdrv-infinity6b0/Config.in b/general/package/sigmastar-osdrv-infinity6b0/Config.in index a924e332..539c25ce 100644 --- a/general/package/sigmastar-osdrv-infinity6b0/Config.in +++ b/general/package/sigmastar-osdrv-infinity6b0/Config.in @@ -1,4 +1,5 @@ config BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6B0 bool "sigmastar-osdrv-infinity6b0" + select BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR help SigmaStar infinity6b0 kernel modules diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar b/general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar index 5422e608..05aa5b72 100755 --- a/general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar +++ b/general/package/sigmastar-osdrv-infinity6b0/files/script/load_sigmastar @@ -4,6 +4,7 @@ # PATH_MODULE=/lib/modules/4.9.84/sigmastar +PATH_SENSOR=${PATH_MODULE}/sensor SENSOR=$(fw_printenv -n sensor) detect_sensor() { @@ -17,13 +18,13 @@ detect_sensor() { set_sensor() { case ${SENSOR} in gc4653|imx335|sc2239|sc3335) - insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1 + insmod ${PATH_SENSOR}/sensor_${SENSOR}_mipi.ko chmap=1 ;; gc2053|sc2335) - insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1 lane_num=2 hdr_lane_num=2 + insmod ${PATH_SENSOR}/sensor_${SENSOR}_mipi.ko chmap=1 lane_num=2 hdr_lane_num=2 ;; imx307) - insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1 lane_num=2 hdr_lane_num=2 mclk=37.125M + insmod ${PATH_SENSOR}/sensor_${SENSOR}_mipi.ko chmap=1 lane_num=2 hdr_lane_num=2 mclk=37.125M ;; *) echo -e "\n\e[1;31mUNSUPPORTED sensor found - ${SENSOR}\e[0m\n" | logger -s -t OpenIPC diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/gc2063.bin b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/gc2063.bin new file mode 100644 index 0000000000000000000000000000000000000000..3c6069ff68b1148ca3c7446c7b45e5b86eca37b5 GIT binary patch literal 86944 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 Iu~@AC59Z=#UH||9 literal 0 HcmV?d00001 diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/imx307.bin b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/configs/imx307.bin new file mode 100644 index 0000000000000000000000000000000000000000..dee90f91c4551f15245e4472212ba2ceb272dd32 GIT binary patch literal 86944 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 diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx307_mipi.ko b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx307_mipi.ko deleted file mode 100644 index 12e155e3467a27ec89152f41a88e265a98990bbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20228 zcmeHv3w%`7x$oM0CS(YR6Noy506Uog;T3n10U{MmGGUSsVj}oJP?L~Mk_mat$xJY` zwhoAx({eOg&iMtao&YJLa5W%UtkR?i^-<2biQ*|#dzw~nr9$rw4{^6}&G~<8uRYlr z0@ZWx@Am%g?=IN;zrM$Mee3(yUVH6G?7sZr^gCWWbNS(udl%pAKVbEE>aO$HJlpEe*Ru;K^=Eyo%7~AQz7^3^)bbtM{OI)C>{I$*4JZr>8EStSyG>EiQI3UHM-BJ zW79S3*eJ&FXswjgqiwV^>PyusB-FJY+wxv6k$zUu(6KUG{66)n2VbnIw1AyFZuQ z`?WUvM0eK3pJcS>Z0@$^!wy*`?!hm=8tnJ>*V{1%t+Qg;H?L*Wuv+}PW0^ElI}qjB zSesY3v~LS~H|g~)+IuRSy|6c>F6yj0ipD0%X`Ws!uBShbG(OmyQkUkjo_$`nID54O zaCQ1=6K!#l#wJ;pGv`K>qk6x!H^uWIY&`g7$slpxQ>iSqz)%;pa9j&13-`XU=0mNO zZL5cu!e$}ZOglugzoB-Y)~PE=lLdcE{&W%D>a?$aVB@yLd3& zbFpQ@Gda^mNo!x;xg8U>=A?8_^ynq6vx`5!(=xXEy8P?%9l13B61QbiLq|o5XUCeY zQ@)>5-q6}DpS4+bR1ALEI!N9{(L!-rTz*~}xFpM&2gn8+Yb}?ga~Xx(scp)4G5r%~j-&j^51c!yv(D8o-%(-f z&p)@{PyO&ZJ1ST|Nw%%o-so&Nd^($1GPy+^+s|4o8@sJ(1vWMpwx0G}j_t(moKYt~ zX_UY9Opf)$@+qq($^EjE^)n|dob~>`PRurJtaNHU%DbR8!~UJHH0C9{Q#;5ywGQN? z6Fapx*+-Cf+B-2jG{ztQY5sWSrtui#FQ;s*rJ2~~ofI(>+q^UvG!xd@le%dhoca0g z9tT;)+Re_&D*NK4visbVOmmX5^QmNyV`ye}GY_pGFIBQV~#R0hqU&F(0_fVsQ<+ml;!$*DmllL$%Rarz3k9g;0f= z$82+$1sa8A@cfJ)l>HK#cf0?6LUjK7j5*ZmDtmVHo)$~A6Kk~U@I>kwbhwN%l=J7& zc*m6GpPT2TG0|vx_+ z<%aGXw)T0%+DGe>gq1AMcTlWxFJX;)J4|gFM!hzSqSbLo^DyesDXPzU_7^fye5IX% zwb7puUKfvC#;WKaS{3u4M{8ov-V<7;8o4SSIyJDKaa+?GV?Xd{t$axun6l))D)vQx zNrKvA>$oIK?Q5QCJU069=`46;Le=J+4c+$1Y+{y8n)7V8loVf;%@P{6ovo3#U_Fel zif?$|9g}+)k@xHB9oioIVZ`10`*vtu_8r=OrRThqvqNhIMkn=vyII+xwJ|A)o|+pK z`yqv&#?FCKWu z>OCz<9ha<5>m@0}KF*Sq^|?ivIF32>)oBx+Sv$2Y)Fax%VLXF3-^MiF&c@nAw3A#o zZCE==Ma;SKzLk5Q%CVk2<;beB=dRDOd|=B6%|749`eQwdFK)*3V!zg|wssfT(1WP& zce@Ad7ALMwaBZIUZbE8*6z}czytit6HScMZGit=1(r%%X_Y_ZktaXFYbI2sjc0f`X z=75h!8M>3*Y=`Fl@yp^-p2uqkzswtq^4Rx+J8xe9Z#931)#K7)+KMj@2DUDa>WevT zwXA5R(i8e`C@da`v5h*bj&bHnKUC}P^GH8h!uL9>TKn@Hdk>zKZ0GwP@s~6MDnKy-7!J>aNk7 z3A{JaqBoh>=*|8w+8+6+?^WKPo#FoMM1OXoH%31$4C}|6Ul~^U-`S6szeYdeWClMQ z>-l;8D9_?L#k2P>>(B14DHz?Jx3~UujZPEwZ(6(av=4M+d*19?Yoda;mNm7nY3&oF zB+9eIS85f{70~G zQ|Aruht8ut=iEPP#Uc3Yl&>7*PwJsl+LKd@tezJ=)vL&#{yE3mH+!P)O|ktk(`}f$ z(Wk93C$ubfpJ$=xr<#m?eH`|+_Px?==lec}Cw0x~?;|;Mt=APM;{74MmEN!{9+q;9 zOA@gomgU7hymh6#1x|`8C6Rwo>wbC>M6%=UB(8wG*zv03nZR=g_bQ%Pp6fu)&U3BE zjpI2#a@X-3OBvf8qm037E#tD{8jULo7wevdy0IHz>A2?OT8Qg5T=cZW`%nrSxEy+{ zcG~OT%YTH|b)o-zh0^rjYLy$lTM%F4@Ep~iR#w&=)&5C&2KQ%_5^e0wN44jb98lYp z4P0Xh*@M^*9nsqDPVgQtuc)T?uOnJV#u2R(*B)G5xVC`z ztbIx%xY(C<*pFau38|WO?%6H&EIsA za1|cWdNVR`Kf~{tu5{!FGU(o8q21zz3>A4T<7V71^E-2;BA?9fDXzK5pUR-S%{2%2 zvHWg#%|5M7~Ep=tc&K;GXR64yCUV1ivM;MboNd6Os#j54jWA!4B)$im#%t!Ly`@d7j5UaUQ zOEcCL6c0?X{VgNbnuHitPHHyA;=H$j=I#@+z7sRHT940m1v5r@9*LMS#DP9vpH)#T zzEC~Ax{6}D3^GJz2V!jxunXAchZlg~5kfQr_wZ;viD;dHXstFy>&pK*WPKxEU4@@{ zU*Pdd5txZs9YCGOc?@1aPQ!JKM_VtypUI$@yUg!;yfPkV$vnbR`2AD{#hHyq+gR5O zQRc%?}_-_ zf&72gkN%qLbzz6gSMf-or`I2<=!x@i$BgP~@^Scc`=k1krvpCTiA(o&S_8?i>4}8cfoEYN)tQVmO z_&tF~&>VhOc?5lpXV>H6+4VTZM(5w)*(EEqgOd2OOHwU;#lQ;wO2O zf<*p4>Cx<)hnI1Cq{K-}!le`myX0Bf@AGmK3X(iG@N#YsOPpZRVkWI|`J0KdB;H`Lv*$w_5fTaJq zzy$2aiGCPJ0)Hm(u)q@nKNi?8@Kb@GbKDhDqjfvD zIPM93C1|US_`5=FK(bfKXkG6ffi(hK1U@VSYsED~m@yK~>pgHI{jx zd%x;n52zOQpsKJ^(9f$&*gxY+NE^pe(yVM|8e`u|%VrOz#j{FW4}<<5t}~EFxfB-d zvM`6MfK7B+S+;8|%faOaFBh`Ku4&BU%42yh#`0ZLSpjf~>n2tRT6#?%6T?{ON z-krc@;4cT>1-u*Bc}Uo%TG%E}*k*yS&F#WAgTgkq3)?IZw&~!u`Hsu^HSCiGpZI$AN#ZsN zz(!U!9r+YoGjYwrrNWQMX6d+GxaQ%Sk82_9dn@#BQ?uFaz;9yHtN9t()0)17#iS>( z+>A{4o1Obx9PB!>ZOwjnudwX`VcV&~wo`>|rwZFXBy2lX*!HHsVq11aycw}}BWz&A znGs`VfBI&zMPrr1vE@d7D5ma3JS{*hO+_3{MGQ?v{5*u%nToi%DeMchE>tuJN-N6i z1Kx%}V^gWG!51v8DQ~E(^RhV18ugrdO*2lBq2Qtwf>sKLdW6q1%{I+CdBQa4CaVR! z>^aa^t-Z9SvZ=JPv97evTXhYsI$wjg9Nh}|(aAdB>ZbCbud#s@6s^cm7nJ7bF4KEl z+2mX6ZDL{&^^KLyb>32N0;F7DQMZOw)YO;znJ>MfG*DN*)?4bUWYmMY@&<2dLvuYF z%J?c^3h$zlrbd60&l@anTF1(pgEfs!i&use!z#UjiYA|*`m$)bZn>c@F@Jee zeQ=%MyJ*DzEUc(0Z}M}cMbx#0*@1wsxUN->-RQP1{N_)V|{tGuVRra^_J93m*Q{odh7i`1+!e*+)&q8Ua4d+ zD_Xli3D%%T>54ynZKlFj&6+i9@v>#b%YYBKYrGX}6wGL4b45@o$W=V$zPg2q+A^&r zhNUkkVrl6`EMtBVb7dB>d9EUsj%(Glzym1bTU#FVDwXBIa>W-=sO5EuF@^&c6_gaP zv|G~EmNYd}&B{=#`~kC!d+74To=6?yU!k`YdeVG%BW4%9oEA`Y=U0M_ikLn>#yYJs zX1ErrCzZ9ns%xsD_7Q3-x@Sd3!TcPxw6t1X?Yd?DJaulRuPL~0)iBq6U{(I&>|AAa zv#+i)HC;_t)713zw0UaU11s(+V$A{A$6Hn2To+W}4dwOTApGJC_Mt{fmIj#}gp56> zk-EU66g>j(x)FHsBk*R7z}t*{3bw}lcS~!qcb$RH8XJQOJb6K?nmM<+V!`Uw<=$I#=bx$2QiDCjH&f51&lct0 z^3^^jB_kWPU~V=W6%(CplSa$qt#Q%~(oGhJG*OC|r&yD&;+A1cTeug8NoL_5ZKm;J zV@ei=7Z_8ruvimCzu%h>LEjib$Ft#ml6i~7qjy>vfA9)oN~0NGIoR#E=sS%e_lGrP zUSH5e&qlr(7rhdZK9zk0SG=H0fLn1T3Az&a1}<~^XF%&o=5?*Y`_eODP;AFg?88oTV`?{WFb{UyPppEgw zAfJbeuXSjF>{VmZr)-^xb|C*ME)V!de=eBhl%@B7J;^K?`9I?__dk;sJDzlV(>Z}b zQ{NVWehCb!|4z`Kfwl_z??9ghP2bv#_8sE;9&sRMbiSY`nXLz7GUzfe4E+|9ob>4& zLQgV#3XJc9?gYcocTnRz>Gdln`Z?$)g8me8L;tc#PW98dhMr{hIv7!)d%!UCdrWfD zr}Gaz$?SbFj)FGk>vy34D`=W0qx{DveJW4qC3=$Cmtg!3bQ~Cl{(wnN`gE?MCz*|f zZNG@nw}!)3A3vSH82U-j9}PMg45R)Olbq_Oa~eI#EC>2?K|8=O^s`KI(x>wrJ;}@q z{l%ckq@>>ly1+!g0lLUUp8$QQiM|N>ZqWG4%in~#U1gFl0$mCkA;aYlf?fmKu=gXN zn@#%9fnH~#-vIqx6a6dD>rM1|(2tqun=p{S2aUhHy#=73G|BG;{X>&{E$FQ#`Bu=+ zndpO{w}Hmd3$O3rLB9gph-VAtvfHGe0s1Y_w2~V3KMqa?+=BIz7qkDD>BXHpWk9g5NdKc8q;J=mZon z=5LFsJk>|%dwP;tI`p42m8bT5O>)ww^FKYwtQh(qg02C>s2|5ZVL9p3Iia3pwi^12 zK<@#=(Er#ZCw=2Qku?4e`hSFcib-Fui|#gV*ET%Q^rX)Roj)2h_1{6k%9Adqb4i0H zd54Ln_UXJ*Pcqwp_J0ieH870+p273jkdr>0XBsrsx0Hg5C%rv7=QL=N`)P7{(&cpi zY0xC^4R32?_9WW>GZy0%@Tq-jkIqT;B(s+wj|E+Wb<60VofdDNWY!CLUqpF2Up3@Z z)jKAd>Zfy8J?YQ)IX4Z_Bp*svZvRtZhE9h`tdhg^M{)i9u!2s9Np?M#57Ds^^opNyb?1e&_L6xVpHGA~8Q-w<*eug}Wf2HgQ&S|4Ju z3;h?+Uif1x`bX`37E%5}1Z_cV(^&QLH?pyyDR0m=&{V{rZvbs18gByVL~NoriuQ^k z(>j?T!5%gao=-BYuq|e_}(4FX~KHhjXCqmAW zaW>_~8@IplA#YP-RTWFFWa906xi?r+9>mE(Ls4U;S69pP2Ji7zdK;H{19#wzju$oY z!VGtFlcA^cP}y(>Ki91H`F-j9kV!vT(RITj*A*gDHT)zew|Hqp8NE6>hrCjz*EdXt z&KKiQu_4?`69t*4WVtTU^G2JcIO0ju1=)*n{upcy+|d~HRjnI|C)zWWL1o#C?_Tb$ z2!xxBq{9tk#6osuJ&-|fgii4W^2&W;Sez{KH58S%m|8V)xvDrX1$%i-GtGNJLsg^R z!GJgD#$j(R&fH3?QEjO{UB2Kt!@YLo z@~B&Q-pF#)e@!_rPo8y+;#`dH2!Bmw#6j=|Om01LB_^$_cjoF2enq7thRGFLLym0z ztirj5&t63Uf4xG2F@$|}Bq8~LnLo1snl*S&hI@grzR;<+;h4q*Ur}^u@~&RZVv8XxGc?1^cC zr_O~9YfPuk5H1m+Y*>~*Y=*bXmq`7q;5AHPR6sMD+q711bD7>{76>*~_}4LSi@&jS zS^o00(k5>;X)W_s`vO?~b?sdK9dB_9D=iJy_yVQ+m%O3c3ew&8;M+oJDL-b#=bwjs z4V9%8et)UINxjBrM8l-~0fDbeb&b{dYUwVoFAm@fPeTx&AYs{tX1~#5xP`h(-&*v7 z=}!s%VNrZbysC-xdW!%3mSsqY@@I{z3+-7!9PF??lg2;u|f)xN`ur{5JZUs_u4 zt^YQ*QS=F}yuP&2kFOd0(_*;uK6Kt}VFEXTlV`?-R~u>=@w!%sb(Foa+#Ni?I`gnfSjF2=U{- ze!^^=Srg(z#VJDAdjJ^oI_yped#ps?2~WkBdM5<^F(J+p`U&GvA0hns6rmII zN$5hogc#QaLX1lzoWa;-LiC?r+T}FNGa>qKBisUiCd|dVG?30E^R z6-S79atKTid_`a~A?7KCuoUNygk^|7!g9nP;cCPmA^LeMA^Mp`Sb_6s!aBU`6IS6} zov<2yMp%R2brJd)TS3^!*!_g<_~t<9XRMMifHNJ!wfLSw_z>cmumyfb2)jNFqegD?-{AS}Q*2$x_S zgoPLfA^h}y!Xk`=@D7ZFuo&YYEWtPk@5DF=mth=)OA#-G%kf=>@Gizegm>f2fbbr~ z3*idH3*kz{3*mi;7s7iHFNCWQFNF6aUI<|y8(bykUH$Ac<_-M}EvAbx5AlD2-`x@Z z9Q`MJnK4Wii+LOUBkX4E+l0{DKnT4j2#>(tgzq2@384p5b3R0z|F4373P|hX8A8O# z03qytfpC=m-A>*IzZNtd?8yHFzb1q{3H+Gd@IOLSnkg`!^ieORS=3w1V3)vy0(%6$Bd}NC34#3rPYE0ls0qX|9v_EIpk1KDgzT4y1EQ^r zDT1FO5I=y^?IAErV7|Z-fhz=-39J$57uX^&BoNcXW+BfL{FBlwi;hgt6c6YUlV8#O zS3a!!FU4;h@oAkFaxArshVl+iVrHU5+2jzM22(SN;KqILY^z+O9}r)_j8hC z$>HT!2zeRd&#-z=AQ~58B=Hj<%sd)8C4SHLGdX9GECeqsyCh=3SRH#wCR759zl`TwU zAxVuW9o8`m!u6oGaOJ~l942U_ABeG3yeatT7%LS&H3Nf&mX?~vyHZ-pH@kYbbZx4R zMv3FCHH{4w-c<8DPwMJGfTdP6*4KNnHBRLw!T-NBHxMkZSfh^y$E8ia)y+XK9*18$ zO@b!ehZ(NtLY{oaNLGo0c{CDEnVI)H@6%1^JxgU}2P3(b6;1^Snr#48> zhKrsT=K3z9E*mjKGV03&ZLV)@F7{~PQGKLi)VB+HbA49qmB@FEWYm`jhPl3Ds80cp z>VsQ`>%*gz*Js$J1oe#t&qzjnUNF$Ee}fR*54~0tGRhfx<&c}(J%e^TphWEwpY+Hs zeq1yTqx`2dL8e49N`H^b+%D-+d80i89|O&H z(xZ0Cc9e{EvDF&Z?z5(LuNQh$4ok$ab}yhl{JcJ#3_Bc;&`VBa>}|ssLPmvtBl6_0 zlujq%n{I?2kps90jr!}7v9|(kBx4+Bz%biy560009@#GrmtjBJmr#AilKm;_Be{`` z`ZO@i_0{DM&Bu+98TE}qW#;diTNr diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx335_mipi.ko b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_imx335_mipi.ko deleted file mode 100644 index 6c56c915d0c8284fb12c7e91cadf4ccc93db1d71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20688 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 SUT25MRl+VS3?_KS?SBBZT!7L5 diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2239_mipi.ko b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2239_mipi.ko deleted file mode 100644 index f41a9d221c7fe065141783d3e395660924d7281c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10432 zcmeHNdvH|OdH?R+m9%lf5uy^Aok01zS6oHCpnj;!=sG5ul6^f{UB(j2@ zk7_|}xcff3=kJqCUOcoT|C6kTe?Rru&z`%y^LJ0$&xoGvmW3yU+k}a?3TSeyz#e`e zC0=$4iw5gM+Xjy{kTZW&kZS7eBOLmia>Pket}oWW)Hmwx8l~Uuvky7#K9Y(?+orBN zV-5B*(AAt%o^~FutAhT3J=eE>RI_0V`-tY7dA|1bjFvIwY5SP+u1lQMyh(~R&?vW+ z-SX`2%o5u<;X=#F>`7lq#<}j2j0uZFoD>{1DLQh|reS+vyXCe;7k+(Fm=ZJd=HxX| z;g3=`P3AOb7EGjs!Y}vaOlCFvK#PTzNo#XAC<~-Q;Q=KksZr1#_xow*z;^C&cFQ^C znDoG-?>*|iBosIzr>{M-chzV{W6g(hO}qR0$NzcVC;K8=P6mtTP}P}S54N?PQ9~Fa11CromC^8uc{Fm<@UJ< zw<%|=o?Oqt?X?rnU|e-4DQv||E^Yqj&~O7e4k|I{Gw?ipQet`L!e)!3%=2dGwFW6% z=DE4q>dea-2W)*8U&u zyOb}yWOXg9-#l2Rh)cd+XE~>3T$s!&nVKLeW7s*uV>(^@ric5ct{<$#{+7o*t3Q~k z9UQiP+j7}%JGgzR=Vnj6CqHO&btu*)?u~!t`OZZP#XZ+1q@eJ!KlsMARMc|z7)Fu# z&KuXJZcmZ9$(s%BFXs3>hTm-HrhfazwLRYK3vHK{6d-QeZ|qbqd_HT-Ip5sE^0ukFY{x#e z2>*Dc!M?2Er|i|1d%hmJqpD6Q)U^!g-T76=z=Pa=d*o=x8~V;duK{?&Q*9;X-|(IJvAiV`4chgRsmf{P`hr z{M+Zu>Orh*eO4VG=38B#_$QhRxsA#C~m6< zoBGt>rVekv_4RFy4>s|fe`j)Alhw%-tq@kWO^G%{>};D_n*DxvhU3K^OToC3a#}CH zMr~IQ2ga2b?BmK&=eY7c=leb5N-QPgInX|?3_*7k^;idNP+vhEMm^#iSDt3Q1l^Hw z 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 diff --git a/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2335_mipi.ko b/general/package/sigmastar-osdrv-infinity6b0/files/sensors/kmod/sensor_sc2335_mipi.ko deleted file mode 100644 index f1f5303823ea7e5eacc077a795a5e05a7e4ef663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10556 zcmeHNdvH_No&Mb`Vatzzc!U^2l55L=c{#FWjG+N+%g8SrJ9ZwVB#~wL+7if?BFV&L zNf2PbP12SS=$a<&LPbEzVrQF=XuXP_n56~)_Md%AR`G>K;w*PM!u?efy&iG^x-!9fYaVeQo>@|rVJZ9fTJ z`G~U5dAPC+`W^PH)|Eq=4O`exX})Q1RlGW>{W^lOwJw@8(y?gLsKp_U2@V<)9a*T?u-~!4vS9YP-&_!qVp{gp>{`nE zd1CTdW?fqDXhO*QvYa`VUe}7Um}eQY)^(s{fmF!bp)^Tq6x7LW-{~*s|4!;)hI~xz8 zM~4HJi&Qab`LPcxrt}Yq7qcw3y8fZ{w%0DD=iasLonvRV364JHE@#;(9<#DjG{p6D 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 diff --git a/general/package/sigmastar-osdrv-infinity6b0/sigmastar-osdrv-infinity6b0.mk b/general/package/sigmastar-osdrv-infinity6b0/sigmastar-osdrv-infinity6b0.mk index 9c37cb43..71e405fe 100644 --- a/general/package/sigmastar-osdrv-infinity6b0/sigmastar-osdrv-infinity6b0.mk +++ b/general/package/sigmastar-osdrv-infinity6b0/sigmastar-osdrv-infinity6b0.mk @@ -12,7 +12,6 @@ SIGMASTAR_OSDRV_INFINITY6B0_LICENSE_FILES = LICENSE define SIGMASTAR_OSDRV_INFINITY6B0_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6B0_PKGDIR)/files/kmod/* - $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6B0_PKGDIR)/files/sensors/kmod/* $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/firmware $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/firmware $(SIGMASTAR_OSDRV_INFINITY6B0_PKGDIR)/files/sensors/firmware/* diff --git a/general/package/sigmastar-osdrv-infinity6e/Config.in b/general/package/sigmastar-osdrv-infinity6e/Config.in index b14e010f..0d62fec3 100644 --- a/general/package/sigmastar-osdrv-infinity6e/Config.in +++ b/general/package/sigmastar-osdrv-infinity6e/Config.in @@ -1,4 +1,5 @@ config BR2_PACKAGE_SIGMASTAR_OSDRV_INFINITY6E bool "sigmastar-osdrv-infinity6e" + select BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR help SigmaStar infinity6e kernel modules diff --git a/general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar b/general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar index 124f1acc..b9bfd6a4 100755 --- a/general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar +++ b/general/package/sigmastar-osdrv-infinity6e/files/script/load_sigmastar @@ -4,6 +4,7 @@ # PATH_MODULE=/lib/modules/4.9.84/sigmastar +PATH_SENSOR=${PATH_MODULE}/sensor SENSOR=$(fw_printenv -n sensor) detect_sensor() { @@ -17,7 +18,7 @@ detect_sensor() { set_sensor() { case ${SENSOR} in imx274|imx335|imx347|imx415|sc8235) - insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1 + insmod ${PATH_SENSOR}/sensor_${SENSOR}_mipi.ko chmap=1 ;; *) echo -e "\n\e[1;31mUNSUPPORTED sensor found - ${SENSOR}\e[0m\n" | logger -s -t OpenIPC diff --git a/general/package/sigmastar-osdrv-infinity6e/files/sensors/configs/imx335.bin b/general/package/sigmastar-osdrv-infinity6e/files/sensors/configs/imx335.bin new file mode 100644 index 0000000000000000000000000000000000000000..2f665cdf234c97a33e90c3ce9bd8752fa023cdd1 GIT binary patch literal 86916 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 I43g3R1t?4isQ>@~ literal 0 HcmV?d00001 diff --git a/general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx274_mipi.ko b/general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx274_mipi.ko deleted file mode 100644 index 90f1935adff3f288243b7b335f48ab45cd89b429..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24968 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 diff --git a/general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx347_mipi.ko b/general/package/sigmastar-osdrv-infinity6e/files/sensors/kmod/sensor_imx347_mipi.ko deleted file mode 100644 index 5f91ac2273286edb6f02e31c1c889c07da1df197..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17704 zcmeHt4OpDTx%TW2gb=KR{76uf7nUUCk1S*jBpM4WS$+c;qD7;!o85(70_=8oNr?3* zCTKCH7B!xOHuYe{nxy`anAoJB6lzIMdg|#RMo+QrY2z_%g0<&@1ogd)pPc)dci!b? z!RqN?Pb9hOVg+m%kW)d?Z zJsZ)0SWtE=8{GE~WB**?UGlF|=fB){^?lnqPy9KTN&W)=v8!yhdZX>94QaMlJsky? zJ!!UQ8#)SBd0Fz?a%yUtt)rlPcr0U89i`ru<7VrY7|sN@vJ~P>>X%!Yzh^*hH#2F5 z-Cr;uw~ExRI$cVi+#1iMUGjTqX~mFiHQLySIm)nvUCMai_ZMdl8(BGfik)XaE@z9n zZBqRb+qc@XWaF{{d3O8h0;yhSDj&_;xWuM%y~%p%CH**O;IBpSA8B|#$_F)^>c=OH z*Vlp14s-OSW$s}n^<0#9=@$Ly!rn6d;__i#4A~WY*tq&gn`+1ZUAqh`$+9B@hQ%i? z_{xm1Nw3(n8#XnT9 z7&ASH8c)janQuJ&HdX=22HXEP<-TW@>gl~D&H3I=tRZp_twb$#-SRV1xBRp@L4U3B z@gs)OoK>@|?ecz!NwciR;>SIASdAt7uNX|AIQHpA9hhY|8uS?3fx zY98~@IPKpm)$Gj6?qwq}`dLX#id(j)*LY)$>1UU9xn1(p@jtsfE%`S`y5wi#yX5`m zH!ka}U6_qGE>APPh1`eCI#ZXtTWUow)baKoD>Pw-q$pdQ?V&ou6}|qgp|s51dGiJz z$-Cz4oZ@&-`RJ#CVyo3kw&Ysb6@x^U=uF+tZ#Jgcj=CR$wy{rM7(;)1NG8v^KX3XV z^$-n)P`*ZkoHrH|QIqvw?^RL`L(a#j}#5h|N`U!tDz}CRop)}p>l4tWad*%*y=FL7!z5LW~x9YDL zN62T@o*vfpbU*LuE!JoArVZ+^u#so;45*iEv&Z~__i&iEx2ujx*EZ0c>P++%(Ur{N z^E+p56e}NXacc9JaQXhn>)4EJ^VF2A)!Ezk{LF zr1}YYSj`_*PcI95deM}g?tE48bk&;`)-}P?yC<;M!;IdEfeCC-u&LgO&}U!#PQ+jo zOeOS%o;>&ax4LVReNxS>Y#~-Xqth(=*BcvwJtjJXhN#|3JJ244!ZZUh?u^d=LC$-TANk2fYVJ-D97$eA8#>rP=(QtkN*ka3XA zE%v9J^OK(<3C9`xpYhILi?&uHssTHva-%Kn@I!U0Pxy-bg{pP$oNFvGnswL@7-HDM z^5OY2l05TlIUjc{Eg$Xko|0RnJ3Oc4R_SRx+oW6MxRs~m(^9d=QFKavQ>v6_gLiP5 zeO#uKuU3uNN2G0e?%Q$6RVBuegPG00gu>q5Q!*rjFL24|Ipm+{X?_2_sjW~^pbx0CjPWoRv?|tpPMYpk?!QrD$6pY@8nOr zWhv4w{`6RuAiak_+bwBGS6K9DHDML4Mg8!_ROI>jGh{I#-OQi&T2hd1;me3!e(X zr|j^lA8UMS%Y2jYD!mzX*Jdj|b<-O+!c%VMl8_i3ZiE+Q!?(7;pWt2OPZmg&?Gk?W zZ}2NFy|Tp2{ptm@nomA7l<*XM>?!gt@)-+%W^-@Z#GjqqXYBl0WmycFJNeUPS%kEQ zKlfM`BHeCLJ&L@@&pju^pUvEJ?&Z%G_)ovw#-FX01xWA1bF=4%+@towVaT6;EF$^S zFOmK?#E%jGT0!+CT9fLEwuXJ_7w5d=zJxVtqAyKelQv=v>Vnstk`KUZHe+Ra5ngjQ zatHXz^mc^TRQ_kZW>ev$Rf&6#x*~lg@5%mB?=es5JY!0tK ze}qG*{t~NG)}OzYzxabcvqg`txcZm z@;mbupVei=WX3PKe1_g-qm3lKMkj``(n3VT{F6Hqf zI15<%FBg~)_0P+{#7_2k`5z@Zcldh}ZSP*7y&~O%{P57BLo0?Z=UP8b2-4o&xCplp z)2tuQ3cMsUGc&y;8>N?Iz4;|M+C0OahEq+QZ4K@m(&&_VSjRn3ck`t)J&>8b%s4By4 z$h+)O^YlD#l~%Xs})0^ltho;3*sR_Kw#~4IrTzPW?t8i$bx&M66J3~dsUR~ty!SEC zIN-Y`!Ivm>=^6W~E#Cf>Tl{8bR78t?Xoo^7CODqp`dr=&d-U1p!f9a(<9iB|bvQLKsbkeF`zO5KEvOg6?IbIwX{2L% z3QdM9xZaaGGG;Wlh=7Tjq8>?@rS96MRv(6QV!h>MvHO9AI{+3g|`uNSoc78H>2j5Hch;{ zySoKV0S~nl3%*I<-2xkdFU1^gX~t!9clUvoK7lc)_(SCH29lmf1)k=3pv4@e=sf^D z2)V>)g|~6+Zh2f_m%!r!2Lyg7a9H3aAhq|*G^M>Rj)z*ZV?;X~yIWot_@=;%Kx*GS zUBLsuSHOp7D0tJ?6tu@HdOjq4QP;9@rqbRYf!(j@TdEQiJWYsk$ib}yp`YJQFxCl- z!&nXQ{6j6NxS;Poh6zxtO!I1UmU+z$8Fy9P zwt>Mq$>pwbG}VVNGyzA0JLC?)Re9*{ez}Db^lp`z87oIDGwTEr*9op;-iBuKib{8= z!V!Xw#tlA~oB6FxLCU+$>vH=xx`TYu^UF*5#5+;ubTo*rk{efh9F4AeceOHWEEDZz zn4_859AFpCOW6?k9f-FhR+(ei7c20%0@W^GeRa@XGeJuoYI+ep=Ihzrz`GFd#Owco zSz>=e`pY%eL*uv&tzo+u#zK!6XTFhL1zXML9CjNtegpPbLHq4y1N({jZgvWJzeF4~ zm$P@xF4UjR;xqKDG-H_EkrB;289P~B#(nG=qvZs4BG{p?Ys=U5iA zM8q`9=j<6v9ouhtnsr%rvmaO&WV5iEDi<^1+T38!TiYmYu$GpLSLG!dNpAnz+lp-Xwma~R ztC!Fpzqhe=yow^?Z44>8wS8TySRx@$;{BJ<|FD@8B*XQ!!=u*sHHG|5A&CY{>@3E$ zOpp(2QOEVGXb8(vZI|2cZgd6LF-&8Fqt@$OXGvd^o^6pTH&jUefSdLt5&{n*qi_t(1m8<5?oDNzX`!8%@f|MJ98&9b3Fiw+P9otQEN|I(AxajBdIQYVY=j?9Lr$3J{}SP3FtH_j>lRt?{TbTuNqdn8Z#b|NZ4 zX>YemMR|z+fQkpDoX)r^--5&r@Is)f?{!T%*-vL-CFmKQlYbf^Zw#*&ihepXtMU&a zF&&(2B>nUo(Iem_Li_~qyCB#OaZdf|qe31OeRS4V`OlH~Ik*R?+Pj1@H8Jwnw@9H>1iw4*4PQLS(4pn~J*{ zwVdSX4oBq&AfExQ_1_Ln`AL-D4(CzFgX+`Wk6NF`GZbFN^z1#zUzmw+Ir6Ff&%i6e z)$yN>cl*!ie2pki0{;_?W^`xfICoskB}#O=nhH=%6ip*)i|$) z{Oy<=3$n-_lBc^WCFt2bC|?Jj3Om*D8oheFyc6Y5p}y*WuYo_Q;r|T&9St7>e^z6E zG%7x(DVM;X14kElduzeJ53c&_t>6p6Eux(4wUaOpO8?GjIF-{~n-Y}rQhM2WQ2I-E zZYrnwdR@b*KHbGBL8*`9U6@lj-O(vQDfehNm8*Am)Faa0p(!Um9%A_T(;c4@6#3H{ zPWtHXPg{N+#zW;)PIrP@t}>b>YVX5vhQh;?T@~@YjOOzBVF87QDQ0P+{Rt6#ZUj$? z;IkumVg#QN!Dn&arc*7L#eDDwHPAG-MDTBepF%#}na;#2|71k@D=LS7&%`R-qjJcT zzJH3~=fNq9;!Ny6K8q-i3V+L#`ZK}FTv~4u;Kh>QamY-77W#H}h4m$|OmJGRRQ)#a zgIG@rVP69Lrxtt!?{lf(-vOuTR^|T=ocgNr6X0r~{+x>7?+C8S{~nyaRVu#-E@}9A za9V5C@)1!VS$w?Y2tF3UucjAS1hVJ)2);Uk=SOgR1pih9e>8&Aw^|L<-mBmTfQtP| ztS_QG;@U2t+^34mM3x$2sW|6aadPtewz~tqnwm)$4P`j|a|v8Xl;gnPs4(0-Xc)?D z6_sH*q$gZw^7^^!aWxQX3YPgo-kKeX?8H2AA;ND!)h2V--&*N*2E&a;@^G^-NR&-d zgQ6)dg4Ma}3mjh2B~CYZ8#g$bHEn8gxv03uKz604iLP^t8f$#&h0Da;$zwp}{5qs4 zKU_%nHEM6QW`^^p9;9$FH;@}VS>@zG30I34lyE**r;Gyicd|~6z~ok^9GwX|{ts@$ z`RGJkUQW0?izpL!5G9yeOsy^XGFr{7=g5184uP_UZ+#un}wzu#uKC9C(rg))ZVs=VQ@F7{zP{VdVJ%K0AruS-j+Ddd!GtUcL&7#1pXRGa4>7 zo!N=ME;yaZiI)MXoX*_D-xNq^R^rDIshrM~#2bNJpWx>OCSi{g`xy4FKt1x(2+`JZ zLg>m7<#hI<{Cy(7lduBz5mI|V(vyG#e(b|IdkNep@U)tbJrwC}CWO9w1#c0&P2e7Z z?E?1_qKyv1O4vcT3BSt|V&m0Chzp|wgg9rtNO&85lPCNJV@C{t zja)xr3eFsaB^Xb_B<%SKvGIDFZ~=bvBV5MVZwYV5-{29hWb8cQa-4YyGqKkv#JJF= zkjBMNh;cbB@RC3Ywo*Qw4QX6X6JlK66nsGNL4m&&cuwGXLX68rLd?g9gcz4$LbNeT zh;fk#5kDg=gIyQ{8XqGe#wUglF^&-95>I#y_PB&;*qajKkEpIA#CS-A3*k3}%iuSJ zcfxN7F&<{Z(Y40gcy&{1gFg|@fd+| z0^C8;|Z;JdsQa<{9Ng%q+Vh<>1r`Yc)XPnsY zFlM9t=g}_Vv-leU!bg<*&e$I)_cpPe_}yB_wF)_?X0cruSHc&Rzr!cF*F^p)kv~9) z{11UN?!$zzbCmG!;Aet=MtCW{t@oQ`$vfK975>leueT<;y+a04=TqJ z&&#U_QEn&vd+ZwsQSKo`{dz)_hX|h$cEazueL$K&{S%D6iT>*!2T2d^Xb3sB07C%< zJ!-1a7jmc9Ha4a6KSWxAU!K!(PEQZHn?p*9HmMrwZVprYsGANk(o0no>UA}P`sk0- zsI`pr3?@n-m>!`lTt!B}$5Vi7oS1 zU!&8VuHEXVZwUrjy3^Ot;Kmj(oev3q+*=V0IhTkkUNOs{HlTeJ{j)A zRM)d0O+KRrqex@|F;xsx%mdB;(b<9kRJnAd@fqZPM5Qvm!HJk}x~HTzNG=8upWX@j z;^trvKn;kX>LdTu>Wjy>un&2pk7QJRKSEk-U*cSRE0L!LRbK%zwE701PeLB)qrR#7 zutnke)N!#xANj5tRDEt_pk4n?QP2#zPGqR{R5=IAwe1d5KOjf#Qoh=*A8BOs^&P+x z(WpaJCd#P%evwv-b|fJ~6G(hw4|@1l7KU zqFwqv@Blgd4+pY|V!Du13sSX0LWat2h8)@?x8{N5GE@R2T@(m4-D6dd8;E5L)5qEn ijfmtA)YotykWO2v{XKPD-^>WPZj4Kr+8D~zpLI^=)h!`M+H_3uQBy5r;1cGfoHwgiWe3f6-lPt-GUC76pY#_AW zYgDRS>+M11oKm$d0=8(;1_i|<5!76zYHK3crqybCN-tn-F9?M_V&(k*^Uk|@vk4e) z_1^x@kHL5U^UU+iJoE9)yfgF8#M?^dyDb)rFq}oCi+)OozIw@ta!E)RsUk(#;ZMY4 z!&7?wQW14q!_8?4YsY4FPC2+X`OWK3?)lkjp#@3+7*4e9QueVa>9`O@8w zG;A)-_KTFmA%`Q~y}5MZiSwD+tLQr%ic7Riwe_^D7OA9#))iVW0-Y^;>~2wSKk1B` z>K=VE+E#QXq4_R-}3GZS4qjc84}Pg*K`>P};I53b803=Pvrl zX^lGRv@lj@DB5W|VY6AM*}HAitlgGrN&7{b(9)_I|ISsG)B~aQ@j|;Z^m~-xtf4!4 zw5}T|WxDV7?=9{8k7%cLdKyxC0x2eS+oq4}woD)0Ez*!{r&dp$)RpNjmbtTaoaih% zVUg01sQmNMq7zozS^U~;r;o<(DN9|yYIo?a_}!s9oFlCTAJ__ZhwgEXE9wqya$3*X z#E5y_p)JmM-}0hu4Nw2|o3}akFFgItmgPm~&whHo&l}&#=K1VYVq_|n7fxkA)3Hnq zq1>a~vwOb1YEP(76W6%9WeY?XePluTOHuxR3H3Rj-=)>t(xOgoM%b$e)9S6D4u&c6 z+7%_zzKt0F68gO}Z`Wbeu;xC0w(>kfe~;P{X?n_fU4=SnJ?*PHLO;|xLJv9_epFO5%V`!@;v@u2YdH4IiQDm>!dd`;i&`7qpka<6}U`2fVo>A`gt583IMwd${pvvYZY3_cIbF|+II@C z?!BjQ@*zh>lJD)1!)2eg@bt$mSM_{lDsps7`u?vtN@oWDA%=Q$UBa$JR8JHPQ&#E5fIG7qUu zkD_)`55z>Xtdt#p_foQuV|>V!avk)4?P9nh*Z|v zGurmhzoCv;Ke?SF)BaHRyQ8!vqmJU-QT=t4GP&ZB!W(_*y;}>X9O_0%?5LZMZ%OL8 z?AoF;J=XO7mpLrw>?c@XtR>rLE`eCy&XRT37T);gzhZlaCZ$ zA#2J$bwm$S?yn_t4ZSIAs8{Cq&Q(I2&_H{#U{n}YZK)U|ZR^UhQDWig_8N1TaD7$S zDuh;1ZL4_5_u_GDcA#`=(R*W9?mLiVr~hxGmt7z3 zW#vQmvYMy$US{+po!UO2mvs!F_Jt|-$L;}CucC(Pj~o7W;rA*bgAL{Gk4>_jv;s$F zvG3*XUlg-#<@V5zRSy)fq{m@pPhPYS1|s_4K>M2Vci0#E;BN2vvl}jIUsoyn8l&uM zq;9){wz~p7Pn@%9W*ZClLNtGODBTrlM`mlIt=Xkr*(=`h_1lhNTbIqVOwE;VrkMRH zX?QbQlJ+m&P~uP8Z#(g+ZE^eJ4G9}|l#1taJEO`Lp3YujFK7SZDDYQl18NTpzw1=sWL+V9mo-cg!s9kce9uQ0CzMpX5Xq4n? z<%f?(OW!0V7m}&ZMJfenZY+GT+Lre6%6&&iNSUj`X;ITesp-9h2am=ge5f*Bx9DDs zpA%4LV~xuD42)sjYIm->2X*T#%M90TOegCodTOy=w__&H$Sf%p*UV#WpjI5|^S)nm zL-pk;-}jb&^g?D&wJmjYp99=)-au}O#9lkM5}}uPZa`@8!PQg?49cx&7qcXfZj@H^+T2)b9M2?;z$(&*OK4 zb5SVnYX?IIor}Rsopmtu20{`MvKb)gX=DI_*z$9QbFd29gFcG*M7!O-gAg z%wLZuX7ioV6)JXIGp`H1{+fy|w9-`g1Fos?yU^ZUp`a@r{#?h^@VB|HhJT4;3jDXa zrog|&F&X}L*JSvYI~?$Da5><=$&m*CdRH3!)s9s7A9kg}UkfXl;Oh$c92&yzmA@Mu zli;s(SW~->C!`(>3e`P`!CPwwvoQ;?p3p%^Ovs*TgA`& zeAnBZK3YXowlB;5Dr};~_bP1SY5eLo@oH!vEa2790aySfx?mScUwbvwAwze|(2Sf{ zLwgbKKzOeVe^%u!O{|H6nGR8#a<)O@Z}f!+IRsR>D?nu#rUA zhzmBN#hkRnq|-{;({q;5N@kY8N|wP&N?;|+U?nB6l4Y=x5?IMHSV;-2WErfa1Xi*P zR#E~hSq3X9ft4&%Raru)c)se%niTX-GLBe}k?`@VCj|TU`_3Z9h}eG+i$U7RUx4=jzf2o3+sBIXny`I5-{)CicY0_aF=EOzU&c&Y$kNa? zb7><>LsNhooNtG|n)zyIJFpPA1Ly|s1kM9?1Fr`jHjf?Jf(jd3KXofx-fB(VhQ8{k z?K%z{Ii5TgHBya{qn7ppt8l<7;NMhj$;qcpRHx5e3Y&;ISr$_Ut5^!FD1%ijg;kWn zDwe`3%3u{sVHIVtilwlMGFZh@SVbAEVkxYm3|6sJS;dHqx575T@t|0?@Lc)pk}aGo zf0xL1u9m;GawPD{-+SdqFjV`qoddF+gR+I&0CH4NN zuts!sohnVkV|_IAORQ2J4ZWsuJsRjta{uNi=kXl*e){<1k54~-ssK9-EnL&tr-+lz z5!_>VA|#w5?TL_Gdm?0Ya>YNYIvuOsRqoktzUdB>YP&2N^I`ewM?Ia8NyPpFXI$0} z_M^0F?gg|?`)dz(8crV#?TN$ANECKPG_^CLxgW#M$lIY%n&v*`f2;|+B&+Nx8ume2 zuqUx66dFUnNLzTiZ_%@>#eE(ro9jm85OXyaLkteCdt>^08&H;nZU~qo#5$WbGZd%aUg8i=Jxf z;T%n9Cso`B5O@0VvkRl#pPv2X)1u^Q-B-;QQx={%zYe=OvAaW}eRs&(aj+z&XSuWi zOOD;OI^!eM@z}oDG|L0&^@Z*m+(rIL?i*2CBK7tGrC`I_uqzRSGNpX?;BZ>c6BZE(Ve)gU+<=2 z>J1EA@76(j$6l`M{Z)Lw-sQv8JN$mMZjj!Op^xsz3H^GLhpBh?_PlVA-q)ay?tW}e zbKDRcKRw&`iQQfOym)AY`>F*TIcyj?_Jl;o>J6`##P%fVF$is{TlQ>Gk&1%DZ|v=_BqSl6ruY)=zSr1 zpzdSmhS%OrpHp{fgzh8IyJg})-H(4sx+g{Geg%5(&<5(RAExex&spv>g#&GE2lU>Q zs_RaW`+=J=XG?PT&)7a|W)_W^S$JNSc4N%6cDa{_IT+_(qujIhh{@|$;meIB$&Hy- z<@vL(pXcl;-Ti}5v^F7jd+06f5dKQ-HQPFzokPXh6%psRi1VH)4)^gs6CyN=Wmv&(XOM~9#~aUnl>9UUF*oR@cWJl;N!__(EgjS6p9^fQWnh4@oz zdxnMbJKBQ^_W^$zv#b59R)%-97b?6};*RzsK=L>9zjm;JO*U zrUvhf8c%DBw|Pd(+D1>yjI~Y8t6Kt|8t;sP`SYhwFPL9ZP+mNJ`XaBa!@^d7eeDcS z{c4ZD_C`IoRSiwGt@YlUZ!9Y*DE_+=)K)O{j4WqXmNUmW%Q<^y=FQ8OEfCqcE@xX- zW{xvIb7ozjg%xWG%W@75%MOQS&77UpmO0zy$~T39Y|G4d69ZWwsTfiTb9$6tH;yn%vo6m9id-j4b&~NX68VL%cXRPew{figQ=V{ z{{k(g)q3kZt@S~eNwcTH8}v4#D@)hW@nkza9BcdyZM4e8-e9FC2${wOO|@PTC~9qC z*fM{uw`q~LWl(^$+Tw-trRCN@xW?0<+L`^T%I9gUt@l>xCM(1grx25!F~Z?|O>A^t zBklve2+s|8DiN-`M65Yp1Hq*%x3 z@Sl`>4`V0Oil!Hb;vy!=M`cZa4DW8&XMANrzReNUw3BRYDuUwRGYky29a%I z$|Kt@?3COo2qBw;$`UCz0z#}0qwXW?&;=%6!Br!BVv*3 zHnA8RwD-)ki$`W!#lD<4@kY*K@rxWGewi~@bm!bFdf{Ro=5V8*qRqDw&jfy+wHW8n_#{2lx!|S>Rsazv0=J_gnEo z-Ue|XuUNd4_bt(dcn9-3#cO!%`3FQ)ezb_ohrQ>aG2XrrN37i`~knK-qYAWG)ArLu*^m+FQ`tqtMzRw6+DUeJxsh^rhDR zhiPqBVEAJ;TifBRmNQ(=bkm)840;#mI|Hhp=c<0*iKXhw9<`F7PG)tn)@O3iB-PIdO%oznO<#C37E&>-7WJo8pT34LrZV^Cq6LnGUR)9bf3G zx#z#+s<{lS=8<3Es(Ek|NA7+^u9o$kkO}C&R&g!n)zk5CM?_ye*I~c$3c1Hs?Ho5m zTU*4XmG%GY9g}#uQ^Fk+?wnL-nRiXFx{lm6;l~neJ7Yr+Eoyn{TGJ!&W5%K*Oy`u7h01$)r|d;MSNL1tY3gd47E=G0!E3*T{-U4 zaJ5dG;A(xKO>oZeCPt)7Bg6mQj_luW2ScpdFK7i0=V!ksF17F%`z__~Z{Z>K<1W&| z-^5H{G}dw#o(WVsSK&=RK0F`1)QA7Rx!)Jk!jWsc3%0QFEybAS>ofe1(4v>A7QI5Q zfDXN9T|(t;ybqM@dKwW#qm zcml$oRa4bc?^)xm^4AI;ZIB;RaZpS2d;B#xkmbFuvbibH?Dqye&Fh4xHRx+?OH)MY1)c8Ej0V#AHvo@!orNzIp zQCmN2hX{LZs4$$j;aQ~S5}f5}5h4}mSN>$x&zt}Tx!UG6 zRSh@>#V`K)kt%u6Z;;%jfd4`@P+C+pM@z?_F`BB)&dAKbB4AKR0Rn}`>sjF!mMQQ? z&6-{yqGLxC#8^gJW337HM9Y7sZeilf1y;V+UxSxx#5BDUVGZ zu@(=GU`d+cx8uR_AxSR*K8uHao9V9r&VWKAKGP3?)}5}OXS5Bv5uR4iWkANK{9Y5E z`Q=$|-C4z5@N|N{14#J?fnN*vZL4?=G|z+0QGBKs1g$$=KhJ<0^v~h>Z=iiZLw}!% zPyIYAt~;yv4LpAYy&GuAZ{k5W>Gbq@rre)2F(T=3AzIT zhWu_5pZVb#b=_G-66Bu)ZM4tTpkD?}%P``1o8%dvXWDgV71u%jZO}aTXUHEh@hQ)< z@4B;!MUX!ZnrF)m`H+cEd1*j0f>rn+Z-GH2o8*&dVAAR3=UIA#z6bJO0nH?t{!c)s zfMyer-VZtr^iD;;2l`FW(Te^U^xL2}DLMsMOQv+XKAy=p=qr)1AGEnWlX!4bI+Z^Y zJst920d20YYfXHXpJ)7aXBF2&J`=RjKbW7nCO+l!O>_YA1)$CKwZz1yJnszX&MNMQ z{LP@v{fFmX4L;?0x4@uxK>ktCH=&-4_Iu65r~F$cn)y8(9){4r5dS{h4QN9+J*&` zdOGNP6`c?IcaV1~`UcQXm}u4?@093H*MCsmQ>6wk#a8iS>O*`KL&o0+`Y{vDzWIoW{y(5cqkZQp`8f2&M@{@Gpq~Y8^dB7U z6uUqJWcoM4GaIxyzq})(JH326O*G5HyEA6~VbqU7lg~Re2F>!>IhabP*9Y&`7&Q6$ zCYtei=SFwB{@o^;eBQ+|^RI>d8#MX6qhruaf4hk$pLch3r>CEc{$@pLdDO{1YaceBLoK z^Xt*y44Qo2Ju+zK@0f`upLddUr{}L0{n?<&=UpX(X8b-AO+N21=}wP-6UGaJCZBhk z44UzKO*Hwu^Q1dHJ~pbtH2J&>r90i842r#m>3tXu(CIKKMn}xwqNRLsSU{)4Bzg_g z>vste^i>h`gb4adNl!P8SImEgi5{5#xQO_pBIra(Z?G6SN))Z^$jY%>-W5UrPtbg) zbI7^^vzmt@_epCc~6=-Ic@7Dy3 zI#U!Khrk4+k_CEuIK2rX7c^g&M*8zX{|D+T8Tm`Vh}8i4N)$#@^aG$-HbZ_7Xu~o8 zFGbKjiZO`_x(oD;`UjfUdYhZ- z>U7FkH2k!^U_yr}{y$ZIrT;CM**R2~W zOl`2qi&=)sf|8|+y*2%}xFYGWT4YG^1|tyu|-oqY{cx3e|6Vt8I zXoCwKXX#JrBHuClg@&xV!3r;OTB1L#iyX4)7wRv&xz6^1`i2BU(* zJ$2AExNsb!gQ5vCBZgmDm+F40akr88?fP?TL=JaHmCzh{MBwdlGVPQ*UGw3=|gR9<+tpP)Y-bv&oZ}qLFve~=F?_Dcz0apdQ&Hkp^ zi?pS(tk1q&$&0K*Bpq%H*ZhL(OZ1#BXjxqE^#)AEceC{2V(MR(%-=l(J{dIzSBnNO z?la5pFrJ30Cfp|1zvP7L&0p(ZW3K&5e)}|*7-5U{Dml-EyJ`h_u(E}>@W0v zR?cUiR5bTdNpt^`_+237`V^gxy%5seza)RBqPagw`g$Pw+l5EoBFvA#Pkmnk$x}n8_+|f9^#GAL%a!kh&MwI z@t>fFSOq=AYWy8DY`QYteBu*69_ojf zf%+kGZwES9emfC+IWa^mKH`X2@Wm5LaaS0~@@^oayh+f_@^b%(<$Z&Q@^&lwu%h23 zqP%@X)b|l0%6W{4v_2%FTqlTlP7}Y5d=gQfPlzaoKwg<&JCXS$VlO0)=s-S+SoY*6Oaz02zIWwS(<>WpW%h^ptIS(tk zSJ8b$l=BENfbtPs{9)?{KQGV`= zv7Eg`l=}k}&iyck#}E-d9!U9o6<(~u0}MyHKURG1gHe7j5%Kpa`WX3;n~1h#I@}MV zoRbJSm!hl5hupssA;*0&%IzRRZl|Jq$%ou!iMky3$0(-}A?HwZCHauMi-`2NPe!@T zM94j?=!4`#?o%SH+!`X}xNkY?;sy?M~IN)ej4RYD-01K??B(6Ts0AL+*hMqKw*#w zxh>>F?p-3}xW7iZ4;7vuLM|D7jB?9~kmEiZ<$Mb3iICe&KI9G)A;<8$`%)|BZ6*D(oXd?ql*{_tDsIBf{iG>>=nO{x8@A zajy_=VmI^>Ul#&Hl!$!>P5#`gsihUaWn%IlK6``;g$aLwhfvj}T z>E$IIufkEylCLRbI^;VQ<|@orSf;R2;c|u53VjL#3fmO6E8L)Pqr%M!wC<(LwaUM9^ET=;1BDi9QCq} z=?uLu!Ee^F4EIL8_r1Y69kyk z!y#fhjxxQg@EGNYjYv<>z>P|RHy;mOG~~?b-D*k?)5LIke3!AEjQojm{k_LD=#2bL zReGIzFb=5<>>psua%L$xL(Bm=v!fhcAw1AY^OuftnFawg6nq0b${fGNEX)=4dOZ!ioKj~!$cr_(oepj%~ z%%nJ%9QuCFrUL~g-AOc*M3OBB+S5maXV}}-mz29BC(bqJKtUpLG$(aBCe1t0ZXN3~ z>_;xrrkY!GR{kL>b^M_}AJ+8iCnVdi%qqE-8M8iqRdX=7O`2JBFgP#i@}h}Vqg|sC z?{ViJ`;~Qxi$MoXNM<^hF>;x4kXdl-w^c`awMI%mjq@nCNt{0w{M?WKJoepQ9p@($ z{i9dULlcVndLxWk$KG8;>BjMNBSf0FdLzMcXA@^6=R|SNyu{!4M)B0KMX&Z!4So5% zjlSeZsk!A36L)D+Cw5VNx`Kuz4}tVd&tbA8;aHJudwzNto+I)?X>HfC(Xh(cz3^}8*(GO_!+8Y9u0 zf;UQ3AAOMvaatpKqG%ODI%97y6;1g}kn@SVWa?<-(<~KjEZ8LH71a}uycTWTl(=Zq z;QS(y-=dAph}Rkq_v(KUBtlhWN+>Km|sU*`SMO500-knHy3u5m^S!18#WkrleS*fA2 zMinVxt!YFktT)Al!dmE)Ds;F7`H&6J8Z8<3i49ZU* z3pdwLi4UNs_5_{2J;5TET=ph5qdxj_lx0eAYEg3Zl`GgLl&Et~(!B6d)YxZo9t=9o z+WsExgTW$6)4f|&Mv#w>xPs?z%e`%kcC!A?-MZsG)1=(o|HC9*f4^>QZbZ@Kn8ltY zx%#3VC$*+`V#q3@S-5+%WTj!l-Vx4eMViN2Y8H76yltpuK66bj_T+xcLv3SPqf5y+ zpp#Jl*%}SnCdaiZVy>pYU(@kH&Zsd(tq0iAI32Y~>wy)~%QkmyhStgN>|S)sn=NQl z^YWI*a(FA5H_5GJ{ywikOQ@Bo-xL>DWY~LW&~9FOyRLr}+a1g?zj1q2?(-jQ)UuO0 zE0Zv1thx{0^sg|)!A8sN8_&~RZQdPRoF%8a7UAX6m!+H4cRIhuIlnmGd53dLjqa!+ zvfY{BiMB2Y>Zd%FGv29tafb8b?mZ`(8)m$@=fr1MTz_cK3D%H|aC1c-ep$r={N7yQ z{KK9Tr%LlFTv~?TQ}gNf=J~S^L?w?(jy4*MZ?Fy1dl*aHcrwCN+CMFp+V$Y>5j~~H zo2yIvb+H;FGrghdVH2G!nRqYmZk8q$?+E6U?FeRWFW>T~TePN(pw8e3>ZChz#$$|a z5v_-7;Fi+kFcYoV)e#90H?)98{h6_$r|Hxy?X1I%X_*H_o7#mMkO1J`+7CW zTI1ecU9#S|yH{QtFebM});YIDg{m!_s4c7D^{*)4ZBfYEVli(E`aR#an2ff#7HzS7 z`;OpZwj+48>&x5Y9nl`Y7wz#TZ;t~*+T-WEJ)Yw2(a}qGgWOaTtspeTV=-UGPl#aX zsVa&=E1D=yU(BRpm%ey~NB2Rl_PIW-$(O$@_fKOft-`y{b1z%LZgsr|d4;#J29}|C zO#OYHYjcZS1AI!yq-aRS{FSaxmL8AtbOxKvoqea0wWd+V&b}$LJNr^D(;wZ(HWrrlPmTTC zs?NTtt2%=%Wt~B`v@@uOkB2ub?d(f#@9dkgtg~-sJLNnsQGcS@*V#AslFq)2c7I`K z-#qX#Ij{717Fy#_WoKWJrn9e1qd)PWuND#uAMWhCdKuU9xDgT`LE<_{tc1iXzG_JP z2P9lVA_Ee?gG4uLM%tUheF>n@dF}>QBr>O_IiU_C46158gw_VJB+yD6b8cmx-NyW31HA zoxv1a3hcrt;{#hV3p;~(w#?!Os+`A~vOD|Y(Qfl>R~B~$lh9fdK-p{=#hrZ#tA2`b zhRu%fIE1onvmvw8X2b7x{#$OdB77bHb=fQkSMy(wEgj*l{I|_!M!1as`fOJq9N@oA zwlsuq~`wL3auNdWUhIt9R0fkuGJ^t%cg;hihOJqbWv@ z`wibpShkqXU=Y0%RW%cRmu#ZZj8SUB=yqcSw_pTUW0dpJE04YYl^7LOQ_-s#keZty zkK|0#rAVLTrjbl?lZsQEyf1?;TLRi|9{=5Hy9D7j{_C?%KsdmEn{49|zLEbn+r}Y$ zKYm{hmbcyKxw2}b>B?0a(_dC&CfP6w>}d5(kD&Qd;X@0#b8OC8ef{}j?l#N6+jvQ{*6+4hpo<|txVs7NosO}qc z16l?xG>?yE8z03P{5Ok_;-&m|J0HvC{P#NB4CL$Lzty%>ggyLst1SiLHvU^?y9{9; z{|(rZ5pLqYH`=Bn+{}MlZAl1kbrm6T=)bw9~Qs4^yAa(*->*Wo1T9)?vl%_t;Gv!yM3+HH=5a5$24PqloNSWA9<`> zUPX^M8mTKip1nBLc?(wb`#+6zNwq9(S$DoyW6C}D>y@dvUzcjF&fH_KBAm}x_C&oF zqOQSQdom{#ck3OHWTpkjHaDuNTS8P6c=rhEP_Wq`VfJQzdI&9eY2nlYtpAMf>@I3~ ztz}9fX^XWe-K*cOnLoWNR-zcGc9GNHYH95Xj_Wv-&r*(d-_;v?*+;#av}d}h#0ai2 zX_4xr@T)6johVHD67>+S>!;1#xc|FOnNu3vzacDNH>nL-veJr|m0XVYb9Q^=_OoXl ziyQmnoQR|P2&Mhbul5ImRC|W|Z`3{!tKSx^eqnVr^GB-cyry-As?N{wI#VtBdR??J zbI!WQTu|LB&r|oU(P!2@nYVjhsNMCme}3YY4adcpJ-;@O_!@feSG9Qu-MGRHH(vgA zdY}5_k<(v&tf=+wp_|?R1-(noQ*Xm~Mem_DZb8V#c|$f%Z~uJOiEo5;JN3!$PRZ8o zQk8X^e9qRb{cBsdtch})G1#_;&f4d>syP-+Q`+r(X4t7umhxINY1CJ+YQIv=Fm}L9 zi_J6Woy2X!Y?a={?qAJ9`jZ(ew;Ry zcI%muB;E=pC9y=SmnF&apSfNRHfQncvopBgCvwyzc0n%1Y4uWypee=qk@tay_WX}L zDb5G#2FiH~^m{7$y}A_VQ=VO)efMZ#%z)Gbi2Z0t>|ojKW3BwY7WcsWm3!ggFu1qC zNV}==&doJb3u!mCt1o5sr3F_yE&Oic;T-AELpf95oLKz0JHeCa^zmKQ6x_#OzNUtD z`LZJ%yFbVt)p|gS9jwvV$yyOTaP^k=@q+uQ9rJS^&WS$6PDXyTBS-&c1oE5YS)Thg zUx9qsOB-tM$=$$zGxiotC%s~wEj1CcRw@{0e=AxK^G*;)NA`PB#iBuAW=VreVN;j6LvpUBVF_jdB6{!&gls~0UtJK)^ zv-L9{?`D#`CwJQX8Tx~k7}uljRN$`>7u?IHk6f7MeDG*|)XAF5Q9HxiCQsZi zOx~(pDLiM%W7tI{B)cT92vurk>uvg3f9sa_-YM_LqIWfC0z012Ha|<)(b0TR;Hv`v z#&KtJB+4f~)5_Q?aF4*x1un(ye@Dm8=4}Gs0#Z3ySgR8L2H5eauDL8iraOR??-4@8 z-xw*U?+|#H@MpT_<54o|V~F3;JWgPez$}5+32YL0v%qG7EdpDCPeLCb8v6-g%LvN% zXU#W`0zRp2K8W=a@oyY0W5yU6`vvaAt{w4RcrZ%x_hX$x^wJ43>MxOT50L5|nLznJ z+PsxxM{}FNZ35c`-Y;;wzy}4cnC`z`Dr@wvs|>iM>dHW+GLI$vOYVl4AlWmv2k z6(xmbh0K~^GdEe%?dGiX*{ghh6>Twd+C0b7ls?Cjk!9tyWwryf!)8-x1e?3g8I7G+QL3wKs;KkU zS3p;3t~9+`nmN5XHa5gw7w}g!x>r~D-K&V*B+bOn0N+`*gwiyu4M+{Eq{hnn)$X*R ziED=>&TXi#cUJ|Z>3*r!Tko!HlmZQs-(Bx-Xq0@F)yR`_QAwd%B(l!C>a1d@*)Tbk zEHAef+80z*taew1Xk6p>RaUvL z$X>W`)~xJ>#o2{rdh5M`3QuKyb*;NXZg+NO0Z(;fMRh}M1$vM9a*@vxcL4pZ z4)YP0SGtgoI+aYtkhHwyIZ)qjuqsborH^?nRTci)%60AvZ#5&ec=`2f>)1fRTZNJ5zN)OT!Pn?@ z2Pzxav&yvrPebEXOT4S=DwiOJRlEIFjb2{>*j8 zb*`+5ggA-UUqbyuY7UYNrB^qPk{(mrhuKYyC85<;qRm6O43ZD!qO|L| zmmx9MLjzy9B+Y5omCD%1N(8V2apX?&U-?IgQ@y4Wk{c=30VJu&O&%sLDt#l1PM^*G z?7$;Li|of_Fcz_(nT^RXvyql)Hp+slJQe_&Of%C0BjKaqqce3ZCNqoaGZR?^XaoFc z_%Vndn`vM=QVf5!*5_H0eF1yV8qNO4n!x^IHL&-s@$9d_zgZ($uT{$qBfbyx-x2=- z@Q78@j(B+cM z$5{e!B5-7844ay{j!n-ru}81Df<1Q4X_jDaWE0JdrDHR6j#*-w1rM^A1qL>!UfTb_5=8BsLNewgErLn4)nvF)(mzJ;_rpO54`)qyBoY8g4YgSwuP}=i;jKU zGKKjq)7V1CC|2T-*wv0`R_bVD-*xy{3+N-DKg4+42)_xw+3{_*#}Uu=I;OCnJ2KeQ zjumX5qm2Cm;a@`j8Ha&A3;uq`1okUOB0J!)vxAN+*>jE=?0Lk!0Nzg=I<~{{7xp0V zr;cOnA>hM~kJ(P(BaYA5qrk@;r`h8u?+HgF`x)>_M-1x#?sAM_yMa$RjO-;x6nohb zWWNT!3T#8VI~-rIJAprNe9pE(?k@Pd;eY6eVC}$rkk7rq`;gE5z#jpB4E!%g0^1IJ zz%h>f2Kc&TGW#v?cko>ZcLV>&F`oU!v4y>lG=FtG&HjeCUdL8;*r8#4j&$~S;0KQ1 zvlks^7KiZ`Z;56jEVj_Roo&}Lt>Z&SeD_J<}jBJ#^UOh+|jU zBUyyw5SwP!G9B`WvTR{vfh<#ld7prJznx{<Pk4=-U1DdUOiqKqjTn~~P-e16iLi^I61IY;x6<}%Gens+p()pL*L zGL3DT^E7|M=QP5ShOV;HiW^3M8Jk@hYg8^4Uu3&B49(_Wd`s@ z!&Zy|k}Wy2{dfh}>nzxggRmPeVK>sb%@}GYVg_CN&u%9MUk?Y{2^ZE2NvsF9>)&l7 z&TJoy!ak(JK15$2`>+gak8hfN(BYbWT3oYr;+h>PuGu5SHQO-cnmyP){6nlMj*B(L z$6`(Kg;-PQ#hM~gtSLr{HN}+kUfX;%`!Esfi9W0+Mq)iNPOK+PSWoD%p7OyNU**^Rd_Ms=V-al9Sz~*1gBIf&GC-z`XEx|?@`MP|tjhF))aT9FBII(sZhc(6= z*od28BgTc+7-zN-qr+?j)+<;yXf0TKz%J-5BVZ%0fsKgbYno_FoLFZ>!bUWO)=TGZ z8+NMJ76t!?wZ++OhH@|Qzp=JBv)x#7ab0niwfV~ud-EjKj9Pi69xamy~^^%w6anGnTKm4{>hKH3s%6FU0-C zjA8C4mWyW>BeDN59?vdl|6%lyXB=m~pOC`ldkpp*J44T3hM)KJjN;(MJx2Zv;$N}H zxb)&4Bc7e?!XBUe-13{g$N2T&1a3)@4_B8%{Re7NV4E$6J}-e*Y49Le7SQa{6-P_XC>&oIB< ze&hek?>vz$3V+AxZ0|Rn`@2o1f7`oF!>!-d?-r=vIT-p*Q^uh8JO)3f9sI6`vc6N^ zKM8+F;o>_@=l4z%z3)Tsuqf{b(R)Djz5%@hq`WIcYjgEpz?Z+{lp1=!NPeej=sO9+ zy}Ll=(7Q$SPLcB761_*D&A@v$mg^W@hslo68bEn((u8*plQOsBe!iX2bzZrq$?sJ~ z!nPg6`;!LPHrEi_7H-#QEkJ7mk9B0|8b*Ivi_mbc;?3;N_2a6w#k(LKz?rSTqy;|_@zpYwDdGHj`RzU$wnlrbXTtQGEFjq z5p!l`v&h(}>}XAlHdZ@EKTb1VbBQiNGf^{1J5_JQ&^)Wtg^gGpAH@SnbPON)s2ol> zQ&HH@WB52n<#Y@m)u^0~O;%APKaE~b<{r}&rE8gCkc5_v9Yn{m383f0-waRk#NP)m zJ30Nc3JLyY2-Eo-@_f{?s}Oz;J{F$RF9N;>KSj_hfxYmOpw|JTpyX$Qrt%UWzh)lg)cyaBL6EDpX8rc(Uf0MMH8RC zVUwMfO+fey_;N%j`9S)L@4=fRq;ulzL}Gq zmf0YGSD5^7RD6=BZ|fBKg^+(6bS)y3{LM5txs&@VOGUdNpAC8|_=@}<6`%5_Z}nuS zWg8&>I_MTeDDn&O&7Q(1dHSYLq3?zKBG4{GDDsc1_#{u?{>e_u`)(KLd5BQtdsKXq zr*8yhr)4i9{|`a8AwrS&h0KUtU;36%k$)TVH-WaP03)hz7_J< zhsg(2e3GYcG8OrqkY5j)nvm-ABIpgE(Ttq_Bk1pfrXfiD7z8$}Xwv^s9DcadvSje1 z5*WJ$G|A(05w;ihWwD@XtfQ$}JE!%m1oSer&rO$H{*Jw=F>N~3QhdODw@*wt7zhHryuU*^6490g{ELRu8#^$>FL{D zg(m)1Tu&96`1DP$LKA->EfTns^QUip6`J^;t7uA3-vG-_ZlA|hH1X-%V1-ZgfQ#h) zcO(=c(;ue;DR$G}dpGpkGOq<3?kB=MR&=EsVYwbPpPlu6ZQ?ON9@EG8(7X zy`s>_pW6CR82!&M`Xp#lKM#HkG>Z+{dO7`M&~z;!NBSm%CV8^|V_?-Rpl5XQMQ z&azSTTLGGQ3cmp~l|^kp`nP~Cn+}@^0iquUO-|uI4f=bqhlf$WF|a^~Kz|$dismrU zr$DDbo=g~}kHWQv&Rj|o`K5-gMRI-YVe|q)EBcj!rgK?(V3#Ss2GDPze`Nk-)(-kz z6&(P59m>{=^0t9Kq~bpST5;4LJHzNF!{`HH^y{GMoSS~3&xc|BNYs_;uIM)!vZ3nQS#p%CjTPIgHN8?>n+fmaeWAi{`m~Fdi=zq zFBL~=5JSC3RV40N-)fmo!wnLt@Ll)$WGHZvWNzI$24o#DyYq*ESB0LuP{`&h#O* zd_ciDd~1Cck=Z3>)`~CvXnS_amx|cRGQM2MT4w)pAxnvTGQwH39`v2Ls=bu&*X70y zYd1Pg0pGTtjaOkQ3H3`UJ{_-@DU>h_MTLc=Lm$#(bReuKGVmdN_5yr%9$4$Yx*_0Q zwO&p)I8Nv{kOakMFIcw3UFBC;bkGBDmZ2;q`C0{7Y)xZXc6*+$vWDDp%s<3;75N#YR# zbY(4*Eet;~L>y0XX6-_Dwye>;&g;H`kGBe+yU~k0(FP6tTo(1@8k(2Fm1_)RrHE9^ zO>vgfKhF7h5SmqrI-&gOoDp?n4;XUZHzlHP23p%mjUDRsGv;F}mM>!bfDffI;e{#I zUVS_T!^s}?fi#}QW8>)tm(VoBB8*HeqNTsKt8vbHb_e zUMZ!&5$k!ak+Eh%qVk% z0y6~86G(f2#NQ|IS%C)yb_#q&;6H#=KJ5ikx*8zSwAV*8?cou=PYAu}K8pCXS4Z&y zLc})-`f-7@*GBx6@UcI`zPv!%Q=|BPf%TLp__qqAJv8DotcMBb5hAW!(6lE-@jnK} zJ`OzzcVHh18~21pfq4Q~32YVksK73P{Q_w(N(-IeB}83&1imluu)re%`vo2s7!>%q zK)QLMeDs8?a4$oMab_U&;69Jgi~9sZ)L{xCyhMl_h$KSnucQ!SpJXN>HVMpx)6xHg zDcA!fw4j{`YjA%p**r?uR0+$LbC&UfVb%dB7F2dO;hp++V5MGIL z2%)c!FdO5Gumt0aa0%uYp$qei5c=E;q;as55c+6G$~Z$Hw#sItD&w7__Q27w8L z=%*=!jpzqLKl*_%fPNrEKg}epLO&3qpKOHarwl^$(>y}dGm8-Ylt(xV{Xkfaejr?n z_928{O1KXFK!|!@M~H`BE<*HEH6i-RLx_H=CA#xAA1S>Sdc@gEfUl8DD^zFdy>`iOs>z>Ok)2KHd6Uh@c%AMN>(T${jc zgs4|LA?o!@Ajzd*Z;z1n07IspqT_EiNQ~I5RNdGt?(svLd{T@L>gvEBDJVGcV5kAV8lkhdP zA7LkBFbypBA&gJL-!Rrli1NNe2)PzQ$Wi@bU%?(P;p>b)?M*^_##>om?F?DFhgLLzyg6~0?P%u1bPJe1U3n5 z7T7AVO<=pg?E-fSgxYKd)==Cj{RY~gil3ny;8SRZelShrgQB#L$o;N;QBF_ufyO)W z69k{;E%B2G@!#rF1b?RBn+e~N$Afkk?2_PT34Wg7FC=_ho;Q^LQo%15d>7&Ku=j-E zdkCRlEg|v`5FW%jFcpaTKzp}@)UVnOJnKdKXrBO)=3ifjJ0)PCQAUpvs&5Fm(^l87 zP2(p+&cgY9Y1mIl3%HvC1EDk=hUZ=5u3axj(JEaf;cg0%I4v&?DXA#RMJBz~O&}ZS zfKyT+JuRIH4g`5VVflxWg)>9hr-i97kV3^6kXC6pNG<3ZQe9S%rQvScOPfGcfr<)# zqajy@^p``_T)1^z(@*q+Sz1*?U7Z`ZC272E@m9_(f1t8zja+H$$ToUc zt_`^T=$CVJlOcy;$dn;&Lzu>%;`Aaw*AaAi=*=4%M>}cI3a7}WfsTRC67dDA<+ZyB zG?hVe(eU@ftMg;H_t{4g!YTP>fL7qJB4fv-44Ke`^N^-F1BOhO#xNA*V-V%~VaXWM?-hh8Z>3zH1VZJMa^FK7!l80W zj@p;{jGR*L9}!l!i-dB?R#Ur-5ptC7V|aDBO%fthPAPX30_t)}j?$ASr<5B9A$7TC zRk>IahU!b}CH#fz+bqdzC`55bJaRL`}oKT&PFf` zo?LNQeg;*37_y=KypSV375!*oNH$Axihi^X#UEdXaUSH76d@q-$loC36jl=C)Q)7x zZ9xEK`eX`uK`vb(fQlTUs(P#(a&05zvVQ^|>1Tkaz6jL;;lsG6s-Q^Wl>A16R?A6f Mmmexj@RZ>H1@XP;!2kdN diff --git a/general/package/sigmastar-osdrv-infinity6e/sigmastar-osdrv-infinity6e.mk b/general/package/sigmastar-osdrv-infinity6e/sigmastar-osdrv-infinity6e.mk index d4e30b3f..e5af5226 100644 --- a/general/package/sigmastar-osdrv-infinity6e/sigmastar-osdrv-infinity6e.mk +++ b/general/package/sigmastar-osdrv-infinity6e/sigmastar-osdrv-infinity6e.mk @@ -12,7 +12,6 @@ SIGMASTAR_OSDRV_INFINITY6E_LICENSE_FILES = LICENSE define SIGMASTAR_OSDRV_INFINITY6E_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -d $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PKGDIR)/files/kmod/* - $(INSTALL) -m 644 -t $(TARGET_DIR)/lib/modules/4.9.84/sigmastar $(SIGMASTAR_OSDRV_INFINITY6E_PKGDIR)/files/sensors/kmod/* $(INSTALL) -m 755 -d $(TARGET_DIR)/etc/firmware $(INSTALL) -m 644 -t $(TARGET_DIR)/etc/firmware $(SIGMASTAR_OSDRV_INFINITY6E_PKGDIR)/files/sensors/firmware/* diff --git a/general/package/sigmastar-osdrv-sensor/Config.in b/general/package/sigmastar-osdrv-sensor/Config.in new file mode 100644 index 00000000..868dfef5 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/Config.in @@ -0,0 +1,5 @@ +config BR2_PACKAGE_SIGMASTAR_OSDRV_SENSOR + bool "sigmastar-osdrv-sensor" + default n + help + Sigmastar sensor kernel driver diff --git a/general/package/sigmastar-osdrv-sensor/sigmastar-osdrv-sensor.mk b/general/package/sigmastar-osdrv-sensor/sigmastar-osdrv-sensor.mk new file mode 100644 index 00000000..b222d579 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/sigmastar-osdrv-sensor.mk @@ -0,0 +1,20 @@ +################################################################################ +# +# sigmastar-osdrv-sensor +# +################################################################################ + +SIGMASTAR_OSDRV_SENSOR_LICENSE = MIT +SIGMASTAR_OSDRV_SENSOR_LICENSE_FILES = LICENSE + +define SIGMASTAR_OSDRV_SENSOR_EXTRACT_CMDS + cp -r $(SIGMASTAR_OSDRV_SENSOR_PKGDIR)/src/* $(@D) +endef + +SIGMASTAR_OSDRV_SENSOR_MODULE_SUBDIRS = $(OPENIPC_SOC_FAMILY) +SIGMASTAR_OSDRV_SENSOR_MODULE_MAKE_OPTS = \ + INSTALL_MOD_DIR=sigmastar \ + KSRC=$(LINUX_DIR) + +$(eval $(kernel-module)) +$(eval $(generic-package)) diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/Makefile b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/Makefile new file mode 100644 index 00000000..b18f8982 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/Makefile @@ -0,0 +1,9 @@ +EXTRA_CFLAGS += -I $(PWD)/include -I $(KSRC)/drivers/sstar/include +EXTRA_CFLAGS += -D SENSOR_MODULE_VERSION=$(OPENIPC_SOC_MODEL)-$(OPENIPC_SOC_FAMILY) +obj-m := $(patsubst $(PWD)/%.c, %.o, $(wildcard $(PWD)/sensor/*.c)) + +modules: + $(MAKE) -C $(KSRC) M=$(PWD) modules + +clean: + $(MAKE) -C $(KSRC) M=$(PWD) clean diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_ms_cus_sensor.h b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_ms_cus_sensor.h new file mode 100644 index 00000000..f8914e72 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_ms_cus_sensor.h @@ -0,0 +1,1029 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +/*! @file drv_ms_cus_sensor.h + @brief This file contains Infinity ISP sensor driver interface. +*/ + +/** @defgroup group1 ISP Sensor Driver Interface +* @{ +*/ + +#ifndef DRV_MS_CUS_SENSOR_H_ +#define DRV_MS_CUS_SENSOR_H_ +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +#define I2C_RETRYTIME (5) + +#ifndef SUCCESS +#define FAIL (-1) +#define SUCCESS 0 +#endif + +#ifdef __cplusplus +#define EXPORT_CUS extern "C" +#else +#define EXPORT_CUS +#endif + +#define CUS_CAMSENSOR_HANDLE_MAJ_VER 0x0002 +#define CUS_CAMSENSOR_HANDLE_MIN_VER 0x0002 + +#define CUS_CAMSENSORIF_MAJ_VER 0x0001 +#define CUS_CAMSENSORIF_MIN_VER 0x0002 + +#define CUS_CAMSENSOR_I2C_MAJ_VER 0x0001 +#define CUS_CAMSENSOR_I2C_MIN_VER 0x0001 + +#define CUS_MSTART_CAMSENSOR_CAP_VERSION 0x0001 + +//#define usleep(usec) CamOsMsSleep(usec*1000); +//#define usleep(usec) udelay(usec) +//#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) + +#define SENSOR_DRIVER_MODE_NOT_SUUPORT (0xFFFF) + +struct __ms_cus_sensor; /**< Sensor driver handle */ +//struct __ISensorAPI; /**< Sensor to ISP control interface */ + +/*! @brief Resolution descriptor*/ +typedef struct _cus_camsensor_res{ + u32 width; /**< Image crop width */ + u32 height; /**< Image crop height */ + u32 max_fps; /**< Max fps in this resolution */ + u32 min_fps; /**< Min fps in this resolution*/ + u32 crop_start_x; + u32 crop_start_y; + u32 nOutputWidth; /**< Sensor actual output width */ + u32 nOutputHeight; /**< Sensor actual output height */ + char strResDesc[32]; +} __attribute__((packed, aligned(4))) cus_camsensor_res; + +/*! @brief Resolution list*/ +typedef struct _cus_camsensor_res_list +{ + u32 num_res; /**< number of sensor resolution in list */ + u32 ulcur_res; /**< current sensor resolution*/ + cus_camsensor_res res[12]; /**< resolution list */ +} __attribute__((packed, aligned(4))) cus_camsensor_res_list; + + +/*! @brief Select sensor type */ +typedef enum { + ISP_SOC, /**< Not support */ + ISP_EXT /**< sensor without built-in ISP */ +} CUS_CAMSENSOR_ISPTYPE; + +/*! @brief Sensor bayer raw pixel order */ +typedef enum { + CUS_BAYER_RG = 0, /**< bayer data start with R channel */ + CUS_BAYER_GR, /**< bayer data start with Gr channel */ + CUS_BAYER_BG, /**< bayer data start with B channel */ + CUS_BAYER_GB /**< bayer data start with Gb channel */ +} CUS_SEN_BAYER; + +typedef enum { + CUS_RGBIR_NONE = 0, /** modify RGBIR pixel order enumeration */ + CUS_RGBIR_R0 = 1, + CUS_RGBIR_G0 = 2, + CUS_RGBIR_B0 = 3, + CUS_RGBIR_G1 = 4, + CUS_RGBIR_G2 = 5, + CUS_RGBIR_I0 = 6, + CUS_RGBIR_G3 = 7, + CUS_RGBIR_I1 = 8 +} CUS_SEN_RGBIR; + +/*! @brief Set sensor image mirror and flip.*/ +typedef enum { + CUS_ORIT_M0F0, /**< mirror, flip unchanged */ + CUS_ORIT_M1F0, /**< mirror changed, flip unchanged */ + CUS_ORIT_M0F1, /**< mirror unchanged, flip changed */ + CUS_ORIT_M1F1, /**< mirror and flip changed */ +} CUS_CAMSENSOR_ORIT; + + +/*! @brief Get input source type.*/ +typedef enum { + CUS_SNR_ANADEC_SRC_NO_READY, /**< input no ready */ + CUS_SNR_ANADEC_SRC_DISCNT, /**< input disconnect */ + CUS_SNR_ANADEC_SRC_PAL, /**< input type is PAL */ + CUS_SNR_ANADEC_SRC_NTSC, /**< input type is NTSC */ + CUS_SNR_ANADEC_SRC_HD_25P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_30P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_50P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_60P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_FHD_25P, /**< input source type is FHD */ + CUS_SNR_ANADEC_SRC_FHD_30P, /**< input source type is FHD */ +}CUS_SNR_ANADEC_SRC_TYPE; + + +/*! @brief ISP AE event notifycation*/ +typedef enum { + CUS_FRAME_INACTIVE = 0, /**< Frame end */ + CUS_FRAME_ACTIVE = 1,/**< Frame start */ +} CUS_CAMSENSOR_AE_STATUS_NOTIFY; + +/*! @brief Sensor bayer raw (8/10 bits) to 12bits mode control */ +typedef enum { + CUS_SEN_8TO12_7074, /**< Do not use*/ + CUS_SEN_8TO12_7000, /**< Sensor bayer raw is 8 bits*/ + CUS_SEN_8TO12_114118, /**< Do not use*/ + CUS_SEN_8TO12_11400, /**< Do not use*/ + CUS_SEN_10TO12_9098, /**< Do not use*/ + CUS_SEN_10TO12_9000, /**< Sensor bayer raw is 10 bits*/ + CUS_SEN_10TO12_1121110, /**< Do not use*/ + CUS_SEN_10TO12_11200 /**< Do not use*/ +} CUS_SEN_FMT_CONV_MODE; + +/*! @brief Sensor input raw data precision */ +typedef enum { + CUS_DATAPRECISION_8 = 0, /**< raw data precision is 8bits */ + CUS_DATAPRECISION_10 = 1, /**< raw data precision is 10bits */ + CUS_DATAPRECISION_16 = 2, /**< raw data precision is 16bits */ + CUS_DATAPRECISION_12 = 3, /**< raw data precision is 12bits */ + CUS_DATAPRECISION_14 = 4, /**< raw data precision is 14bits */ +} CUS_DATAPRECISION; + +/*! @brief Select sensor data intarface */ +typedef enum { + CUS_SENIF_BUS_PARL = 0, /**< sensor data bus is parallel bus */ + CUS_SENIF_BUS_MIPI = 1, /**< sensor data bus is mipi */ + CUS_SENIF_BUS_BT601 = 2, + CUS_SENIF_BUS_BT656 = 3, + CUS_SENIF_BUS_BT1120 = 4, +} CUS_SENIF_BUS; + +typedef enum { + CUS_SEN_INPUT_FORMAT_YUV422, + CUS_SEN_INPUT_FORMAT_RGB, +} CUS_SEN_INPUT_FORMAT; + +/*! @brief Select pin polarity */ +typedef enum { + CUS_CLK_POL_POS = 0, /**< High active */ + CUS_CLK_POL_NEG /**< Low active */ +} CUS_CLK_POL; + +typedef enum +{ + CUS_SENSOR_YUV_ORDER_CY = 0, + CUS_SENSOR_YUV_ORDER_YC = 1, +}CUS_SENSOR_YUV_ORDER; + +/*! @brief Sensor master clock select */ +typedef enum { + CUS_CMU_CLK_27MHZ, + CUS_CMU_CLK_21P6MHZ, + CUS_CMU_CLK_12MHZ, + CUS_CMU_CLK_5P4MHZ, + CUS_CMU_CLK_36MHZ, + CUS_CMU_CLK_54MHZ, + CUS_CMU_CLK_43P2MHZ, + CUS_CMU_CLK_61P7MHZ, + CUS_CMU_CLK_72MHZ, + CUS_CMU_CLK_48MHZ, + CUS_CMU_CLK_24MHZ, + CUS_CMU_CLK_37P125MHZ, + CUS_CMU_CLK_LPLL_DIV1, + CUS_CMU_CLK_LPLL_DIV2, + CUS_CMU_CLK_LPLL_DIV4, + CUS_CMU_CLK_LPLL_DIV8, +} CUS_MCLK_FREQ; //Depends on chip. + +//Depends on chip definition. +typedef enum { + CUS_SR0_PAR_DISABLE, + CUS_SR0_PAR_MODE_1, + CUS_SR0_PAR_MODE_2, +} CUS_SR0_PAR_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_BT656_DISABLE, + CUS_SR0_BT656_MODE_1, + CUS_SR0_BT656_MODE_2, + CUS_SR0_BT656_MODE_3, + CUS_SR0_BT656_MODE_4, +} CUS_SR0_BT656_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR1_BT656_DISABLE, + CUS_SR1_BT656_MODE_1, +} CUS_SR1_BT656_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_BT601_DISABLE, + CUS_SR0_BT601_MODE_1, + CUS_SR0_BT601_MODE_2, + CUS_SR0_BT601_MODE_3, + CUS_SR0_BT601_MODE_4, +} CUS_SR0_BT601_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_MIPI_DISABLE, + CUS_SR0_MIPI_MODE_1, + CUS_SR0_MIPI_MODE_2, +} CUS_SR0_MIPI_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR1_MIPI_DISABLE, + CUS_SR1_MIPI_MODE_1, + CUS_SR1_MIPI_MODE_2, + CUS_SR1_MIPI_MODE_3, + CUS_SR1_MIPI_MODE_4, +} CUS_SR1_MIPI_MODE; + +//Depends on chip definition. +typedef enum +{ + CUS_VIF_BT656_EAV_DETECT = 0, + CUS_VIF_BT656_SAV_DETECT = 1, +}CUS_VIF_BT656_CHANNEL_SELECT; + +//Depends on chip definition. +typedef enum +{ + CUS_VIF_BT656_VSYNC_DELAY_1LINE = 0, + CUS_VIF_BT656_VSYNC_DELAY_2LINE = 1, + CUS_VIF_BT656_VSYNC_DELAY_0LINE = 2, + CUS_VIF_BT656_VSYNC_DELAY_AUTO = 3, +}CUS_VIF_BT656_VSYNC_DELAY; + +typedef enum +{ + CUS_SENSOR_FUNC_DISABLE = 0, + CUS_SENSOR_FUNC_ENABLE = 1, +}CUS_SENSOR_FUNC; + +typedef enum +{ + CUS_SENSOR_PAD_GROUP_A = 0, + CUS_SENSOR_PAD_GROUP_B = 1, + CUS_SENSOR_PAD_GROUP_C = 2, + CUS_SENSOR_PAD_GROUP_D = 3, +}CUS_SENSOR_PAD_GROUP; + +typedef enum +{ + CUS_SENSOR_MASTER_MODE = 0, + CUS_SENSOR_SLAVE_MODE = 1, +}CUS_SENSOR_MODE; + +typedef enum +{ + CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL = 0, + CUS_SENSOR_CHANNEL_MODE_REALTIME_HDR = 1, + CUS_SENSOR_CHANNEL_MODE_RAW_STORE = 2, + CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR = 3, +}CUS_SENSOR_CHANNEL_MODE; + +typedef struct { + unsigned int gain; + unsigned int offset; +} CUS_GAIN_GAP_ARRAY; + +////////////////////////////////////// +// sensor functions +////////////////////////////////////// + +typedef struct { + u32 length; //header length + u32 version; //version +}CUS_CAMSENSOR_CAP; + +/////////////////// ISP for SENSOR API /////////////////// +typedef enum { + CUS_INT_TASK_AE = (1<<0), + CUS_INT_TASK_AWB = (1<<1), + CUS_INT_TASK_AF = (1<<2), + CUS_INT_TASK_VS = (1<<3), + CUS_INT_TASK_VDOS = (1<<4), +} CUS_INT_TASK_TYPE; + +#define MAX_RUN_ORDER 16 +typedef struct { + u8 RunLength; + u8 Orders[MAX_RUN_ORDER]; + u8 CurTaskType; +} CUS_INT_TASK_ORDER; + +/////////////////// Shutter Info /////////////////////// +/*! @brief Report shutter information */ +typedef struct { + u32 length; /**< struct size */ + u32 max; /**< maximun shutter in us*/ + u32 min; /**< minimum shutter in us*/ + u32 step; /**< shutter in step us*/ +} CUS_SHUTTER_INFO; + +////////////////// CSI CLOCK //////////////////////// +/*! @brief Select MIPI clock*/ +typedef enum { + CUS_CSI_CLK_DISABLE = -1, /**< Disable MIPI clock*/ + CUS_CSI_CLK_108M = 0, /**< MIPI pixel rate 864Mbps (1-lane)*/ + CUS_CSI_CLK_86M = 1, /**< MIPI pixel rate 344Mbps(1-lane)*/ + CUS_CSI_CLK_144M = 2, /**< MIPI pixel rate 1152Mbps(1-lane)*/ + CUS_CSI_CLK_172M = 3, + CUS_CSI_CLK_216M = 4, + CUS_CSI_CLK_288M = 5, + CUS_CSI_CLK_40M = 6, + CUS_CSI_CLK_24M = 7, + CUS_CSI_CLK_12M = 8, + CUS_CSI_CLK_123M = 9 +}CUS_CSI_CLK; + +///////////////// SENSOR PIN CONFIG///////////////// +/*! @brief Sensor pin assignment*/ +typedef enum { + CUS_SR_PAD_CFG_1 = 1, /**< Pin config for MIPI 1/2 lanes*/ + CUS_SR_PAD_CFG_MIPI = 1, /**< Pin config for MIPI 1/2 lanes*/ + CUS_SR_PAD_CFG_2 = 2, /**< Reserved */ + CUS_SR_PAD_CFG_3 = 3, /**< Reserved */ + CUS_SR_PAD_CFG_10BITS = 4, /**< Pin config for parallel interface 10 bits */ + CUS_SR_PAD_CFG_4 = 4, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_12BITS = 5, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_5 = 5, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_6 = 6 /**< Pin config for parallel interface 12 bits */ + }CUS_SR_PAD_CFG; + +/*! @brief virtual channel0 hsync. mode */ +typedef enum +{ + PACKET_HEADER_EDGE1 = 0, /**< packet header edge */ + PACKET_HEADER_EDGE2 = 1, /**< line end edge */ + PACKET_HEADER_EDGE3 = 2, /**< line start edge */ + PACKET_FOOTER_EDGE = 3, /**< packet footer edge */ +}CUS_CSI_VC_HS_MODE; + +typedef enum +{ + CUS_HDR_MODE_NONE = 0, + CUS_HDR_MODE_SONY_DOL = 1, + CUS_HDR_MODE_DCG = 2, + CUS_HDR_MODE_EMBEDDED_RAW8 = 3, + CUS_HDR_MODE_EMBEDDED_RAW10 = 4, + CUS_HDR_MODE_EMBEDDED_RAW12 = 5, + CUS_HDR_MODE_EMBEDDED_RAW16 = 6, //Only for OV2718? + CUS_HDR_MODE_LI = 7, + CUS_HDR_MODE_MULTI_VC = 8, +}CUS_HDR_MODE; + +typedef enum +{ + // Index 0 + SENSOR_DRIVER_MODE_VGA_30P_RESOLUTION, // 640*360 30P + SENSOR_DRIVER_MODE_VGA_50P_RESOLUTION, // 640*360 50P + SENSOR_DRIVER_MODE_VGA_60P_RESOLUTION, // 640*360 60P + SENSOR_DRIVER_MODE_VGA_100P_RESOLUTION, // 640*360 100P + SENSOR_DRIVER_MODE_VGA_120P_RESOLUTION, // 640*360 120P + + // Index 5 + SENSOR_DRIVER_MODE_HD_24P_RESOLUTION, // 1280*720 24P + SENSOR_DRIVER_MODE_HD_30P_RESOLUTION, // 1280*720 30P + SENSOR_DRIVER_MODE_HD_50P_RESOLUTION, // 1280*720 50P + SENSOR_DRIVER_MODE_HD_60P_RESOLUTION, // 1280*720 60P + SENSOR_DRIVER_MODE_HD_100P_RESOLUTION, // 1280*720 100P + + // Index 10 + SENSOR_DRIVER_MODE_HD_120P_RESOLUTION, // 1280*720 120P + SENSOR_DRIVER_MODE_1600x900_30P_RESOLUTION, // 1600*900 30P + SENSOR_DRIVER_MODE_FULL_HD_15P_RESOLUTION, // 1920*1080 15P + SENSOR_DRIVER_MODE_FULL_HD_24P_RESOLUTION, // 1920*1080 24P + SENSOR_DRIVER_MODE_FULL_HD_25P_RESOLUTION, // 1920*1080 25P + + // Index 15 + SENSOR_DRIVER_MODE_FULL_HD_30P_RESOLUTION, // 1920*1080 30P + SENSOR_DRIVER_MODE_FULL_HD_50P_RESOLUTION, // 1920*1080 50P + SENSOR_DRIVER_MODE_FULL_HD_60P_RESOLUTION, // 1920*1080 60P + SENSOR_DRIVER_MODE_SUPER_HD_30P_RESOLUTION, // 2304*1296 30P + SENSOR_DRIVER_MODE_SUPER_HD_25P_RESOLUTION, // 2304*1296 25P + + // Index 20 + SENSOR_DRIVER_MODE_SUPER_HD_24P_RESOLUTION, // 2304*1296 24P + SENSOR_DRIVER_MODE_1440_30P_RESOLUTION, // 2560*1440 30P + SENSOR_DRIVER_MODE_2D7K_15P_RESOLUTION, // 2704*1524 15P + SENSOR_DRIVER_MODE_2D7K_30P_RESOLUTION, // 2704*1524 30P + SENSOR_DRIVER_MODE_4K2K_15P_RESOLUTION, // 3840*2160 15P + + // Index 25 + SENSOR_DRIVER_MODE_4K2K_30P_RESOLUTION, // 3840*2160 30P + SENSOR_DRIVER_MODE_4TO3_VGA_30P_RESOLUTION, // 640*480 30P + SENSOR_DRIVER_MODE_4TO3_1D2M_30P_RESOLUTION, // 1280*960 30P + SENSOR_DRIVER_MODE_4TO3_1D5M_30P_RESOLUTION, // 1440*1080 30P + SENSOR_DRIVER_MODE_4TO3_3M_15P_RESOLUTION, // 2048*1536 15P + + // Index 30 + SENSOR_DRIVER_MODE_4TO3_3M_30P_RESOLUTION, // 2048*1536 30P + SENSOR_DRIVER_MODE_4TO3_5M_15P_RESOLUTION, // 2560*1920 15P + SENSOR_DRIVER_MODE_4TO3_5M_30P_RESOLUTION, // 2560*1920 30P + SENSOR_DRIVER_MODE_4TO3_8M_15P_RESOLUTION, // 3264*2448 15P + SENSOR_DRIVER_MODE_4TO3_8M_30P_RESOLUTION, // 3264*2448 30P + + // Index 35 + SENSOR_DRIVER_MODE_4TO3_10M_15P_RESOLUTION, // 3648*2736 15P + SENSOR_DRIVER_MODE_4TO3_10M_30P_RESOLUTION, // 3648*2736 30P + SENSOR_DRIVER_MODE_4TO3_12M_15P_RESOLUTION, // 4032*3024 15P + SENSOR_DRIVER_MODE_4TO3_12M_30P_RESOLUTION, // 4032*3024 30P + SENSOR_DRIVER_MODE_4TO3_14M_15P_RESOLUTION, // 4352*3264 15P + + // Index 40 + SENSOR_DRIVER_MODE_4TO3_14M_30P_RESOLUTION, // 4352*3264 30P + SENSOR_DRIVER_MODE_4K2K_24P_RESOLUTION, + SENSOR_DRIVER_MODE_PAL_25P_RESOLUTION, + SENSOR_DRIVER_MODE_NTSC_30P_RESOLUTION, + + // For Camera Preview + SENSOR_DRIVER_MODE_BEST_CAMERA_PREVIEW_RESOLUTION, + SENSOR_DRIVER_MODE_BEST_CAMERA_CAPTURE_16TO9_RESOLUTION, + SENSOR_DRIVER_MODE_BEST_CAMERA_CAPTURE_4TO3_RESOLUTION, + SENSOR_DRIVER_MODE_FULL_HD_30P_RESOLUTION_HDR, +} CUS_SNR_RESOLUTION; + + +#ifdef __cplusplus +extern "C" +#endif + +/**@brief ISP sensor interface control API */ +typedef struct __ISensorIfAPI //isp sensor interface API +{ + version_info version; + /**@brief Reserved */ + void* pdata; + + /** @brief Set sensor power down pin. + @param[in] idx Sensor pad ID. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*PowerOff)(u32 idx, CUS_CLK_POL pol); + + /** @brief Set sensor power reset pin. + @param[in] idx Sensor pad ID. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*Reset)(u32 idx, CUS_CLK_POL pol); + + /** @brief Configure sensor master clock. + @param[in] idx Sensor pad ID. + @param[in] bONOFF Clock ON/OFF control. + @param[in] mclk Clock frequency Hz. + @retval SUCCESS or FAIL if error occurs. + */ + int (*MCLK)(u32 idx, u8 bONOFF, CUS_MCLK_FREQ mclk); + + /** @brief Query sensor master clock. + @param[in] idx Sensor pad ID. + @param[in] mclk Query if clock frequency Hz is available. + @retval SUCCESS or FAIL if error occurs. + */ + int (*QueryMCLK)(u32 idx, CUS_MCLK_FREQ mclk); + + /** @brief Query MIPI lane number. + @param[in] idx Sensor pad ID. + @param[in] lane_num Query max lane number. + @retval SUCCESS or FAIL if error occurs. + */ + int (*QueryLaneNum)(u32 idx, u8 *max_lane); +#if 0 + /** @brief Select pixel clock source + @remarks Parallel interface only + @param[in] handle Handle to sensor driver. + @param[in] pclk_source Clock source. + @retval SUCCESS or FAIL if error occurs. + */ + int (*PCLK)(CUS_PCLK_SOURCE pclk_source); //senect sensor + + /** @brief Configure HSYNC pin polarity. + @remarks Parallel interface only + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*HsyncPol)(CUS_CLK_POL pol); + + /** @brief [parallel interface only] Configure VSYNC pin polarity. + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*VsyncPol)(CUS_CLK_POL pol); + + /** @brief Configure PCLK pin polarity. + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*ClkPol)(CUS_CLK_POL pol); + + /** @brief Configure sensor bayer raw pixel order + @param[in] handle Handle to sensor driver. + @param[in] bayer_id Select pixel order + @retval SUCCESS or FAIL if error occurs. + */ + int (*BayerFmt)(CUS_SEN_BAYER bayer_id); + + /** @brief Configure sensor RGBIR (8 or 10bits) convert to 12bit bits isp input, This config will be ignore for 12/16 bits sensor bayer raw input. + @param[in] handle Handle to sensor driver. + @param[in] mode Mode select + @retval SUCCESS or FAIL if error occurs. + */ + int (*FmtConv)(CUS_SEN_FMT_CONV_MODE mode); + + /** @brief Select sensor image data interface + @param[in] handle Handle to sensor driver. + @param[in] bus Sensor interface + @retval SUCCESS or FAIL if error occurs. + */ + int (*DataBus)(CUS_SENIF_BUS bus); + + /** @brief Configure sensor bayer raw pixel bits + @param[in] handle Handle to sensor driver. + @param[in] prec Select pixel bits + @retval SUCCESS or FAIL if error occurs. + */ + int (*DataPrecision)(CUS_DATAPRECISION prec); + + /** @brief Wait isp frame start event + @param[in] handle Handle to sensor driver. + @param[in] ms Max timeout in ms + @retval SUCCESS or FAIL if error occurs. + */ + int (*WaitVStart)(int ms); + + /** @brief Wait isp frame end event + @param[in] handle Handle to sensor driver. + @param[in] ms Max timeout in ms + @retval SUCCESS or FAIL if error occurs. + */ + int (*WaitVEnd)(int ms); + + /** @brief Configure 3A task order table + @param[in] handle Handle to sensor driver. + @param[in] tasks Task order table + @retval SUCCESS or FAIL if error occurs. + */ + int (*Set3ATaskOrder)(CUS_INT_TASK_ORDER tasks); +#endif + /** @brief Select sensor IO pin assignment + @param[in] idx Sensor pad ID. + @param[in] ulSnrType Interface type. + @param[in] ulSnrPadCfg Pin config. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetIOPad)(u32 idx, CUS_SENIF_BUS ulSnrType, u32 ulSnrPadCfg); + + //FOR CSI + + /** @brief Set maximum mipi data rate (amount of all lans) + @remarks MIPI interface only. + @param[in] idx Sensor pad ID. + @param[in] clk Max data rate. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_Clk)(u32 idx, CUS_CSI_CLK clk); + + /** @brief Set number of MIPI lanes + @remarks MIPI interface only. + @param[in] idx Sensor pad ID. + @param[in] num_lan Number of lanes. + @param[in] bon_off Clock ON/OFF control. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_Lane)(u32 idx, u16 num_lan, u8 bon_off); + + /** @brief Enable long packet type + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] ctl_cfg0_15 Control flag bit[0:15] + @param[in] ctl_cfg16_31 Control flag bit[16:31] + @param[in] ctl_cfg32_47 Control flag bit[32:47] + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_LongPacketType)(u32 idx, u16 ctl_cfg0_15, u16 ctl_cfg16_31, u16 ctl_cfg32_47); + + /** @brief Virtual channel0 hsync mode + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] mode HSYNC mode. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_VC0HSmode)(CUS_CSI_VC_HS_MODE mode); + + /** @brief Configure MIPI capture start timing + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] rx_clk_skip_ns + @param[in] rx_data_skip_ns + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_clk_data_skip)(u32 idx, u8 rx_clk_skip_ns,u8 rx_data_skip_ns); + + /** @brief Configure MIPI hdr mode + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] hdr_mode HDR mode. + @param[in] bon_off Clock ON/OFF control. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_hdr_mode)(u32 idx, CUS_HDR_MODE hdr_mode, u8 bon_off); + +#if 0 + /** @brief Configure sensor RGBIR raw pixel order + @param[in] handle Handle to sensor driver. + @param[in] bayer_id Select pixel order + @retval SUCCESS or FAIL if error occurs. + */ + int (*RGBIRFmt)(CUS_SEN_RGBIR RGBIR_id); +#endif + + /** @brief Skip vif output frame + @remarks Skip Frame interface only + @param[in] idx Sensor pad ID. + @param[in] fps Sensor current fps. + @param[in] cnt Skip counter + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetSkipFrame)(u32 idx, u32 fps, u32 cnt); +}ISensorIfAPI; + +typedef union { + //Parallel sensor + struct { + u32 parallel_reserved; //No additional attribute. + } attr_parallel; + + //MIPI sensor + struct { + u32 mipi_lane_num; + u32 mipi_data_format; //0: YUV 422 format. 1: RGB pattern. + u32 mipi_yuv_order; //YUYV or UYVY + u32 mipi_hsync_mode; + u32 mipi_sampling_delay; /** < MIPI start sampling delay */ /*bit 0~7: clk_skip_ns. bit 8~15: data_skip_ns*/ + CUS_HDR_MODE mipi_hdr_mode; + u32 mipi_hdr_virtual_channel_num; + } attr_mipi; + + //BT656 sensor + struct { + u32 bt656_total_ch; + u32 bt656_cur_ch; + u32 bt656_ch_det_en; + CUS_VIF_BT656_CHANNEL_SELECT bt656_ch_det_sel; + u32 bt656_bit_swap; + u32 bt656_8bit_mode; + CUS_VIF_BT656_VSYNC_DELAY bt656_vsync_delay; + u32 bt656_hsync_inv; + u32 bt656_vsync_inv; + u32 bt656_clamp_en; + } attr_bt656; +} InterfaceAttr_u; + +/////////////////////////////////////////////////////// + +/** @brief Sensor driver interface \n +The function here are implemented by sensor driver. +*/ +typedef struct __ms_cus_sensor{ + //short lib_idx; /**< Reserved , Do not use */ + version_info version; + char model_id[32]; /**< Please fill the sensor modle id string here then libcamera user can read model_id by using cameraGetSensorModelID() .*/ + void *sen_handle; /**< Reserved , Do not use */ + void *private_data; /**< sensor driver dependent variables should store in private_data and free when release */ + void *slave_mode_set; /**< Reserved , For sensor vsync/hsync control*/ + + // i2c + app_i2c_cfg i2c_cfg; /**< Sensor i2c setting */ + i2c_handle_t *i2c_bus; /**< Handle to sensor i2c API. */ + + // sensor if api + ISensorIfAPI *sensor_if_api; /**< sensor interface API */ + + // ae parameters + int ae_gain_delay; /**< How many frame delay from writing AE gain to take effect*/ + int ae_shutter_delay; /**< How many frame delay from writing AE shutter to take effect*/ + int ae_gain_ctrl_num; + int ae_shutter_ctrl_num; + + // polarity + CUS_CLK_POL reset_POLARITY; /** < Sensor REST pin polarity */ + CUS_CLK_POL pwdn_POLARITY; /** < Sensor Power Down pin polarity */ + CUS_CLK_POL VSYNC_POLARITY; /** < Sensor VSYNC polarity */ + CUS_CLK_POL HSYNC_POLARITY; /** < Sensor HSYNC pin polarity */ + CUS_CLK_POL PCLK_POLARITY; /** < Sensor Plxel Clock pin polarity */ + + // sensor data enum list*/ + CUS_CAMSENSOR_ISPTYPE isp_type; /** < Always use ISP_EXT */ + CUS_SEN_BAYER bayer_id; /** < Sensor bayer raw pixel order */ + CUS_SEN_RGBIR RGBIR_id; /** < Sensor bayer raw pixel order */ + CUS_SENIF_BUS sif_bus; /** < Select sensor interface */ + CUS_DATAPRECISION data_prec; /** < Raw data bits */ + CUS_SEN_FMT_CONV_MODE data_mode; /** < Data convert mode*/ + CUS_CAMSENSOR_ORIT orient; /** < Sensor mirror/flip */ + CUS_SENSOR_PAD_GROUP snr_pad_group; + CUS_SENSOR_MODE snr_pad_mode; /** < support master/slave mode sensor */ + + cus_camsensor_res_list video_res_supported; /** < Resolution list */ + InterfaceAttr_u interface_attr; + + //sensor calibration + u32 mclk; /** < Sensor master clock frequency */ + u32 sat_mingain; /**< Minimum AE gain */ + u32 ir_only_fmt; + + //////////////////////////////////////////////// + // system functions + //////////////////////////////////////////////// + + /** @brief Sensor power on sequence, I2C must be ready after calling this function + @param[in] handle Handle to sensor driver. + @remark Following configuration need to set up at this stage \n + @ref __ISensorIfAPI::Reset Reset sensor \n + @ref __ISensorIfAPI::PowerOff Sensor power down pin \n + @ref __ISensorIfAPI::MCLK Sensor master clock \n + @ref __ISensorIfAPI::SetIOPad ISP sensor IO \n + @ref __ISensorIfAPI::SetCSI_Clk [MIPI sensor only] MIPI clock\n + @ref __ISensorIfAPI::HsyncPol Hsync polarity\n + @ref __ISensorIfAPI::VsyncPol Vsync polarity\n + @ref __ISensorIfAPI::ClkPol [Parallel sensor only] Pixel clock polarity\n + @ref __ISensorIfAPI::BayerFmt Raw data format\n + @ref __ISensorIfAPI::DataPrecision Raw data pixel bits\n + @ref __ISensorIfAPI::FmtConv Raw data to ISP pixel convert\n + @retval SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_poweron)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Sensor power off + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_poweroff)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Sensor initialization + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Fill sensor initial table here, Sensor beginning to output raw images after calling this function . + */ + int (*pCus_sensor_init)(struct __ms_cus_sensor* handle); + + /** @brief Sensor Post initialization + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Fill sensor initial table here, Sensor beginning to output raw images after calling this function . + */ + int (*pCus_sensor_post_init)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Release resources those allocated in cus_camsensor_init_handle() + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Release resource allocated in \ref cus_camsensor_init_handle + */ + int (*pCus_sensor_release)(struct __ms_cus_sensor* handle); + + /** @brief Enter sensor suspend mode + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark ISP call this function before enter power saving mode + */ + int (*pCus_sensor_suspend)(struct __ms_cus_sensor* handle); + + /** @brief Sensor wakeup + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark ISP call this function after exit power saving mode + */ + int (*pCus_sensor_resume)(struct __ms_cus_sensor* handle); + + /** @brief Enable sensor pattern mode if sensor hardward supported + @param[in] handle Handle to sensor driver. + @param[in] mode Pattern select, if 0 disable pattern mode. + @retval SUCCESS or FAIL if error occurs. + @remark This function is optional + */ + int (*pCus_sensor_SetPatternMode)(struct __ms_cus_sensor* handle,u32 mode); + + // Normal + + /** @brief Check sensor ID and report to ISP sensor match or not + @param[in] handle Handle to sensor driver. + @param[out] id Receive 4 bytes customer defined sensor ID. + @retval Return SUCCESS if sensor matched or Retuen FAIL if sensor mismatch. + @remark Read sensor ID through I2C + */ + int (*pCus_sensor_GetSensorID)(struct __ms_cus_sensor* handle, u32 *id); + + /** @brief Get resolution list + @param[in] handle Handle to sensor driver. + @param[out] id Receive supported resolution list + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetVideoRes)(struct __ms_cus_sensor* handle, u32 res_idx, cus_camsensor_res **res); + + /** @brief Get resolution list + @param[in] handle Handle to sensor driver. + @param[out] id Receive supported resolution list + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetCurVideoRes)(struct __ms_cus_sensor* handle, u32 *cur_idx, cus_camsensor_res **res); + + /** @brief Select a sensor output resolution sensor list + @param[in] handle Handle to sensor driver. + @param[in] res_id Resolution id + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetVideoRes)(struct __ms_cus_sensor* handle, u32 res_id); + + /** @brief Get sensor current mirror flip setting + @param[in] handle Handle to sensor driver. + @param[out] ori Receive Mirror/Flip setting. + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetOrien)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_ORIT *ori); + + /** @brief Select a sensor mirror flip + @param[in] handle Handle to sensor driver. + @param[in] ori Mirror/Flip configuration. + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetOrien)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_ORIT ori); + + /** @brief Get sensor capability + @param[in] handle Handle to sensor driver. + @param[out] cap Receive sensor capability + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetSensorCap)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_CAP *cap); + + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + + /** @brief AE/Frame status change notification + @param[in] handle Handle to sensor driver. + @param[in] status Current status + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_AEStatusNotify)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); + + /** @brief Get sensor shutter setting in us + @param[in] handle Handle to sensor driver. + @param[out] us Receive current shutter setting + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetAEUSecs)(struct __ms_cus_sensor* handle, u32 *us); + + /** @brief Set sensor shutter in us + @param[in] handle Handle to sensor driver. + @param[in] us Shutter setting in us + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetAEUSecs)(struct __ms_cus_sensor* handle, u32 us); + + // Gain: 1x = 1024 + /** @brief Get sensor current AE gain + @param[in] handle Handle to sensor driver. + @param[out] gain Receive current AE gain + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEGain)(struct __ms_cus_sensor* handle, u32* gain); + + /** @brief Set sensor AE gain + @param[in] handle Handle to sensor driver. + @param[in] gain AE gain + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_SetAEGain)(struct __ms_cus_sensor* handle, u32 gain); + + /** @brief Get supported shutter range + @param[in] handle Handle to sensor driver. + @param[out] min Receive minimum shutter which sensor can supported + @param[out] min Receive maxiimum shutter which sensor can supported + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEMinMaxUSecs)(struct __ms_cus_sensor* handle, u32 *min, u32 *max); + + /** @brief Get supported AE gain range + @param[in] handle Handle to sensor driver. + @param[out] min Receive minimum gain which sensor can supported + @param[out] min Receive maxiimum gain which sensor can supported + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEMinMaxGain)(struct __ms_cus_sensor* handle, u32 *min, u32 *max); + + // frame rate control + /** @brief Get current fps + @param[in] handle Handle to sensor driver. + @retval Return current frame rate per second + */ + int (*pCus_sensor_GetFPS)(struct __ms_cus_sensor* handle); + + /** @brief Set sensor output fps + @param[in] handle Handle to sensor driver. + @param[in] fps + @retval Return SUCCESS or FAIL if fps is out of range. + */ + int (*pCus_sensor_SetFPS)(struct __ms_cus_sensor* handle, u32 fps); + + //[OPTIONAL] sensor calibration + /** @brief Optional function */ + int (*pCus_sensor_SetAEGain_cal)(struct __ms_cus_sensor* handle, u32); + + /** @brief Optional function */ + int (*pCus_sensor_setCaliData_gain_linearity)(struct __ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray ,u32 num); + + //Get shutter information + /** @brief Get shutter information + @param[in] handle Handle to sensor driver. + @param[out] info return shutter information. + @retval Return current frame rate per second + */ + int (*pCus_sensor_GetShutterInfo)(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info); + + /** @brief Get resolution list number + @param[in] handle Handle to sensor driver. + @param[out] ulres_num resolution list number + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetVideoResNum)(struct __ms_cus_sensor* handle, u32 *ulres_num); + + //Get shutter information + /** @brief Sensor vendor command + @param[in] handle Handle to sensor driver. + @param[in] reserved + @param[in] param Command input + @param[out] out Command output + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_CustDefineFunction)(struct __ms_cus_sensor* handle,u32 cmd_id, void *param); + + //Get Source Type + /** @brief Get Source Type + @param[in] handle Handle to sensor driver. + @param[in] plane id. + @param[out] psrc_type info + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetSrcType)(struct __ms_cus_sensor* handle, u32 plane_id, CUS_SNR_ANADEC_SRC_TYPE *psrc_type); + + // Gain: 1x = 1024 + /** @brief Try AE gain value + @param[in] handle Handle to sensor driver. + @param[in] Target AE gain value to try + @retval Return actual sensor gain will apply on the HW. + @remark gain: 1x = 1024 + */ + u32 (*pCus_sensor_TryAEGain)(struct __ms_cus_sensor* handle, u32 gain); + + // Return actual shutter + /** @brief Try AE shutter value + @param[in] handle Handle to sensor driver. + @param[in] Target AE shutter value to try , in us + @retval Return actual sensor gain will apply on the HW. + @remark gain: 1x = 1024 + */ + u32 (*pCus_sensor_TryAEShutter)(struct __ms_cus_sensor* handle, u32 us); +} ms_cus_sensor; + +/** @brief Sensor driver entry. ISP call this function before start using sensor driver. \n +ISP pass \ref ms_cus_sensor struct to obtain the driver information and function entries. \n +And all allocated resources here should be released at \ref __ms_cus_sensor::pCus_sensor_release. +Every sensor driver must implement this api. +@param[in] drv_handle A uninitialized \ref ms_cus_sensor struct from ISP, Sensor driver fill the driver information and function entries to drv_handle. +@retval SUCCESS or FAIL if error occurs. +*/ + +typedef int (*SensorInitHandle)(ms_cus_sensor* handle); + +#ifdef __cplusplus +} +#endif + +#endif /* DRV_MS_CUS_SENSOR_H_ */ +/** @} */ // end of ISP Sensor Driver Interface diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor.h b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor.h new file mode 100644 index 00000000..36452880 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef DRV_SENSOR_H +#define DRV_SENSOR_H + +#include + +#define SENSOR_DMSG(args...) do{}while(0) +#define SENSOR_EMSG(args...) CamOsPrintf(args) +#define SENSOR_IMSG(args...) CamOsPrintf(args) +#if 0 +typedef enum { + I2C_FMT_A8D8, /**< 8 bits Address, 8 bits Data */ + I2C_FMT_A16D8,/**< 16 bits Address 8 bits Data */ + I2C_FMT_A8D16,/**< 8 bits Address 16 bits Data */ + I2C_FMT_A16D16,/**< 16 bits Address 16 bits Data */ + I2C_FMT_END/**< Reserved */ +} ISP_I2C_FMT; +#endif + +extern s32 WriteRegisterPair(int slaveAddr, short reg, unsigned short value, ISP_I2C_FMT fmt); +extern u64 intlog10(u32 value); +extern u64 intlog2(u32 value); +extern s32 DrvRegisterSensorDriver(u32 nCamID, SensorInitHandle pfnSensorInitHandle); +extern s32 DrvRegisterPlaneDriver(u32 nCamID, u32 nPlaneID, SensorInitHandle pfnSensorInitHandle); +extern s32 DrvRegisterSensorDriverEx(u32 nSNRPadID, SensorInitHandle pfnSensorInitHandle, void *pPrivateData); +extern s32 DrvRegisterPlaneDriverEx(u32 nSNRPadID, u32 nPlaneID, SensorInitHandle pfnSensorInitHandle, void *pPrivateData); +extern s32 DrvSensorRelease(u32 nSNRPadID); +extern s32 DrvSensorEarlyInitSync(u32 nSNRPadID); +extern s32 DrvRegisterSensorI2CSlaveID(u32 nCamID, u32 Slaveid); +extern s32 DrvRegisterPlaneI2CSlaveID(u32 nCamID, u32 nPlaneID, u32 Slaveid); +extern s32 DrvSensorHandleVer(u32 version_major, u32 version_minor); +extern s32 DrvSensorIFVer(u32 version_major, u32 version_minor); +extern s32 DrvSensorI2CVer(u32 version_major, u32 version_minor); +#define DrvUnregisterSensorDriverEx(nSNRPadID) DrvSensorRelease((nSNRPadID)) + +#define SENSOR_USLEEP(us) CamOsUsSleep(us) +#define SENSOR_MSLEEP(ms) CamOsMsSleep(ms) +#define SENSOR_UDELAY(us) CamOsUsDelay(us) +#define SENSOR_MDELAY(ms) CamOsMsDelay(ms) +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_common.h b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_common.h new file mode 100644 index 00000000..88b2b38c --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_common.h @@ -0,0 +1,379 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef _SENSOR_OS_WRAPPER_H_ +#define _SENSOR_OS_WRAPPER_H_ + +#if defined(__KERNEL__) +#define CAM_OS_LINUX_KERNEL +#endif + +#include +#include +#include + +/******************************************************** RTK ***********************************************************/ +#if defined(CAM_OS_RTK) +typedef unsigned char bool; +#ifndef true +#define true 1 +#define false 0 +#endif + +#ifndef _SENSOR_SLAVE_ID_ +#define _SENSOR_SLAVE_ID_ 0 +#endif + +#define SENSOR_DRV_ENTRY_IMPL_BEGIN(NAME) + +#define SENSOR_DRV_ENTRY_IMPL_END(Name,LinearEntry,HdrSefEntry,HdrLefEntry)\ +int Name##_init_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + /*To avoid compile warning*/\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + for(nCamID=0;nCamID<4;++nCamID)\ + {\ + if((chmap>>nCamID)&0x1)\ + {\ + if(p0){ DrvRegisterSensorDriver(nCamID, LinearEntry);\ + DrvRegisterSensorI2CSlaveID(nCamID, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p1){ DrvRegisterPlaneDriver(nCamID, 1, HdrSefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){ DrvRegisterPlaneDriver(nCamID, 0, HdrLefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + }\ + }\ + return 0;\ +} + +static volatile int lane_num = 2; +static volatile int hdr_lane_num=2; + +#define SENSOR_DRV_PARAM_MCLK() "NONE" +#define SENSOR_USLEEP_(us) {CamOsUsDelay(us);} +#define SENSOR_MSLEEP_(ms) {CamOsMsDelay(ms);} + +/*Extension version*/ +#define SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(NAME) SENSOR_DRV_ENTRY_IMPL_BEGIN(NAME) + +#define MAX_CAMID_LEN 4 +#define SENSOR_DRV_ENTRY_IMPL_END_EX(Name,LinearEntry,HdrSefEntry,HdrLefEntry,PrivateDataType)\ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static PrivateDataType g_PrivData[2][MAX_CAMID_LEN];\ +int Name##_init_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + /*To avoid compile warning*/\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + /*void* pData = CamOsMemAlloc(sizeof(PrivateDataType));*/\ + void* pData = &g_PrivData[0][nCamID];/*Change private data to static var*/\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2){\ + /*void* pData = CamOsMemAlloc(sizeof(PrivateDataType));*/\ + void* pData = &g_PrivData[1][nCamID];/*Change private data to static var*/\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 1, HdrSefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 0, HdrLefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + DrvSensorEarlyInitSync(nCamID);\ + }\ + }\ + return 0;\ +}\ +\ +int Name##_deinit_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + /*CamOsMemRelease((void*)g_pData[0][nCamID]);*/\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + /*CamOsMemRelease((void*)g_pData[1][nCamID]);*/\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ + return 0;\ +} +/******************************************************** LINUX ***********************************************************/ +#elif defined(CAM_OS_LINUX_KERNEL) +#include +#include +#include +#include +#include +#define SENSOR_DRV_ENTRY_IMPL_BEGIN(Name) \ +int chmap = 0;\ +module_param(chmap, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(chmap, "VIF channel mapping");\ +char *mclk = "use default parameter";\ +module_param(mclk, charp, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(mclk, "Assign MCLK"); +int lane_num = 2;\ +module_param(lane_num, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(lane_num, "sensor output lane number"); +int hdr_lane_num = 4;\ +module_param(hdr_lane_num, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(hdr_lane_num, "sensor output lane number"); +int i2c_slave_id = 0;\ +module_param(i2c_slave_id, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(i2c_slave_id, "sensor i2c slave id"); + +#define SENSOR_DRV_ENTRY_IMPL_END(Name,LinearEntry,HdrSefEntry,HdrLefEntry) \ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID<4;++nCamID)\ + {\ + if((chmap>>nCamID)&0x1)\ + {\ + if(p0){ DrvRegisterSensorDriver(nCamID, LinearEntry);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p1){ DrvRegisterPlaneDriver(nCamID, 1, HdrSefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){ DrvRegisterPlaneDriver(nCamID, 0, HdrLefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + pr_info("sensordrv exit");\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +#define SENSOR_DRV_PARAM_MCLK() (mclk) +#define SENSOR_USLEEP_(us) CamOsUsSleep(us) +#define SENSOR_MSLEEP_(ms) CamOsMsSleep(ms) + +/*Extension version*/ +#define SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(Name) SENSOR_DRV_ENTRY_IMPL_BEGIN(Name) + +#define MAX_CAMID_LEN 4 +#define SENSOR_DRV_ENTRY_IMPL_END_EX(Name,LinearEntry,HdrSefEntry,HdrLefEntry,PrivateDataType) \ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 1, HdrSefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 0, HdrLefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + CamOsMemRelease((void*)g_pData[0][nCamID]);\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + CamOsMemRelease((void*)g_pData[1][nCamID]);\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +//define 3 ch AHD application impl +#define SENSOR_DRV_ENTRY_3CHAHD_IMPL_END_EX(Name,LinearEntry,AhdCh0Entry,AhdCh1Entry, AhdCh2Entry,PrivateDataType)\ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = AhdCh0Entry;\ + void* p2 = AhdCh1Entry;\ + void* p3 = AhdCh2Entry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2||p3){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 0, AhdCh0Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD0 to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 1, AhdCh1Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD1 to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p3){\ + DrvRegisterPlaneDriverEx(nCamID, 2, AhdCh2Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 2, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD2 to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + CamOsMemRelease((void*)g_pData[0][nCamID]);\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + CamOsMemRelease((void*)g_pData[1][nCamID]);\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +#endif //end of CAM_OS_LINUX_KERNEL + + +#endif //endif _SENSOR_OS_WRAPPER_H_ diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_init_table.h b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_init_table.h new file mode 100644 index 00000000..10368d9e --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/drv_sensor_init_table.h @@ -0,0 +1,114 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef _DRV_SENSOR_INIT_H_ +#define _DRV_SENSOR_INIT_H_ + +//#define SENSOR_INIT_CMDQ_MODE +#define SENSOR_INIT_DRV_MODE + +/* for sensor driver */ +#define I2C_1A1B_W(reg,val) {(reg),(val)} +#define CMDQ_DELAY_MS(ms) {(0xFFFF),(ms)} + +#define I2CM_1A1D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_1A1D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_1A1D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define I2CM_1A1D_W_BURST4(slave_addr,reg,d0,d1,d2,d3) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)} + +#define I2CM_1A1D_W_BURST5(slave_addr,reg,d0,d1,d2,d3,d4) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)} + +#define I2CM_1A1D_W_BURST6(slave_addr,reg,d0,d1,d2,d3,d4,d5) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)} + +#define I2CM_1A1D_W_BURST7(slave_addr,reg,d0,d1,d2,d3,d4,d5,d6) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)},\ + {(reg)+6,(d6)} + +#define I2CM_2A1D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_2A1D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_2A1D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define I2CM_2A1D_W_BURST4(slave_addr,reg,d0,d1,d2,d3) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)} + +#define I2CM_2A1D_W_BURST5(slave_addr,reg,d0,d1,d2,d3,d4) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)} + +#define I2CM_2A1D_W_BURST6(slave_addr,reg,d0,d1,d2,d3,d4,d5) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)} + +#define I2CM_2A2D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_2A2D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_2A2D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define SENSOR_INIT_TABLE I2C_ARRAY + +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/sensor_i2c_api.h b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/sensor_i2c_api.h new file mode 100644 index 00000000..4de7027c --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/include/sensor_i2c_api.h @@ -0,0 +1,168 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +/*! @file isp_i2c_api.h + @brief This file contains Infinity ISP I2C basic API. +*/ + +/** @defgroup group1 ISP I2C API +* @{ +*/ +#ifndef ISP_I2C_API_H +#define ISP_I2C_API_H + +#define SENSOR_I2C_SUCCESS (0) +#define SENSOR_I2C_FAIL (-1) +#define SENSOR_I2C_NOT_SUPPORT (-2) + +/**@brief handle version info */ +typedef struct _version_info{ + u16 major; + u16 minor; +}__attribute__((packed, aligned(1))) version_info; + +/*! @brief I2C API handle.*/ +struct __i2c_handle_t; + +/*! @brief I2C batch read/write data.*/ +typedef struct _I2C_ARRAY{ + u16 reg; /**< Register address.*/ + u16 data; /**< Data.*/ +} I2C_ARRAY; + +/*! @brief I2C burst read/write data.*/ +typedef struct _I2C_ARRAY_BURST{ + u16 reg; /**< Register address.*/ + u16 *data; /**< Data.*/ +} I2C_ARRAY_BURST; + +/*! @brief I2C data direction*/ +typedef enum { + I2C_RW_R, /**< Data direction read.*/ + I2C_RW_W,/**< Data direction write.*/ +} I2C_RW; + +/*! @brief Use for i2c_array_rw only */ +typedef struct _I2C_CPX_ARRAY{ + I2C_RW rw; /**< Data direction */ + u16 reg; /**< Device register address */ + u16 data; /**< Data write to device or read from device*/ +}__attribute__((packed, aligned(1))) I2C_CPX_ARRAY; + +/*! @brief Internal use for I2C API*/ +typedef enum { + I2C_FMT_A8D8, /**< 8 bits Address, 8 bits Data */ + I2C_FMT_A16D8,/**< 16 bits Address 8 bits Data */ + I2C_FMT_A8D16,/**< 8 bits Address 16 bits Data */ + I2C_FMT_A16D16,/**< 16 bits Address 16 bits Data */ + I2C_FMT_END/**< Reserved */ +} ISP_I2C_FMT; + +/*! @brief ISP_I2C_MODE Internal use for I2C API*/ +typedef enum { + I2C_LEGACY_MODE, /**< Do not use */ + I2C_NORMAL_MODE /**< Sensor driver can only use I2C_NORMAL_MODE */ +} ISP_I2C_MODE; + + +/*! @brief app_i2c_cfg I2C setting for sensor and bus.*/ +typedef struct _app_i2c_cfg{ + ISP_I2C_MODE mode; //!< I2C_NORMAL_MODE only + ISP_I2C_FMT fmt; //!< I2C data format + u32 speed; //!< I2C clock in Hz + u16 address; //!< Sensor slave address , bit[7~1] are available, bit[0] user don't care + u16 reserved; +}__attribute__((packed, aligned(1))) app_i2c_cfg; + +/*! @brief The interface of I2C APIs export to user*/ +typedef struct _i2c_handle_t { + //int version; + version_info version; + void *pdata; //i2c_private_data + + u32 nSensorID; + /** @brief Open isp i2c port. This function must be called before using isp I2C APIs. + Call i2c_close to close isp i2c port and allocated resource. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C initial configuration. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_open)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg); + + /** @brief Close isp I2C port. Call this functon to release resource which allocated form i2c_open. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C configuration mode and spped are necessary in this stage. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_close)(struct _i2c_handle_t* handle ); + + /** @brief Write single data to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] reg Device register address address width depend on cfg->fmt. + @param[in] data Data to write, data width depend on cfg->fmt. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_tx)(struct _i2c_handle_t* handle , app_i2c_cfg *cfg, u16 reg, u16 data); + + /** @brief Read single data from device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] reg Device register address address width depend on cfg->fmt. + @param[out] data Data buffer for read, data width depend on cfg->fmt. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, u16 reg, volatile u16 *data); + + /** @brief Batch write to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_tx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY *pdata, u32 len); + + /** @brief Burst write to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_burst_tx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY_BURST *pdata, u32 len); + + int (*i2c_burst_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY_BURST *pdata, u32 len); + /** @brief Batch read from device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[out] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY *pdata, u32 len); + + /** @brief Composite batch read/write + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in][out] pdata Data description array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_rw)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_CPX_ARRAY *pdata, u32 len); +} i2c_handle_t; + +/** @} */ // end of ISP I2C API + +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc2053_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc2053_mipi.c new file mode 100644 index 00000000..277d75df --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc2053_mipi.c @@ -0,0 +1,1291 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN(gc2053); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +//#define _DEBUG_ +//c11 extern int usleep(u32 usec); +//int usleep(u32 usec); + +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (2) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// // +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define F_number 22 // CFG, demo module +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CFG //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //CFG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAX_GAIN 128 // max sensor again, a-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +#define lane_number 2 +#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +//#define Preview_line_period 30000 ////HTS/PCLK=4455 pixels/148.5MHZ=30usec @MCLK=36MHz +//#define vts_30fps 1125//1346,1616 //for 29.1fps @ MCLK=36MHz +#define Preview_line_period 29630//30580 //(36M/37.125M)*30fps=29.091fps(34.375msec), hts=34.375/1125=30556, +//#define Line_per_second 32727 +#define vts_30fps 1125//1266//1150//1090 //for 29.091fps @ MCLK=36MHz +#define Prv_Max_line_number 2200 //maximum exposure line munber of sensor when preview +#define Preview_WIDTH 1920 //resolution Width when preview +#define Preview_HEIGHT 1080 //resolution Height when preview +#define Preview_MAX_FPS 30 //fastest preview FPS +#define Preview_MIN_FPS 5 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x6E //I2C slave address +#define SENSOR_I2C_SPEED 200000 //300000// 240000 //I2C speed, 60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A8D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_POS // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +int blk_flag=1; +int times = 0; +//static int drv_Fnumber = 22; +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +CUS_MCLK_FREQ UseParaMclk(void); + +CUS_CAMSENSOR_CAP sensor_cap = { + .length = sizeof(CUS_CAMSENSOR_CAP), + .version = 0x0001, +}; + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + u32 sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 line; + } expo; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool dirty; + bool orient_dirty; +} gc2053_params; +// set sensor ID address and data, + +/* typedef struct { + unsigned int total_gain; + unsigned short reg_val; +} Gain_ARRAY; + */ +static I2C_ARRAY Sensor_id_table[] = +{ +{0xf0, 0x20}, // {address of ID, ID }, +{0xf1, 0x53}, +}; + +typedef struct { + + u32 gain; + unsigned short again_reg_val_0; + unsigned short again_reg_val_1; + unsigned short again_reg_val_2; + unsigned short again_reg_val_3; + +} Gain_ARRAY; + +static I2C_ARRAY Sensor_init_table[] = +{ + /****system****/ +{0xfe, 0x80}, +{0xfe, 0x80}, +{0xfe, 0x80}, +{0xfe, 0x00}, +{0xf2, 0x00},//[1]I2C_open_ena [0]pwd_dn +{0xf3, 0x00},//0f//00[3]Sdata_pad_io [2:0]Ssync_pad_io +{0xf4, 0x36},//[6:4]pll_ldo_set +{0xf5, 0xc0},//[7]soc_mclk_enable [6]pll_ldo_en [5:4]cp_clk_sel [3:0]cp_clk_div +{0xf6, 0x44},//[7:3]wpllclk_div [2:0]refmp_div +{0xf7, 0x01},//[7]refdiv2d5_en [6]refdiv1d5_en [5:4]scaler_mode [3]refmp_enb [1]div2en [0]pllmp_en +{0xf8, 0x2c},//[7:0]pllmp_div +{0xf9, 0x42},//[7:3]rpllclk_div [2:1]pllmp_prediv [0]analog_pwc +{0xfc, 0x8e}, /****CISCTL & ANALOG****/ +{0xfe, 0x00}, +{0x87, 0x18},//[6]aec_delay_mode +{0xee, 0x30},//[5:4]dwen_sramen +{0xd0, 0xb7},//ramp_en +{0x03, 0x04}, +{0x04, 0x60}, +{0x05, 0x04},//05 +{0x06, 0x4c},//60//[11:0]hb +{0x07, 0x00}, +{0x08, 0x19}, +{0x09, 0x00}, +{0x0a, 0x02}, //cisctl row start +{0x0b, 0x00}, +{0x0c, 0x02}, //cisctl col start +{0x0d, 0x04}, +{0x0e, 0x40}, +{0x12, 0xe2}, //vsync_ahead_mode +{0x13, 0x16}, +{0x19, 0x0a}, //ad_pipe_num +{0x21, 0x1c},//eqc1fc_eqc2fc_sw +{0x28, 0x0a},//16//eqc2_c2clpen_sw +{0x29, 0x24},//eq_post_width +{0x2b, 0x04},//c2clpen --eqc2 +{0x32, 0xf8}, //[5]txh_en ->avdd28 +{0x37, 0x03}, //[3:2]eqc2sel=0 +{0x39, 0x15},//17 //[3:0]rsgl +{0x43, 0x07},//vclamp +{0x44, 0x40}, //0e//post_tx_width +{0x46, 0x0b}, +{0x4b, 0x20}, //rst_tx_width +{0x4e, 0x08}, //12//ramp_t1_width +{0x55, 0x20}, //read_tx_width_pp +{0x66, 0x05}, //18//stspd_width_r1 +{0x67, 0x05}, //40//5//stspd_width_r +{0x77, 0x01}, //dacin offset x31 +{0x78, 0x00}, //dacin offset +{0x7c, 0x93}, //[1:0] co1comp +{0x8c, 0x12}, //12 ramp_t1_ref +{0x8d, 0x92},//90 +{0x90, 0x00}, +{0x9d, 0x10}, +{0xce, 0x7c},//70//78//[4:2]c1isel +{0xd2, 0x41},//[5:3]c2clamp +{0xd3, 0xdc},//ec//0x39[7]=0,0xd3[3]=1 rsgh=vref +{0xe6, 0x50},//ramps offset /*gain*/ +{0xb6, 0xc0}, +{0xb0, 0x70}, +{0xb1, 0x01}, +{0xb2, 0x00}, +{0xb3, 0x00}, +{0xb4, 0x00}, +{0xb8, 0x01}, +{0xb9, 0x00}, +/*blk*/ +{0x26, 0x30},//23 +{0xfe, 0x01}, +{0x40, 0x23}, +{0x55, 0x07}, +{0x58, 0x00},//random noise disable + +{0x60, 0x40}, //[7:0]WB_offset +{0xfe, 0x04}, +{0x14, 0x78}, //g1 ratio +{0x15, 0x78}, //r ratio +{0x16, 0x78}, //b ratio +{0x17, 0x78}, //g2 ratio +/*window*/ +{0xfe, 0x01}, +{0x92, 0x00}, //win y1 +{0x94, 0x03}, //win x1 +{0x95, 0x04}, +{0x96, 0x38}, //[10:0]out_height +{0x97, 0x07}, +{0x98, 0x80}, //[11:0]out_width +/*ISP*/ +{0xfe, 0x01}, +{0x58, 0x00}, +{0x01, 0x05},//03//[3]dpc blending mode [2]noise_mode [1:0]center_choose 2b'11:median 2b'10:avg 2'b00:near +{0x02, 0x89}, //[7:0]BFF_sram_mode +{0x04, 0x01}, //[0]DD_en +{0x07, 0xa6}, +{0x08, 0xa9}, +{0x09, 0xa8}, +{0x0a, 0xa7}, +{0x0b, 0xff}, +{0x0c, 0xff}, +{0x0f, 0x00}, +{0x50, 0x1c}, +{0x89, 0x03}, +{0xfe, 0x04}, +{0x28, 0x86},//84 +{0x29, 0x86},//84 +{0x2a, 0x86},//84 +{0x2b, 0x68},//84 +{0x2c, 0x68},//84 +{0x2d, 0x68},//84 +{0x2e, 0x68},//83 +{0x2f, 0x68},//82 +{0x30, 0x4f},//82 +{0x31, 0x68},//82 +{0x32, 0x67},//82 +{0x33, 0x66},//82 +{0x34, 0x66},//82 +{0x35, 0x66},//82 +{0x36, 0x66},//64 +{0x37, 0x66},//68 +{0x38, 0x62}, +{0x39, 0x62}, +{0x3a, 0x62}, +{0x3b, 0x62}, +{0x3c, 0x62}, +{0x3d, 0x62}, +{0x3e, 0x62}, +{0x3f, 0x62}, +/****DVP & MIPI****/ +{0xfe, 0x01}, +{0x9a, 0x06},//[5]OUT_gate_mode [4]hsync_delay_half_pclk [3]data_delay_half_pclk [2]vsync_polarity [1]hsync_polarity [0]pclk_out_polarity +{0xfe, 0x00}, +{0x7b, 0x2a},//[7:6]updn [5:4]drv_high_data [3:2]drv_low_data [1:0]drv_pclk +{0x23, 0x2d},//[3]rst_rc [2:1]drv_sync [0]pwd_rc +{0xfe, 0x03}, +{0x01, 0x27},//20//27[6:5]clkctr [2]phy-lane1_en [1]phy-lane0_en [0]phy_clk_en +{0x02, 0x56},//[7:6]data1ctr [5:4]data0ctr [3:0]mipi_diff +{0x03, 0xb6},//b2//b6[7]clklane_p2s_sel [6:5]data0hs_ph [4]data0_delay1s [3]clkdelay1s [2]mipi_en [1:0]clkhs_ph +{0x12, 0x80}, +{0x13, 0x07},//LWC +{0x15, 0x12},//[1:0]clk_lane_mode +{0xfe, 0x00}, +{0x3e, 0x91},//40//91[7]lane_ena [6]DVPBUF_ena [5]ULPEna [4]MIPI_ena [3]mipi_set_auto_disable [2]RAW8_mode [1]ine_sync_mode [0]double_lane_en + +}; + +I2C_ARRAY TriggerStartTbl[] = { +//{0x30f4,0x00},//Master mode start +}; + +I2C_ARRAY PatternTbl[] = { + //pattern mode +}; + +I2C_ARRAY Current_Mirror_Flip_Tbl[] = { + {0x17, 0x80}, // bit[1:0] +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + + +static I2C_ARRAY mirr_flip_table[] = +{ + #if 0 + {0x17, 0x83}, // bit[1:0] + + {0x17, 0x82}, // bit[1:0] + + {0x17, 0x81}, // bit[1:0] + + {0x17, 0x80}, // bit[1:0] + #endif + {0x17, 0x80}, // bit[1:0] + + {0x17, 0x81}, // bit[1:0] + + {0x17, 0x82}, // bit[1:0] + + {0x17, 0x83}, // bit[1:0] + +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + + +static int g_sensor_ae_min_gain = 1024;//1280; + +static I2C_ARRAY gain_reg[] = { + {0xfe, 0x00}, + {0xb4, 0x00}, + {0xb3, 0x00}, + {0xb8, 0x00}, + {0xb9, 0x00}, + {0xb1, 0x00}, + {0xb2, 0x00}, +}; + + +static I2C_ARRAY expo_reg[] = { + {0x04, 0xd0}, + {0x03, 0x05}, +}; + + +static I2C_ARRAY vts_reg[] = { + {0x41, 0x05}, + {0x42, 0xdc}, + +}; + +I2C_ARRAY temperature_reg[] = { + {0x0c, 0x30}, + {0x0d, 0x30}, + {0x0e, 0x30}, + {0x0f, 0x30}, +}; + +static Gain_ARRAY gain_table[]={ + {1024 , 0x00, 0x00,0x01,0x00}, + {1230 , 0x00, 0x10,0x01,0x0c}, + {1440 , 0x00, 0x20,0x01,0x1b}, + {1730 , 0x00, 0x30,0x01,0x2c}, + {2032 , 0x00, 0x40,0x01,0x3f}, + {2380 , 0x00, 0x50,0x02,0x16}, + {2880 , 0x00, 0x60,0x02,0x35}, + {3460 , 0x00, 0x70,0x03,0x16}, + {4080 , 0x00, 0x80,0x04,0x02}, + {4800 , 0x00, 0x90,0x04,0x31}, + {5776 , 0x00, 0xa0,0x05,0x32}, + {6760 , 0x00, 0xb0,0x06,0x35}, + {8064 , 0x00, 0xc0,0x08,0x04}, + {9500 , 0x00, 0x5a,0x09,0x19}, + {11552, 0x00, 0x83,0x0b,0x0f}, + {13600, 0x00, 0x93,0x0d,0x12}, + {16132, 0x00, 0x84,0x10,0x00}, + {18912, 0x00, 0x94,0x12,0x3a}, + {22528, 0x01, 0x2c,0x1a,0x02}, + {27036, 0x01, 0x3c,0x1b,0x20}, + {32340, 0x00, 0x8c,0x20,0x0f}, + {38256, 0x00, 0x9c,0x26,0x07}, + {45600, 0x02, 0x64,0x36,0x21}, + {53912, 0x02, 0x74,0x37,0x3a}, + {63768, 0x00, 0xc6,0x3d,0x02}, + {76880, 0x00, 0xdc,0x3f,0x3f}, + {92300, 0x02, 0x85,0x3f,0x3f}, + {108904, 0x02, 0x95,0x3f,0x3f}, + {123568, 0x00, 0xce,0x3f,0x3f}, +}; + +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME gc2053 + + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +static int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif + +//static u32 timeGetTimeU(void) +//{ +// CamOsTimespec_t tRes; +// CamOsGetMonotonicTime(&tRes); +// return (tRes.nSec * 1000000)+(tRes.nNanoSec/1000); +//} +//static u32 TStart = 0; + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //TStart = timeGetTimeU(); + /*PAD and CSI*/ + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); ///??? + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); ///??? + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); //========= ???? + + /*Power ON*/ + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + + /*Reset PIN*/ + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + SENSOR_USLEEP(1000); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + SENSOR_DMSG("[%s] reset high\n", __FUNCTION__); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_USLEEP(1000); + + /*MCLK ON*/ + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_USLEEP(5000); + //CamOsPrintf("pCus_poweron = %d us \n",timeGetTimeU()-TStart); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + SENSOR_USLEEP(1000); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + sensor_if->MCLK(idx, 0, handle->mclk); + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + SensorReg_Write(0xfe,0x00); + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if( SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + continue; + } + + //convert sensor id to u32 format + for(i=0;i>= 8; + SENSOR_DMSG("[%s]gc2053 Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + //SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + return SUCCESS; +} + +static int gc2053_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + return SUCCESS; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +//static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); +static int pCus_init(ms_cus_sensor *handle) +{ + int i,cnt=0; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + //TStart = timeGetTimeU(); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table);i++) + { + if(Sensor_init_table[i].reg==0xffff) + { + msleep(Sensor_init_table[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table[i].reg,Sensor_init_table[i].data) != SUCCESS) + { + cnt++; + //SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + //SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + msleep(10); + } + } + } + +/* + for(i=0;i< ARRAY_SIZE(PatternTbl);i++) + { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + { + //MSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + } +*/ + + pCus_SetAEGain(handle,1024); //Set sensor gain = 1x + pCus_SetAEUSecs(handle, 30000); + pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + + //CamOsPrintf("pCus_init = %d us \n",timeGetTimeU()-TStart); + + return SUCCESS; +} +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + short HFlip;//,VFlip; + + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Read(0x17, &HFlip); + // SensorReg_Read(0x1d, &VFlip); + + if(((HFlip&0x03)==0x03)) //&&((VFlip&0x80)==0)) + *orit = CUS_ORIT_M0F0; + else if(((HFlip&0x03)==0x02)) //&&((VFlip&0x80)==0)) + *orit = CUS_ORIT_M1F0; + else if(((HFlip&0x03)==0x01)) //&&((VFlip&0x80)!=0)) + *orit = CUS_ORIT_M0F1; + else if(((HFlip&0x03)==0x00)) //&&((VFlip&0x80)!=0)) + *orit = CUS_ORIT_M1F1; + + //SENSOR_DMSG("mirror:%x\r\n", HFlip&0x80); + //SENSOR_DMSG("Flip:%x\r\n", VFlip&0x80); + + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) { + //gc2053_params *params = (gc2053_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + switch(orit) + { + case CUS_ORIT_M0F0: + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Write(mirr_flip_table[0].reg,mirr_flip_table[0].data); + Current_Mirror_Flip_Tbl[0].reg = mirr_flip_table[0].reg; + Current_Mirror_Flip_Tbl[0].data = mirr_flip_table[0].data; + // handle->bayer_id= CUS_BAYER_BG; + break; + case CUS_ORIT_M1F0: + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Write(mirr_flip_table[1].reg,mirr_flip_table[1].data); + Current_Mirror_Flip_Tbl[0].reg = mirr_flip_table[1].reg; + Current_Mirror_Flip_Tbl[0].data = mirr_flip_table[1].data; + // handle->bayer_id= CUS_BAYER_BG; + break; + case CUS_ORIT_M0F1: + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Write(mirr_flip_table[2].reg,mirr_flip_table[2].data); + Current_Mirror_Flip_Tbl[0].reg = mirr_flip_table[2].reg; + Current_Mirror_Flip_Tbl[0].data = mirr_flip_table[2].data; + // handle->bayer_id= CUS_BAYER_GR; + break; + case CUS_ORIT_M1F1: + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Write(mirr_flip_table[3].reg,mirr_flip_table[3].data); + Current_Mirror_Flip_Tbl[0].reg = mirr_flip_table[3].reg; + Current_Mirror_Flip_Tbl[0].data = mirr_flip_table[3].data; + // handle->bayer_id= CUS_BAYER_GR; + break; + default : + SensorReg_Write(0xfe,0x00);//page 0 + SensorReg_Write(mirr_flip_table[0].reg,mirr_flip_table[0].data); + Current_Mirror_Flip_Tbl[0].reg = mirr_flip_table[0].reg; + Current_Mirror_Flip_Tbl[0].data = mirr_flip_table[0].data; + // handle->bayer_id= CUS_BAYER_BG; + break; + } + //SensorReg_Write(0xef,0x01); + // SensorReg_Write(0x09,1); + + // params->orient_dirty = true; + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + gc2053_params *params = (gc2053_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = vts_reg[0].data << 8 | vts_reg[1].data ; + + if (params->expo.fps >= 5000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + int vts=0; + gc2053_params *params = (gc2053_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + //return SUCCESS; + + if(fps>=5 && fps <= 30){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*30)/fps; + }else if(fps>=5000 && fps <= 30000){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*30000)/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + //SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if ((params->expo.line) > (params->expo.vts)-4) { + vts = params->expo.line + 4; + }else + vts = params->expo.vts; + vts_reg[0].data = (vts >> 8) & 0x003f; + vts_reg[1].data = (vts >> 0) & 0x00ff; + + + params->dirty = true; + return SUCCESS; +} + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status){ + gc2053_params *params = (gc2053_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + + break; + case CUS_FRAME_ACTIVE: + if(params->dirty) + { + SensorRegArrayW((I2C_ARRAY*)gain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)expo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)vts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + break; + default : + break; + } + + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { +// gc2053_params *params = (gc2053_params *)handle->private_data; + u32 lines = 0; + + lines = (u32)(expo_reg[0].data&0xff); + lines |= (u32)(expo_reg[1].data&0x3f)<<8; + + *us = (lines*Preview_line_period)/1000; + + + SENSOR_DMSG("[%s] sensor expo lines/us %ld,%ld us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + u32 lines = 0, vts = 0; + gc2053_params *params = (gc2053_params *)handle->private_data; + + lines=(1000*us)/Preview_line_period; + + if(lines<1) lines=1; + if (lines > params->expo.vts-4) { + vts = lines + 4; + }else + vts = params->expo.vts; + + params->expo.line = lines; + SENSOR_DMSG("[%s] us %ld, lines %ld, vts %ld\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + + expo_reg[0].data = (lines) & 0x00ff; + expo_reg[1].data = (lines>>8) & 0x003f; + vts_reg[0].data = (vts >> 8) & 0x003f; + vts_reg[1].data = (vts >> 0) & 0x00ff; + + + params->dirty = true; + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + // gc2053_params *params = (gc2053_params *)handle->private_data; + + u32 Again_0 = 1, Dgain_0 = 1; + u8 i; + u32 Fine_again = 1024; + + + for(i = 0;i < sizeof(gain_table)/sizeof(Gain_ARRAY);i++ ) + { + if(( gain_table[i].again_reg_val_0 ==gain_reg[1].data) && (gain_table[i].again_reg_val_1 ==gain_reg[2].data)) + { + Fine_again = gain_table[i].gain; + break; + } + } + + Dgain_0 = (gain_reg[5].data & 0xf) * 64 + (gain_reg[6].data >> 2); + Again_0 = Fine_again; + *gain =(u32)((Again_0 * Dgain_0)/64); + + + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + + gc2053_params *params = (gc2053_params *)handle->private_data; + u32 dgain = 1; + u8 dgain_0 = 1, dgain_1 = 0; + u8 i = 0,tmp = 0; + int temperature_value = 0; + params->expo.final_gain = gain; + + if (gain < 1024) { + gain = 1024; + } else if (gain > SENSOR_MAX_GAIN * 1024) { + gain = SENSOR_MAX_GAIN * 1024; + } + + if(0 == times % 4) + { + SensorReg_Write(0xfe, 0x04); + SensorReg_Read(0x0c,&temperature_reg[0].data); + SensorReg_Read(0x0d,&temperature_reg[1].data); + SensorReg_Read(0x0e,&temperature_reg[2].data); + SensorReg_Read(0x0f,&temperature_reg[3].data); + SensorReg_Write(0xfe, 0x00); + if(times > 20) + { + times = 0; + } + } + temperature_value = (temperature_reg[0].data + temperature_reg[1].data + temperature_reg[2].data + temperature_reg[3].data) >> 2; + + if(temperature_value >= 0x64) + { + if(gain > gain_table[16].gain) + { + tmp = 16; + blk_flag=2; + } + else + { + for(i = 0;i < 16;i++ ) + { + if((gain >= gain_table[i].gain) && (gain < gain_table[i + 1].gain)) + { + tmp = i; + blk_flag=2; + break; + } + } + } + } + else if(temperature_value <= 0x18) + { + + for(i = 0;i < sizeof(gain_table)/sizeof(Gain_ARRAY) - 1;i++ ) + { + if((gain >= gain_table[i].gain) && (gain < gain_table[i + 1].gain)) + { + tmp = i; + blk_flag=1; + break; + } + else + { + blk_flag=1; + tmp = sizeof(gain_table)/sizeof(Gain_ARRAY) -1; + } + } + } + else + { + if(blk_flag==2) + { + if(gain >= gain_table[16].gain) + { + //gain = gain_table[16].gain; + tmp = 16; + } + else + { + for(i = 0;i < 16;i++ ) + { + if((gain >= gain_table[i].gain) && (gain < gain_table[i + 1].gain)) + { + tmp = i; + break; + } + } + } + } + if(blk_flag==1) + { + + for(i = 0;i < sizeof(gain_table)/sizeof(Gain_ARRAY) - 1;i++ ) + { + if((gain >= gain_table[i].gain) && (gain < gain_table[i + 1].gain)) + { + tmp = i; + break; + } + else + { + blk_flag=1; + tmp = sizeof(gain_table)/sizeof(Gain_ARRAY) - 1; + } + } + } + } + + + dgain =(gain*64)/(gain_table[tmp].gain); + dgain_0 = (dgain)>>6; + dgain_1 =(dgain & 0x3f)<<2; + gain_reg[1].data = gain_table[tmp].again_reg_val_0; + gain_reg[2].data = gain_table[tmp].again_reg_val_1; + gain_reg[3].data = gain_table[tmp].again_reg_val_2; + gain_reg[4].data = gain_table[tmp].again_reg_val_3; + + gain_reg[5].data = dgain_0; + gain_reg[6].data = dgain_1; + + + SENSOR_DMSG("[%s] set gain/regH/regL=%d/0x%x/0x%x\n", __FUNCTION__, gain,gain_reg[1].data,gain_reg[2].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1;//30 + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min =handle->sat_mingain; + *max = SENSOR_MAX_GAIN*1024; + return SUCCESS; +} + +static int gc2053_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period*1;//2 + info->step = Preview_line_period*1;//2 + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + // u32 i, j; +/* + for(i=0,j=0;i< num ;i++,j+=2){ + gain_gap_compensate[i].gain=pArray[i].gain; + gain_gap_compensate[i].offset=pArray[i].offset; + } + //SENSOR_DMSG("[%s]%d, %d, %d, %d\n", __FUNCTION__, num, pArray[0].gain, pArray[1].gain, pArray[num-1].offset); +*/ + return SUCCESS; +} + +static int cus_camsensor_init_handle(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + gc2053_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + handle->private_data = CamOsMemCalloc(1, sizeof(gc2053_params)); + params = (gc2053_params *)handle->private_data; + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + strcpy(handle->model_id,"gc2053_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= 0; + handle->video_res_supported.res[0].crop_start_y= 0; + handle->video_res_supported.res[0].nOutputWidth= 1920; + handle->video_res_supported.res[0].nOutputHeight= 1080; + SENSOR_DMSG(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps"); + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init ; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = gc2053_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration +// handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = gc2053_GetShutterInfo; + params->expo.vts=vts_30fps; + params->expo.fps = 30; + params->expo.line = 100; + params->dirty = false; + params->orient_dirty = false; + return SUCCESS; +} + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) { + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_OFF); + //sensor_if->SetCSI_Clk(handle,CUS_CSI_CLK_DISABLE); + if (handle && handle->private_data) { + SENSOR_DMSG("[%s] release handle, handle %x, private data %x", + __FUNCTION__, + (int)handle, + (int)handle->private_data); + CamOsMemRelease(handle->private_data); + handle->private_data = NULL; + } + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END( gc2053, + cus_camsensor_init_handle, + NULL, + NULL + ); + diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc4653_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc4653_mipi.c new file mode 100644 index 00000000..4383e79a --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_gc4653_mipi.c @@ -0,0 +1,1108 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(gc4653); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (2) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CFG //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 //CFG +#define SENSOR_BAYERID CUS_BAYER_GR //CFG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAX_GAIN (77660)/100 // max sensor again, a-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +#define lane_number 2 +#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +#define Preview_line_period 22222//30580 //(36M/37.125M)*30fps=29.091fps(34.375msec), hts=34.375/1125=30556, +//#define Line_per_second 32727 +#define vts_30fps 1500//1266//1150//1090 //for 29.091fps @ MCLK=36MHz +//#define Prv_Max_line_number 2200 //maximum exposure line munber of sensor when preview +#define Preview_WIDTH 2560 //resolution Width when preview +#define Preview_HEIGHT 1440 //resolution Height when preview +#define Preview_MAX_FPS 30 //fastest preview FPS +#define Preview_MIN_FPS 5 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x52 //I2C slave address +#define SENSOR_I2C_SPEED 200000 //300000// 240000 //I2C speed, 60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_POS // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +CUS_MCLK_FREQ UseParaMclk(void); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + u32 sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 line; + } expo; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool dirty; + bool orient_dirty; + I2C_ARRAY tVts_reg[2]; + I2C_ARRAY tGain_reg[7]; + I2C_ARRAY tExpo_reg[2]; + I2C_ARRAY tMirror_reg[1]; +} gc4653_params; +// set sensor ID address and data, + +/* typedef struct { + unsigned int total_gain; + unsigned short reg_val; +} Gain_ARRAY; + */ +const static I2C_ARRAY Sensor_id_table[] = +{ + {0x03f0, 0x46}, // {address of ID, ID }, + {0x03f1, 0x53}, +}; + +typedef struct { + u32 gain; + unsigned short again_reg_val_0; + unsigned short again_reg_val_1; + unsigned short again_reg_val_2; + unsigned short again_reg_val_3; + unsigned short again_reg_val_4; +} Gain_ARRAY; + +const static I2C_ARRAY Sensor_init_table[] = +{ +/****************************************/ +//version 6.3 +//mclk 27Mhz +//mipiclk 648Mhz +//framelength 1500 +//linelength 4800 +//pclk 216Mhz +//rowtime 22.2222us +//pattern grbg + +/****************************************/ + +/****************************************/ +/*SYSTEM*/ +/****************************************/ +{0x03fe, 0xf0}, +{0x03fe, 0x00}, +{0x0317, 0x00}, +{0x0320, 0x77}, +{0x0324, 0xc8}, +{0x0325, 0x06}, +{0x0326, 0x60}, +{0x0327, 0x03}, +{0x0334, 0x40}, +{0x0336, 0x60}, +{0x0337, 0x82}, +{0x0315, 0x25}, +{0x031c, 0xc6}, +/****************************************/ +/*frame structure*/ +/****************************************/ +{0x0287, 0x18}, +{0x0084, 0x00}, +{0x0087, 0x50}, +{0x029d, 0x08}, +{0x0290, 0x00}, +//AHD 30 other need change +{0x0340, 0x05}, +{0x0341, 0xdc}, +{0x0345, 0x06}, +{0x034b, 0xb0}, +{0x0352, 0x08}, +{0x0354, 0x08}, +/****************************************/ +/*ANALOG CIRCUIT*/ +/****************************************/ +{0x02d1, 0xb0}, +{0x023c, 0x05}, +{0x0223, 0xfb}, +{0x0232, 0xc4}, +{0x0279, 0x53}, +{0x02d3, 0x01}, +{0x0243, 0x06}, +{0x02ce, 0xbf}, +{0x02ee, 0x30}, +{0x026f, 0x70}, +{0x0257, 0x09}, +{0x0211, 0x02}, +{0x0219, 0x09}, +{0x023f, 0x2d}, +{0x0518, 0x00}, +{0x0519, 0x01}, +{0x0515, 0x08}, +{0x02d9, 0x3f}, +{0x02da, 0x02}, +{0x02db, 0xe8}, +{0x02e6, 0x20}, +{0x021b, 0x10}, +{0x0252, 0x22}, +{0x024e, 0x22}, +{0x02c4, 0x01}, +{0x021d, 0x07}, +{0x024a, 0x01}, +{0x02ca, 0x02}, +{0x0262, 0x10}, +{0x029a, 0x20}, +{0x021c, 0x0e}, +{0x0298, 0x03}, +{0x029c, 0x00}, +{0x027e, 0x14}, +{0x02c2, 0x10}, +{0x0540, 0x20}, +{0x0546, 0x01}, +{0x0548, 0x01}, +{0x0544, 0x01}, +{0x0242, 0x1b}, +{0x02c0, 0x1b}, +{0x02c3, 0x20}, +{0x02e4, 0x10}, +{0x022e, 0x00}, +{0x027b, 0x3f}, +{0x0269, 0x0f}, +{0x02d2, 0x40}, +{0x027c, 0x08}, +{0x023a, 0x2e}, +{0x0245, 0xce}, +{0x0530, 0x20}, +{0x0531, 0x02}, +{0x0228, 0x28}, +{0x02ab, 0x00}, +{0x0250, 0x00}, +{0x0221, 0x28}, +{0x02ac, 0x00}, +{0x02a5, 0x02}, +{0x0260, 0x0b}, +{0x0216, 0x04}, +{0x0299, 0x1C}, +{0x02bb, 0x0d}, +{0x02a3, 0x02}, +{0x02a4, 0x02}, +{0x021e, 0x02}, +{0x024f, 0x08}, +{0x028c, 0x08}, +{0x0532, 0x3f}, +{0x0533, 0x02}, +{0x0277, 0x38}, +{0x0276, 0x60}, +{0x0239, 0xc0}, +/*exp*/ +{0x0202, 0x05}, +{0x0203, 0xd0}, +/*gain*/ +{0x0205, 0xc0}, +{0x02b0, 0x60}, //0x90 +/*dpc*/ +{0x0002, 0xa9}, +{0x0004, 0x01}, +/****************************************/ +/*mipi*/ +/****************************************/ +//30fps +{0x0342, 0x06}, +{0x0343, 0x40}, +{0x03fe, 0x10}, +{0x03fe, 0x00}, +{0x0106, 0x78}, +{0x0108, 0x0c}, +{0x0114, 0x01}, +{0x0115, 0x12}, +{0x0180, 0x46}, +{0x0181, 0x30}, +{0x0182, 0x05}, +{0x0185, 0x01}, +{0x03fe, 0x10}, +{0x03fe, 0x00}, +{0x0100, 0x09}, +}; + +const I2C_ARRAY TriggerStartTbl[] = { +//{0x30f4,0x00},//Master mode start +}; + +const I2C_ARRAY PatternTbl[] = { + //pattern mode +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + +const I2C_ARRAY mirror_reg[] = { + {0x0101, 0x00}, +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +static int g_sensor_ae_min_gain = 1024;//1280; + +const static I2C_ARRAY gain_reg[] = { + {0x02b3, 0x00}, + {0x0519, 0x04}, + {0x02d9, 0x42}, + {0x02b8, 0x01}, + {0x02b9, 0x00}, + {0x020e, 0x01}, + {0x020f, 0x00}, +}; + +const static I2C_ARRAY expo_reg[] = { + {0x0203, 0xd0}, // expo[7:0] + {0x0202, 0x05}, // expo[15:8] +}; + +const static I2C_ARRAY vts_reg[] = { + {0x0340, 0x05}, + {0x0341, 0xdc}, +}; + + static Gain_ARRAY gain_table[]={ + //02b3, 0519, 02d9, 02b8, 02b9 + { 1024, 0x00, 0x04, 0x42, 0x01, 0x00}, + { 1213, 0x20, 0x05, 0x43, 0x01, 0x0B}, + { 1434, 0x01, 0x04, 0x42, 0x01, 0x19}, + { 1699, 0x21, 0x05, 0x43, 0x01, 0x2a}, + { 2048, 0x02, 0x04, 0x42, 0x02, 0x00}, + { 2427, 0x22, 0x05, 0x43, 0x02, 0x17}, + { 2867, 0x03, 0x05, 0x43, 0x02, 0x33}, + { 3398, 0x23, 0x06, 0x44, 0x03, 0x14}, + { 4096, 0x04, 0x06, 0x44, 0x04, 0x00}, + { 4854, 0x24, 0x08, 0x46, 0x04, 0x2f}, + { 5734, 0x05, 0x08, 0x46, 0x05, 0x26}, + { 6795, 0x25, 0x0a, 0x48, 0x06, 0x28}, + { 8192, 0x06, 0x0c, 0x4a, 0x08, 0x00}, + { 9708, 0x26, 0x0d, 0x4b, 0x09, 0x1E}, + {11469, 0x46, 0x0f, 0x4d, 0x0B, 0x0C}, + {13591, 0x66, 0x11, 0x4f, 0x0D, 0x11}, + {16384, 0x0e, 0x13, 0x51, 0x10, 0x00}, + {19415, 0x2e, 0x16, 0x54, 0x12, 0x3D}, + {22938, 0x4e, 0x19, 0x57, 0x16, 0x19}, + {27181, 0x6e, 0x1b, 0x59, 0x1A, 0x22}, + {32768, 0x1e, 0x1e, 0x5c, 0x20, 0x00}, + {38830, 0x3e, 0x21, 0x5f, 0x25, 0x3A}, + {45875, 0x5e, 0x25, 0x63, 0x2C, 0x33}, + {54362, 0x7e, 0x29, 0x67, 0x35, 0x05}, + {65536, 0x9e, 0x2d, 0x6b, 0x40, 0x00}, + {77660, 0xbe, 0x40, 0x78, 0x4B, 0x35}, +}; + +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME gc4653 + + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +static int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif + +//static u32 timeGetTimeU(void) +//{ +// CamOsTimespec_t tRes; +// CamOsGetMonotonicTime(&tRes); +// return (tRes.nSec * 1000000)+(tRes.nNanoSec/1000); +//} +//static u32 TStart = 0; + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //TStart = timeGetTimeU(); + /*PAD and CSI*/ + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); ///??? + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); ///??? + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); //========= ???? + + /*Power ON*/ + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + + /*Reset PIN*/ + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + SENSOR_USLEEP(1000); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + SENSOR_DMSG("[%s] reset high\n", __FUNCTION__); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_USLEEP(1000); + + /*MCLK ON*/ + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_USLEEP(5000); + //CamOsPrintf("pCus_poweron = %d us \n",timeGetTimeU()-TStart); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + SENSOR_USLEEP(1000); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + sensor_if->MCLK(idx, 0, handle->mclk); + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if( SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + continue; + } + + //convert sensor id to u32 format + for(i=0;i>= 8; + SENSOR_DMSG("[%s]gc4653 Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + //SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + return SUCCESS; +} + +static int gc4653_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + return SUCCESS; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +//static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); +static int pCus_init(ms_cus_sensor *handle) +{ + int i,cnt=0; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + //TStart = timeGetTimeU(); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table);i++) + { + if(Sensor_init_table[i].reg==0xffff) + { + msleep(Sensor_init_table[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table[i].reg,Sensor_init_table[i].data) != SUCCESS) + { + cnt++; + + if(cnt>=10) + { + + return FAIL; + } + msleep(10); + } + } + } +/* + for(i=0;i< ARRAY_SIZE(PatternTbl);i++) + { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + { + //MSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + } +*/ + pCus_SetAEGain(handle,1024); //Set sensor gain = 1x + pCus_SetAEUSecs(handle, 30000); + pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + char sen_data; + sen_data = mirror_reg[0].data; + SENSOR_DMSG("mirror:%x\r\n", sen_data); + switch(sen_data) { + case 0x03: + *orit = CUS_ORIT_M0F0; + break; + case 0x02: + *orit = CUS_ORIT_M1F0; + break; + case 0x01: + *orit = CUS_ORIT_M0F1; + break; + case 0x00: + *orit = CUS_ORIT_M1F1; + break; + } + + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) { + gc4653_params *params = (gc4653_params *)handle->private_data; + switch(orit) { + case CUS_ORIT_M0F0: + params->tMirror_reg[0].data = 0x03; + params->orient_dirty = true; + //params->dirty = true; + break; + case CUS_ORIT_M1F0: + params->tMirror_reg[0].data = 0x2; + params->orient_dirty = true; + //params->dirty = true; + break; + case CUS_ORIT_M0F1: + params->tMirror_reg[0].data = 0x01; + params->orient_dirty = true; + //params->dirty = true; + break; + case CUS_ORIT_M1F1: + params->tMirror_reg[0].data = 0x00; + params->orient_dirty = true; + //params->dirty = true; + break; + } + + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + gc4653_params *params = (gc4653_params *)handle->private_data; + return params->expo.fps; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + int vts=0; + gc4653_params *params = (gc4653_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + if(fps>=5 && fps <= 30){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*30)/fps; + }else if(fps>=5000 && fps <= 30000){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*30000)/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + //SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if ((params->expo.line) > (params->expo.vts)-4) { + vts = params->expo.line + 4; + }else + vts = params->expo.vts; + params->tVts_reg[0].data = (vts >> 8) & 0x003f; + params->tVts_reg[1].data = (vts >> 0) & 0x00ff; + //vts_reg[0].data = ((params->expo.vts - 12 ) >> 8) & 0x001f; + //vts_reg[1].data = ((params->expo.vts - 12) >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status){ + gc4653_params *params = (gc4653_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + + break; + case CUS_FRAME_ACTIVE: + if(params->orient_dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tMirror_reg, ARRAY_SIZE(mirror_reg)); + params->orient_dirty = false; + } + if(params->dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + break; + default : + break; + } + + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { + gc4653_params *params = (gc4653_params *)handle->private_data; + u32 lines = 0; + + lines = (u32)(params->tExpo_reg[0].data&0xff); + lines |= (u32)(params->tExpo_reg[1].data&0x3f)<<8; + + *us = (lines*Preview_line_period)/1000; + + + SENSOR_DMSG("[%s] sensor expo lines/us %ld,%ld us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + u32 lines = 0, vts = 0; + gc4653_params *params = (gc4653_params *)handle->private_data; + + lines=(1000*us)/Preview_line_period; + + if(lines<1) lines=1; + if (lines > params->expo.vts-4) { + vts = lines + 4; + }else + vts = params->expo.vts; + + params->expo.line = lines; + SENSOR_DMSG("[%s] us %ld, lines %ld, vts %ld\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + params->tExpo_reg[0].data = (lines) & 0x00ff; + params->tExpo_reg[1].data = (lines>>8) & 0x003f; + params->tVts_reg[0].data = (vts >> 8) & 0x003f; + params->tVts_reg[1].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + gc4653_params *params = (gc4653_params *)handle->private_data; + u32 Again_0 = 1, Dgain_0 = 1; + u8 i; + u32 Fine_again = 1024; + + for(i = 0;i < sizeof(gain_table)/sizeof(Gain_ARRAY);i++ ) { + if(( gain_table[i].again_reg_val_0 == params->tGain_reg[1].data) && (gain_table[i].again_reg_val_1 == params->tGain_reg[2].data)) + { + Fine_again = gain_table[i].gain; + break; + } + } + + Dgain_0 = (params->tGain_reg[5].data & 0xf) * 64 + (params->tGain_reg[6].data >> 2); + Again_0 = Fine_again; + *gain =(u32)((Again_0 * Dgain_0)/64); + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + gc4653_params *params = (gc4653_params *)handle->private_data; + u32 dgain = 1; +// u32 gain_64 = gain; + u8 dgain_0 = 1, dgain_1 = 0; + u8 i = 0,tmp = 0; +// int temperature_value; + params->expo.final_gain = gain; + + if (gain < 1024) { + gain = 1024; + } else if (gain > SENSOR_MAX_GAIN * 1024) { + gain = SENSOR_MAX_GAIN * 1024; + } + + for(i = 1;i < sizeof(gain_table)/sizeof(Gain_ARRAY);i++ ) + { + if((gain >= gain_table[i-1].gain) && (gain < gain_table[i].gain)) + { + tmp = i - 1; + break; + } + else + tmp = sizeof(gain_table)/sizeof(Gain_ARRAY) - 1; + } + + dgain =(gain*64)/(gain_table[tmp].gain); + dgain_0 = (dgain)>>6; + dgain_1 =(dgain & 0x3f)<<2; + params->tGain_reg[0].data = gain_table[tmp].again_reg_val_0; + params->tGain_reg[1].data = gain_table[tmp].again_reg_val_1; + params->tGain_reg[2].data = gain_table[tmp].again_reg_val_2; + params->tGain_reg[3].data = gain_table[tmp].again_reg_val_3; + params->tGain_reg[4].data = gain_table[tmp].again_reg_val_4; + + params->tGain_reg[5].data = dgain_0; + params->tGain_reg[6].data = dgain_1; + SENSOR_DMSG("[%s] set gain/regH/regL=%d/0x%x/0x%x\n", __FUNCTION__, gain,gain_reg[1].data,gain_reg[2].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 30; + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min =handle->sat_mingain; + *max = SENSOR_MAX_GAIN*1024; + return SUCCESS; +} + +static int gc4653_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period*1;//2 + info->step = Preview_line_period*1;//2 + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +int cus_camsensor_init_handle(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + gc4653_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (gc4653_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tMirror_reg, mirror_reg, sizeof(mirror_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + strcpy(handle->model_id,"gc4653_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= 0; + handle->video_res_supported.res[0].crop_start_y= 0; + handle->video_res_supported.res[0].nOutputWidth= 2560; + handle->video_res_supported.res[0].nOutputHeight= 1440; + SENSOR_DMSG(handle->video_res_supported.res[0].strResDesc, "2560x1440@30fps"); + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init ; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = gc4653_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration +// handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = gc4653_GetShutterInfo; + params->expo.vts=vts_30fps; + params->expo.fps = 30; + params->expo.line = 100; + params->dirty = false; + params->orient_dirty = false; + return SUCCESS; +} + +int cus_camsensor_release_handle(ms_cus_sensor *handle) { + + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( gc4653, + cus_camsensor_init_handle, + NULL, + NULL, + gc4653_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx307_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx307_mipi.c new file mode 100644 index 00000000..adeb0367 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx307_mipi.c @@ -0,0 +1,3208 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX307_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +#define SENSOR_CHANNEL_imx307_ISP_CALIBRATION_ENABLE (1) + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (2) +#define SENSOR_MIPI_LANE_NUM_DOL (4) +//#define SENSOR_MIPI_HDR_MODE (0) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +#define HDR_DOL_10bit (0) +#define HDR_DOL_12bit (1) +//============================================ + +//#define LOGD //(...) + +//c11 extern int usleep(u32 usec); +//int usleep(u32 usec); + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + +#undef SENSOR_DBG +#define SENSOR_DBG 0 + +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// ���?// +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +//#define F_number 22 // CFG, demo module +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_12 //CFG //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#if HDR_DOL_10bit +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_10 +#endif +#if HDR_DOL_12bit +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_12 +#endif +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //CUS_BAYER_GR //CFG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_RG//CUS_BAYER_GR +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#ifndef SENSOR_ORIT +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#endif +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +//#define lane_number 2 +//#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +//#define long_packet_type_enable 0x00 //UD1~UD8 (user define) +#define SENSOR_MAX_GAIN (2818 * 1024) // max sensor again, a-gain * conversion-gain*d-gain +#define SENSOR_MIN_GAIN (1 * 1024) + +#define SENSOR_GAIN_DELAY_FRAME_COUNT (1) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT (2) + +#define SENSOR_GAIN_DELAY_FRAME_COUNT_DOL (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT_DOL (2) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_37P125MHZ //CUS_CMU_SCL_CLK_37P125M //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +//#define Preview_line_period 30000 ////HTS/PCLK=4455 pixels/148.5MHZ=30usec @MCLK=36MHz +//#define vts_30fps 1125//1346,1616 //for 29.1fps @ MCLK=36MHz +//For MCLK = 36Mhz +//#define Preview_line_period 30556//30580 //(36M/37.125M)*30fps=29.091fps(34.375msec), hts=34.375/1125=30556, +//For MCLK = 37.125Mhz +#define Preview_line_period 29629 // hts=33.333/1125=25629, +#if HDR_DOL_10bit +//For MCLK = 36Mhz +//#define Preview_line_period_HDR_DOL_4LANE 28176//14842//30535//30580 10^9 / (1158 * 2) / 29.091 //(36M/37.125M)*30.02fps=29.11fps(34.352msec), hts=34.375/1220=28176, +//For MCLK = 37.125Mhz +#define Preview_line_period_HDR_DOL_4LANE 27322 //hts=33.333/1220=27322 +#endif +#if HDR_DOL_12bit +//For MCLK = 36Mhz +//#define Preview_line_period_HDR_DOL_4LANE (29684 / 2) //29684//14842//30535//30580 10^9 / (1158 * 2) / 29.091 //(36M/37.125M)*30.02fps=29.11fps(34.352msec), hts=34.352/1158=30556, +//For MCLK = 37.125Mhz +#define Preview_line_period_HDR_DOL_4LANE (28784 / 2) //33.333/1158=28784, +//For MCLK = 36Mhz +//#define Preview_line_period_HDR_DOL_2LANE (29684/*30501*/ / 2) +//For MCLK = 37.125Mhz +#define Preview_line_period_HDR_DOL_2LANE (28784/*30501*/ / 2) +#endif +//#define Line_per_second 32727 +#define vts_30fps 1125//1090 //for 29.091fps @ MCLK=36MHz +#if HDR_DOL_10bit +#define vts_30fps_HDR_DOL_4lane 1220//1125//1090 //for 29.091fps @ MCLK=36MHz //VMAX +#endif +#if HDR_DOL_12bit +#define vts_30fps_HDR_DOL_4lane 1158//1125//1090 //for 29.091fps @ MCLK=36MHz //VMAX +#define vts_30fps_HDR_DOL_2lane 1158 +#endif +#define MAX_DOL_RHS1 ((1158 * 2) - (1097/*BRL HD1080p*/ * 2) - 21) //must 1158 +#define Prv_Max_line_number 1080 //maximum exposure line munber of sensor when preview +#define Preview_WIDTH 1920 //resolution Width when preview +#define Preview_HEIGHT 1080 //resolution Height when preview +#define Preview_HEIGHT_HDR_DOL 1080 //resolution Height when preview +#define Preview_MAX_FPS 30 //fastest preview FPS +#define Preview_MIN_FPS 3 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x34 //I2C slave address +#define SENSOR_I2C_SPEED 20000//200000 //300000// 240000 //I2C speed, 60000~320000 +#define SENSOR_I2C_CHANNEL 1 //I2C Channel +#define SENSOR_I2C_PAD_MODE 2 //Pad/Mode Number + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG +//static int drv_Fnumber = 22; + +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +//#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME IMX307 + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +//#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +//#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +//#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +//#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +static int cus_camsensor_release_handle(ms_cus_sensor *handle); +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static CUS_MCLK_FREQ UseParaMclk(const char *mclk); +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lines; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + + int sen_init; + int still_min_fps; + int video_min_fps; + u32 max_rhs1; + u32 lef_shs2; + u32 skip_cnt; + bool dirty; + bool change; + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tGain_reg[3]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tShs2_reg[3]; + I2C_ARRAY tRhs1_reg[3]; + I2C_ARRAY tGain_hdr_dol_lef_reg[1]; + I2C_ARRAY tGain_hdr_dol_sef_reg[1]; + bool orien_dirty; +} imx307_params; +// set sensor ID address and data, + +const static I2C_ARRAY Sensor_id_table[] = +{ + {0x3004, 0x10}, // {address of ID, ID }, + {0x3009, 0x01}, // {address of ID, ID }, +}; + +const static I2C_ARRAY Sensor_init_table_4lane[] = +{ + {0x3002, 0x01}, //Master mode stop + {0xffff, 0x14},//delay + {0x3000, 0x01}, // standby + {0xffff, 0x14},//delay + {0x3005, 0x01}, + {0x3007, 0x00},//mirror/flip + {0x3009, 0x02},//FRSEL + // {0x300A, 0xF0}, + // {0x300F, 0x00}, + // {0x3010, 0x21}, + {0x3011, 0x0A}, + {0x3012, 0x64}, + {0x3013, 0x00}, + //{0x3016, 0x08},//yc modify + {0x3018, 0x65},//VMAX + {0x3019, 0x04}, + {0x301a, 0x00}, + {0x301c, 0x30},//0x1167 HMAX,for 25fps + {0x301d, 0x11}, + + {0x3046, 0x01}, + //{0x304B, 0x0a},//arbitary value + {0x305C, 0x18},//INCK + {0x305D, 0x03}, + {0x305E, 0x20}, + {0x305F, 0x01}, + + //{0x3070, 0x02}, + // {0x3071, 0x11}, + // {0x309B, 0x10}, + // {0x309C, 0x22}, + {0x309E, 0x4A}, + {0x309F, 0x4A}, + // {0x30A0, 0x02},//new add + // {0x30A2, 0x02}, + // {0x30A6, 0x20}, + // {0x30A8, 0x20}, + // {0x30AA, 0x20}, + // {0x30AC, 0x20}, + // {0x30B0, 0x43}, + + // {0x3119, 0x9E}, + {0x311C, 0x0E}, + // {0x311E, 0x08}, + {0x3128, 0x04}, + {0x3129, 0x00}, + {0x313B, 0x41}, + // {0x313D, 0x83}, + // {0x3150, 0x02}, + {0x315E, 0x1A},//INCKSEL5 + {0x3164, 0x1A},//INCKSEL6 + {0x317C, 0x00},//ADBIT2 + {0x317E, 0x00}, + {0x31EC, 0x0E}, + + + {0x3405, 0x20}, + {0x3407, 0x03}, // 4 lane for phy + // {0x3414, 0x0A}, + {0x3418, 0x49},//Y-out + {0x3419, 0x04}, + // {0x342C, 0x47}, + // {0x342D, 0x00}, + // {0x3430, 0x0F}, + // {0x3431, 0x00}, + {0x3441, 0x0C}, + {0x3442, 0x0C}, + {0x3443, 0x03}, // 4 lane + {0x3444, 0x20}, + {0x3445, 0x25}, + {0x3446, 0x47}, + {0x3447, 0x00}, + {0x3448, 0x1F}, + {0x3449, 0x00}, + {0x344A, 0x17}, + {0x344B, 0x00}, + {0x344C, 0x0F}, + {0x344D, 0x00}, + {0x344E, 0x17}, + {0x344F, 0x00}, + {0x3450, 0x47}, + {0x3451, 0x00}, + {0x3452, 0x0F}, + {0x3453, 0x00}, + {0x3454, 0x0F}, + {0x3455, 0x00}, + {0x3472, 0x9c},//x-out size + {0x3473, 0x07}, + {0x3480, 0x49},//0x9c + + {0x3000, 0x00}, // operating + //{0xffff, 0x14}, + + {0x3002, 0x00}, //Master mode start +}; + +const static I2C_ARRAY Sensor_init_table_2lane[] = +{ + + {0x3002, 0x00}, //Master mode stop + {0xffff, 0x14},//delay + {0x3000, 0x01}, // standby + {0xffff, 0x14},//delay + {0x3005, 0x01}, + // {0x3007, 0x00},//mirror/flip + {0x3009, 0x02},//FRSEL + // {0x300A, 0xF0}, + // {0x300F, 0x00}, + // {0x3010, 0x21}, + {0x3011, 0x0A}, + // {0x3012, 0x64}, + // {0x3013, 0x00}, + {0x3016, 0x08},//yc modify + {0x3018, 0x65},//VMAX + {0x3019, 0x04}, + {0x301c, 0x30},//0x1167 HMAX,for 25fps + {0x301d, 0x11}, + + //{0x3046, 0x01}, + //{0x304B, 0x0a},//arbitary value + {0x305C, 0x18},//INCK + {0x305D, 0x03}, + {0x305E, 0x20}, + //{0x305F, 0x01}, + + //{0x3070, 0x02}, + // {0x3071, 0x11}, + // {0x309B, 0x10}, + // {0x309C, 0x22}, + {0x309E, 0x4A}, + {0x309F, 0x4A}, + // {0x30A0, 0x02},//new add + // {0x30A2, 0x02}, + // {0x30A6, 0x20}, + // {0x30A8, 0x20}, + // {0x30AA, 0x20}, + // {0x30AC, 0x20}, + // {0x30B0, 0x43}, + + // {0x3119, 0x9E}, + {0x311C, 0x0E}, + // {0x311E, 0x08}, + {0x3128, 0x04}, + {0x3129, 0x00}, + {0x313B, 0x41}, + // {0x313D, 0x83}, + // {0x3150, 0x02}, + {0x315E, 0x1A},//INCKSEL5 + {0x3164, 0x1A},//INCKSEL6 + {0x317C, 0x00},//ADBIT2 + {0x317E, 0x00}, + {0x31EC, 0x0E}, + + + {0x3405, 0x10}, + {0x3407, 0x01}, // 2 lane for phy + // {0x3414, 0x0A}, + {0x3418, 0x49},//Y-out + {0x3419, 0x04}, + // {0x342C, 0x47}, + // {0x342D, 0x00}, + // {0x3430, 0x0F}, + // {0x3431, 0x00}, + // {0x3441, 0x0C}, + // {0x3442, 0x0C}, + {0x3443, 0x01}, // 2 lane + {0x3444, 0x20}, + {0x3445, 0x25}, + {0x3446, 0x57}, + // {0x3447, 0x00}, + {0x3448, 0x37}, + // {0x3449, 0x00}, + {0x344A, 0x1F}, + // {0x344B, 0x00}, + {0x344C, 0x1F}, + // {0x344D, 0x00}, + {0x344E, 0x1f}, + // {0x344F, 0x00}, + {0x3450, 0x77}, + // {0x3451, 0x00}, + {0x3452, 0x1F}, + // {0x3453, 0x00}, + {0x3454, 0x17}, + // {0x3472, 0x9c},//x-out size + // {0x3473, 0x07}, + {0x3480, 0x49},//0x9c + + {0x3000, 0x00}, // operating + {0xffff, 0x14}, + + + // {0x3002, 0x00}, //Master mode start +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane[] = +{ +#if HDR_DOL_10bit + //DOL 2frame 1080p 10bit + {0x3002, 0x01}, + {0xffff, 0x14}, + {0x3000, 0x01}, + {0xffff, 0x14}, + + {0x3005, 0x00}, + //{0x3007, 0x00}, //WINMODE + {0x3007, 0x40}, + + {0x3009, 0x01}, + {0x300A, 0x3C}, + {0x300C, 0x11}, + {0x3011, 0x0A}, + + + //{0x3018, 0x65}, //VMAX + //{0x3019, 0x04}, + {0x3018, 0xC4}, + {0x3019, 0x04}, + + //{0x301c, 0x98}, //HMAX + //{0x301d, 0x08}, + {0x301c, 0xEC}, + {0x301d, 0x07}, + + {0x3020, 0x02}, // SHS1 + {0x3021, 0x00}, // SHS1 + {0x3022, 0x00}, // SHS1 + + {0x3024, 0x53}, // SHS2 + {0x3025, 0x04}, // SHS2 + {0x3026, 0x00}, // SHS2 + + {0x3028, 0x00}, // SHS3 + {0x3029, 0x00}, // SHS3 + {0x302A, 0x00}, // SHS3 + + {0x3030, 0xe1},//RHS1 + {0x3031, 0x00}, + {0x3032, 0x00}, + + {0x3034, 0x00},//RHS2 + {0x3035, 0x00}, + {0x3036, 0x00}, + + {0x303A, 0x08}, // WIN + {0x303C, 0x04}, // WIN + {0x303E, 0x41}, // WIN + {0x303F, 0x04}, // WIN + + {0x3045, 0x05}, + {0x3046, 0x00}, + {0x304B, 0x0A}, + {0x305C, 0x18}, + {0x305D, 0x03}, + {0x305E, 0x20}, + {0x305F, 0x01}, + {0x309E, 0x4A}, + {0x309F, 0x4A}, + + {0x3106, 0x11}, + {0x311C, 0x0E}, + {0x3128, 0x04}, + {0x3129, 0x1D}, + {0x313B, 0x41}, + {0x315E, 0x1A}, + {0x3164, 0x1A}, + {0x317C, 0x12}, + {0x31EC, 0x37}, + + + {0x3405, 0x10}, + {0x3407, 0x03}, + + //{0x3414, 0x0A}, //opb_size_v + {0x3414, 0x00}, + + {0x3415, 0x00}, + + //{0x3418, 0x9C}, //y_out_size + //{0x3419, 0x08}, + {0x3418, 0x7A}, + {0x3419, 0x09}, + + + {0x3441, 0x0A}, + {0x3442, 0x0A}, + {0x3443, 0x03}, + {0x3444, 0x20}, + {0x3445, 0x25}, + {0x3446, 0x57}, + {0x3447, 0x00}, + {0x3448, 0x37}, + {0x3449, 0x00}, + {0x344A, 0x1F}, + {0x344B, 0x00}, + {0x344C, 0x1F}, + {0x344D, 0x00}, + {0x344E, 0x1F}, + {0x344F, 0x00}, + {0x3450, 0x77}, + {0x3451, 0x00}, + {0x3452, 0x1F}, + {0x3453, 0x00}, + {0x3454, 0x17}, + {0x3455, 0x00}, + {0x3472, 0xA0}, + {0x3473, 0x07}, + {0x347B, 0x23}, + {0x3480, 0x49}, + + {0x3000, 0x00}, // operating + //{0xffff, 0x14}, + + {0x3002, 0x00}, //Master mode start +#endif + +#if HDR_DOL_12bit + //DOL 2frame 1080p 12bit + {0x3002, 0x01}, + {0xffff, 0x14}, + {0x3000, 0x01}, + {0xffff, 0x14}, + + {0x3005, 0x01}, + //{0x3007, 0x00}, //WINMODE + {0x3007, 0x40}, + + {0x3009, 0x01}, + {0x300A, 0xF0}, + {0x300C, 0x11}, + {0x3011, 0x0A}, + + + //{0x3018, 0x65}, //VMAX + //{0x3019, 0x04}, + {0x3018, 0x86}, + {0x3019, 0x04}, + + //{0x301c, 0x98}, //HMAX + //{0x301d, 0x08}, + {0x301c, 0x58}, + {0x301d, 0x08}, + + {0x3020, 0x02}, // SHS1 + {0x3021, 0x00}, // SHS1 + {0x3022, 0x00}, // SHS1 + + {0x3024, 0x73}, // SHS2 + {0x3025, 0x04}, // SHS2 + {0x3026, 0x00}, // SHS2 + + {0x3028, 0x00}, // SHS3 + {0x3029, 0x00}, // SHS3 + {0x302A, 0x00}, // SHS3 + + {0x3030, 0x65},//RHS1 + {0x3031, 0x00}, + {0x3032, 0x00}, + + {0x3034, 0x00},//RHS2 + {0x3035, 0x00}, + {0x3036, 0x00}, + + {0x303A, 0x08}, // WIN + {0x303C, 0x04}, // WIN + {0x303E, 0x41}, // WIN + {0x303F, 0x04}, // WIN + + {0x3045, 0x05}, + {0x3046, 0x01}, + {0x304B, 0x0A}, + {0x305C, 0x18}, + {0x305D, 0x03}, + {0x305E, 0x20}, + {0x305F, 0x01}, + {0x309E, 0x4A}, + {0x309F, 0x4A}, + + {0x3106, 0x11}, + {0x311C, 0x0E}, + {0x3128, 0x04}, + {0x3129, 0x00}, + {0x313B, 0x41}, + {0x315E, 0x1A}, + {0x3164, 0x1A}, + {0x317C, 0x00}, + {0x31EC, 0x0E}, + + {0x3204, 0x4A}, + {0x320A, 0x22}, + + {0x3344, 0x38}, + + {0x3405, 0x10}, + {0x3407, 0x03}, + + //{0x3414, 0x0A}, //opb_size_v + {0x3414, 0x00}, + + {0x3415, 0x00}, + + //{0x3418, 0x9C}, //y_out_size + //{0x3419, 0x08}, + {0x3418, 0x7A}, + {0x3419, 0x09}, + + {0x3441, 0x0C}, + {0x3442, 0x0C}, + {0x3443, 0x03}, + {0x3444, 0x20}, + {0x3445, 0x25}, + {0x3446, 0x57}, + {0x3447, 0x00}, + {0x3448, 0x37}, + {0x3449, 0x00}, + {0x344A, 0x1F}, + {0x344B, 0x00}, + {0x344C, 0x1F}, + {0x344D, 0x00}, + {0x344E, 0x1F}, + {0x344F, 0x00}, + {0x3450, 0x77}, + {0x3451, 0x00}, + {0x3452, 0x1F}, + {0x3453, 0x00}, + {0x3454, 0x17}, + {0x3455, 0x00}, + {0x3472, 0xA0}, + {0x3473, 0x07}, + {0x347B, 0x23}, + {0x3480, 0x49}, + + {0x3000, 0x00}, // operating + //{0xffff, 0x14}, + + {0x3002, 0x00}, //Master mode start +#endif +}; + + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_2lane[] = +{ + {0x3002,0x01}, + {0xffff, 0x14}, //test + {0x3000, 0x01}, //test + {0xffff, 0x14}, //test + {0x3005,0x01}, + + {0x3007,0x00}, + + {0x3009,0x01}, + {0x300A,0xF0}, + {0x300C,0x11}, + {0x3011,0x0A}, + + + {0x3018,0x86}, + + {0x3019,0x04}, + {0x301C,0x58}, + {0x301D,0x08}, + {0x3020,0x02}, // SHS1 + {0x3021,0x00}, // SHS1 + + {0x3024,0xC9}, // SHS2 + {0x3025,0x06}, // SHS2 + //{0x3026,0x06}, // SHS2 + {0x3030,0x0B}, + {0x3031,0x00}, + //{0x3032,0x00}, + {0x3045,0x05}, + {0x3046,0x01}, + //{0x3048,0x00}, + //{0x3049,0x00}, + {0x304B,0x0A}, + {0x305C,0x18}, + {0x305D,0x03}, + {0x305E,0x20}, + {0x305F,0x01}, + {0x309E,0x4A}, + {0x309F,0x4A}, + {0x3106,0x11}, + {0x311C,0x0E}, + {0x311D,0x08}, + + + {0x3128,0x04}, + {0x3129,0x00}, + + + {0x313B,0x41}, + {0x315E,0x1A}, + {0x3164,0x1A}, + {0x317C,0x00}, + {0x31EC,0x0E}, + {0x3405,0x00}, + {0x3407,0x01}, + {0x3414,0x0A}, + {0x3415,0x00}, + //{0x3418,0x9C}, + //{0x3419,0x08}, + {0x3418,0x7A}, + {0x3419,0x09}, + {0x3441,0x0C}, + {0x3442,0x0C}, + {0x3443,0x01}, + {0x3444,0x20}, + + {0x3445,0x25}, + + {0x3446,0x77}, + {0x3447,0x00}, + {0x3448,0x67}, + {0x3449,0x00}, + {0x344A,0x47}, + + {0x344B,0x00}, + {0x344C,0x37}, + {0x344D,0x00}, + {0x344E,0x3F}, + {0x344F,0x00}, + {0x3450,0xFF}, + {0x3451,0x00}, + {0x3452,0x3F}, + {0x3453,0x00}, + {0x3454,0x37}, + {0x3455,0x00}, + + + + + + {0x3472,0xA0}, + {0x3473,0x07}, + {0x347B,0x23}, + + {0x3480,0x49}, + + {0x3000, 0x00}, //test + + {0x3002,0x00}, + +}; + +const static I2C_ARRAY TriggerStartTbl[] = { + {0x3002,0x00},//Master mode start +}; + +static I2C_ARRAY PatternTbl[] = { + {0x308c,0x20}, //colorbar pattern , bit 0 to enable +}; + +const static I2C_ARRAY gain_HDR_DOL_LEF_reg[] = +{ + {0x3014, 0x00}, +}; + +const static I2C_ARRAY gain_HDR_DOL_SEF1_reg[] = +{ + {0x30F2, 0x00}, +}; + +const static I2C_ARRAY expo_SHS2_reg[] = +{ +#if 1 //decreasing exposure ratio version. + {0x3026, 0x00}, + {0x3025, 0x08}, + {0x3024, 0x49}, +#else + {0x3026, 0x00}, + {0x3025, 0x07}, + {0x3024, 0xc9}, +#endif +}; + +const I2C_ARRAY expo_RHS1_reg[] = +{ +#if 1 //decreasing exposure ratio version. + {0x3032, 0x00}, + {0x3031, 0x00}, + {0x3030, 0x65}, /*101*/ +#else + {0x3032, 0x00}, + {0x3031, 0x00}, + {0x3030, 0x0b}, +#endif +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + + +const static I2C_ARRAY mirr_flip_table[] = +{ + {0x3007, 0x00},//M0F0 + {0x3007, 0x02},//M1F0 + {0x3007, 0x01},//M0F1 + {0x3007, 0x03},//M1F1 + +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + + + +const static I2C_ARRAY gain_reg[] = { + //{0x350A, 0x00},//bit0, high bit + {0x3014, 0x00},//low bit + {0x3009, 0x02},//hcg mode,bit 4 + {0x3016, 0x08},// + +}; +#if 0 +static I2C_ARRAY frame_drop_reg[] = { + //{0x350A, 0x00},//bit0, high bit + {0x4202, 0x01}, //frame mask + {0x3000, 0x23}, //timing reset + {0x3000, 0xa0}, //low bit + +}; +#endif +//static int g_sensor_ae_min_gain = 1024; +static CUS_GAIN_GAP_ARRAY gain_gap_compensate[16] = { //compensate gain gap + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +const static I2C_ARRAY expo_reg[] = { + + {0x3022, 0x00}, + {0x3021, 0x00}, + {0x3020, 0x00}, +}; + +const static I2C_ARRAY vts_reg[] = { + {0x301a, 0x00}, + {0x3019, 0x04}, + {0x3018, 0xC4}, + +}; + +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { +#if 0 + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); +#endif + return SUCCESS; +} +#endif + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //Sensor power on sequence + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, !handle->reset_POLARITY); + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->Reset(idx, handle->reset_POLARITY ); + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_UDELAY(20); //TLOW + + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + SENSOR_UDELAY(20); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_UDELAY(20); + + sensor_if->Reset(idx, !handle->reset_POLARITY ); + SENSOR_UDELAY(20); //TXCE + + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + handle->orient = SENSOR_ORIT; +#if 0 +#if (SENSOR_MIPI_LANE_NUM == 2) + sensor_if->SetCSI_Lane(SENSOR_PAD_GROUP_SET, 2, 0); +#endif +#if (SENSOR_MIPI_LANE_NUM == 4) + sensor_if->SetCSI_Lane(SENSOR_PAD_GROUP_SET, 4, 0); +#endif +#endif + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +static int pCus_CheckSonyProductID(ms_cus_sensor *handle) +{ + u16 sen_data; + + /* Read Product ID */ + if (SensorReg_Read(0x31DC, (void*)&sen_data)) { + return FAIL; + } + + if ((sen_data & 0x0006) != 0x4) { + SENSOR_EMSG("[***ERROR***]Check Product ID Fail: 0x%x\n", sen_data); + return FAIL; + } + + return SUCCESS; +} +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if(/* SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == */SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_MSLEEP(1); + } + + //convert sensor id to u32 format + for(i=0;iprivate_data; + int i,cnt=0; + + if (pCus_CheckSonyProductID(handle)) { + return FAIL; + } + + //UartSendTrace("IMX307 Sensor_init_table_4lane\n"); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane);i++) + { + if(Sensor_init_table_4lane[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane[i].reg,Sensor_init_table_4lane[i].data) != SUCCESS) + { + cnt++; + //printf("Sensor_init_table_4lane -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + //SensorReg_Read( Sensor_init_table_4lane[i].reg, &sen_data ); + //UartSendTrace("IMX307 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane[i].reg, Sensor_init_table_4lane[i].data, sen_data); + } + } + + params->tVts_reg[0].data = (params->expo.vts >> 16) & 0x0003; + params->tVts_reg[1].data = (params->expo.vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (params->expo.vts >> 0) & 0x00ff; + pCus_SetOrien(handle, handle->orient); + return SUCCESS; +} +#endif +#if (SENSOR_MIPI_LANE_NUM_DOL == 4) +static int pCus_init_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + imx307_params *params = (imx307_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt=0; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + // short sen_data; + //sensor_if->PCLK( CUS_SNR_PCLK_MIPI_TOP );//sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + if (pCus_CheckSonyProductID(handle)) { + return FAIL; + } + + //UartSendTrace("IMX307 Sensor_init_table_HDR_DOL_4lane\n"); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane);i++) + { + if(Sensor_init_table_HDR_DOL_4lane[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane[i].reg,Sensor_init_table_HDR_DOL_4lane[i].data) != SUCCESS) + { + cnt++; + //UartSendTrace("Sensor_init_table_HDR_DOL_4lane -> Retry %d...\n",cnt); + if(cnt>=10) + { + //UartSendTrace("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane[i].reg, &sen_data ); + //UartSendTrace("IMX307 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane[i].reg, Sensor_init_table_HDR_DOL_4lane[i].data, sen_data); + } + } + + params->tVts_reg[0].data = (params->expo.vts >> 16) & 0x0003; + params->tVts_reg[1].data = (params->expo.vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (params->expo.vts >> 0) & 0x00ff; + + //UartSendTrace("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} +#endif + +#if 1//(SENSOR_MIPI_LANE_NUM_DOL == 2) +static int pCus_init_mipi2lane_HDR_DOL(ms_cus_sensor *handle) +{ + imx307_params *params = (imx307_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt=0; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + // short sen_data; + //sensor_if->PCLK( CUS_SNR_PCLK_MIPI_TOP );//sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + if (pCus_CheckSonyProductID(handle)) { + return FAIL; + } + + //UartSendTrace("IMX307 Sensor_init_table_HDR_DOL_2lane\n"); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_2lane);i++) + { + if(Sensor_init_table_HDR_DOL_2lane[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_2lane[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_2lane[i].reg,Sensor_init_table_HDR_DOL_2lane[i].data) != SUCCESS) + { + cnt++; + //UartSendTrace("Sensor_init_table_HDR_DOL_2lane -> Retry %d...\n",cnt); + if(cnt>=10) + { + //UartSendTrace("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_2lane[i].reg, &sen_data ); + //UartSendTrace("IMX307 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_2lane[i].reg, Sensor_init_table_HDR_DOL_2lane[i].data, sen_data); + } + } + + params->tVts_reg[0].data = (params->expo.vts >> 16) & 0x0003; + params->tVts_reg[1].data = (params->expo.vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (params->expo.vts >> 0) & 0x00ff; + + //UartSendTrace("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} +#endif + +#if 1//(SENSOR_MIPI_LANE_NUM == 2) +static int pCus_init_mipi2lane_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //short sen_data; + //sensor_if->PCLK( CUS_SNR_PCLK_MIPI_TOP );//sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + if (pCus_CheckSonyProductID(handle)) { + return FAIL; + } + + //UartSendTrace("IMX307 Sensor_init_table_2lane\n"); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_2lane);i++) + { + if(Sensor_init_table_2lane[i].reg==0xffff) + { + SENSOR_MSLEEP_(Sensor_init_table_2lane[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_2lane[i].reg,Sensor_init_table_2lane[i].data) != SUCCESS) + { + cnt++; + //printf("Sensor_init_table_2lane -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + //SensorReg_Read( Sensor_init_table_2lane[i].reg, &sen_data ); + //UartSendTrace("IMX307 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_2lane[i].reg, Sensor_init_table_2lane[i].data, sen_data); + } + } + + for(i=0;i< ARRAY_SIZE(PatternTbl);i++) + { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + { + //MSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + } + + for(i=0;i< ARRAY_SIZE(TriggerStartTbl);i++) + { + if(SensorReg_Write(TriggerStartTbl[i].reg,TriggerStartTbl[i].data) != SUCCESS) + { + //MSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + } + + pCus_SetOrien(handle, handle->orient); + + //pCus_SetAEGain(handle,2048); + //pCus_SetAEUSecs(handle, 25000); + //pCus_SetFPS(handle, 25000); + //MSG("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} +#endif +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + + if(lane_num == 2) + handle->pCus_sensor_init = pCus_init_mipi2lane_linear; + else if (lane_num == 4) + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + else + handle->pCus_sensor_init = pCus_init_mipi2lane_linear; + + params->expo.vts=vts_30fps; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL(ms_cus_sensor *handle, u32 res_idx) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + if(hdr_lane_num == 2) { + handle->pCus_sensor_init = pCus_init_mipi2lane_HDR_DOL; + params->expo.vts = vts_30fps_HDR_DOL_2lane; + } else if(hdr_lane_num == 4) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + } + + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ +#if 0 + imx307_params *params = (imx307_params *)handle->private_data; + short sen_data; + + SensorReg_Read(0x3007, &sen_data);//always success now + + //LOGD("mirror:%x\r\n", sen_data & 0x03); + switch(sen_data & 0x03) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x02: + *orit = CUS_ORIT_M1F0; + break; + case 0x01: + *orit = CUS_ORIT_M0F1; + break; + case 0x03: + *orit = CUS_ORIT_M1F1; + break; + } +#endif + *orit = handle->orient; + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx307_params *params = (imx307_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int DoOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + int table_length = ARRAY_SIZE(mirr_flip_table); + int seg_length=table_length/4; + int i,j; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + switch(orit) + { + case CUS_ORIT_M0F0: + for(i=0,j=0;iorient = CUS_ORIT_M0F0; + } + break; + + case CUS_ORIT_M1F0: + for(i=seg_length,j=0;iorient = CUS_ORIT_M1F0; + } + break; + + case CUS_ORIT_M0F1: + for(i=seg_length*2,j=0;iorient = CUS_ORIT_M0F1; + } + break; + + case CUS_ORIT_M1F1: + for(i=seg_length*3,j=0;iorient = CUS_ORIT_M1F1; + } + break; + + default : + for(i=0,j=0;iorient = CUS_ORIT_M0F0; + } + break; + } + + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 3000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0; + imx307_params *params = (imx307_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + if(fps>=3 && fps <= 30){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29?29:fps;//limit fps at 29 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (vts_30fps*29091 + fps * 500)/(fps * 1000); + else + params->expo.vts= (vts_30fps*30000 + fps * 500)/(fps * 1000); + params->dirty = true; + }else if(fps>=3000 && fps <= 30000){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29091?29091:fps;//limit fps at 29.091 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (vts_30fps*29091 + (fps>>1))/fps; + else + params->expo.vts= (vts_30fps*30000 + (fps>>1))/fps; + params->dirty = true; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + if(params->expo.expo_lines > params->expo.vts -2){ + vts = params->expo.expo_lines + 8; + }else{ + vts = params->expo.vts; + } + + params->expo.vts = vts; + + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + } + + if (params->expo.fps >= 3000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0, cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + imx307_params *params = (imx307_params *)handle->private_data; + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps =vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + } + + params->expo.fps = fps; + + if(fps>=3 && fps <= 30){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29?29:fps;//limit fps at 29 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (cur_vts_30fps*29091 + fps * 500 )/ (fps * 1000); + else + params->expo.vts= (cur_vts_30fps*30000 + fps * 500 )/ (fps * 1000); + params->dirty = true; + }else if(fps>=3000 && fps <= 30000){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29091?29091:fps;//limit fps at 29.091 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (cur_vts_30fps*29091 + (fps >> 1))/fps; + else + params->expo.vts= (cur_vts_30fps*30000 + (fps >> 1))/fps; + params->dirty = true; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 -3){ + vts = (params->expo.expo_lines + params->max_rhs1 + 3 + 1) / 2; + }else{ + vts = params->expo.vts; + } + + params->expo.vts = vts; + pCus_SetAEUSecsHDR_DOL_SEF1(handle, params->expo.expo_sef_us); + params->skip_cnt = 1; + return SUCCESS; +} +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) +{ + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx307_params *params = (imx307_params *)handle->private_data; + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + + if(params->dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + + if(params->orien_dirty) + { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + + SensorReg_Write(0x3001,0); // printf("0x3009=0x%x,0x3014=0x%x,0x3016=0x%x,0x3020=0x%x,0x3021=0x%x\n", params->tGain_reg[1].data,params->tGain_reg[0].data,params->tGain_reg[2].data,params->tExpo_reg[2].data,params->tExpo_reg[1].data); + } + + if(params->skip_cnt){ + sensor_if->SetSkipFrame(handle->snr_pad_group, params->expo.fps, params->skip_cnt); + params->skip_cnt = 0; + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF1(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //imx307_params *params = (imx307_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + //int rc; + u32 lines = 0; + imx307_params *params = (imx307_params *)handle->private_data; + //int rc = SensorRegArrayR((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + + lines |= (u32)(params->tExpo_reg[0].data&0xff)<<16; + lines |= (u32)(params->tExpo_reg[1].data&0xff)<<8; + lines |= (u32)(params->tExpo_reg[2].data&0xff)<<0; + // lines >>= 4; + // *us = (lines+dummy) * params->expo.us_per_line; + //*us = lines;//(lines*Preview_line_period); + *us = (lines*Preview_line_period)/1000; + SENSOR_DMSG("[%s] sensor expo lines/us %u,%u us\n", __FUNCTION__, lines, *us); + //return rc; + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0; + imx307_params *params = (imx307_params *)handle->private_data; + + params->expo.expo_lef_us = us; + lines = (1000*us)/Preview_line_period; + + if (lines <1 ) lines = 1; + + params->expo.expo_lines = lines; + + if (lines >params->expo.vts-2) { + vts = lines +2; + } + else + vts=params->expo.vts; + + SENSOR_DMSG("[%s] us %u, lines %u, vts %u\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + lines=vts-lines-1; + params->tExpo_reg[0].data = (lines>>16) & 0x0003; + params->tExpo_reg[1].data = (lines>>8) & 0x00ff; + params->tExpo_reg[2].data = (lines>>0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, cur_line_period = Preview_line_period_HDR_DOL_4LANE, cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 rhs1 = 0, shs1 = 0, vts = 0; + imx307_params *params = (imx307_params *)handle->private_data; + + params->expo.expo_sef_us = us; + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_line_period = Preview_line_period_HDR_DOL_2LANE; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + } + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps =vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + } + + lines = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + + //check fps to set rhs1 + + if(params->expo.fps > 3000){ //3fps*1000 + if(params->expo.fps > 25000){ + if(lines > 98) { + params->max_rhs1 = 211; + params->expo.vts = cur_vts_30fps * 30000 / 25000; + } + else{ + params->expo.vts = cur_vts_30fps * 30000 / params->expo.fps; + params->max_rhs1 = 101; + } + } + else + params->max_rhs1 = 211; + } + else { + if(params->expo.fps > 25){ + if(lines > 98) { + params->max_rhs1 = 211; + params->expo.vts = cur_vts_30fps * 30 / 25; + } + else{ + params->expo.vts = cur_vts_30fps * 30 / params->expo.fps; + params->max_rhs1 = 101; + } + } + else + params->max_rhs1 = 211; + } + + if (params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 - 3) { + vts = (params->expo.expo_lines + params->max_rhs1 + 3 + 1) / 2; + } + else{ + vts = params->expo.vts; + } + + rhs1 = params->max_rhs1; + //Check boundary + if(lines < 1) + lines = 1; + if(lines > rhs1- 3) + lines = rhs1 - 3; + + if((rhs1 - 1 - 2) <= lines){ + shs1 = 2; + } + else if((rhs1 <= params->max_rhs1) && (rhs1 <= params->lef_shs2 - 2)){ + shs1 = rhs1 - 1 - lines; + if((shs1 < 2) || (shs1 > (rhs1 - 2))){ //Check boundary + //shs1 = 0; + //UartSendTrace("[SEF1 NG1]"); + } + } + else{ + //UartSendTrace("[SEF1 NG2]"); + } + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->tExpo_reg[0].data = (shs1 >> 16) & 0x0003; + params->tExpo_reg[1].data = (shs1 >> 8) & 0x00ff; + params->tExpo_reg[2].data = (shs1 >> 0) & 0x00ff; + + params->tRhs1_reg[0].data = (params->max_rhs1 >> 16) & 0x0003; + params->tRhs1_reg[1].data = (params->max_rhs1 >> 8) & 0x00ff; + params->tRhs1_reg[2].data = (params->max_rhs1 >> 0) & 0x00ff; + + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + //int rc = SensorRegArrayR((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + unsigned short temp_gain; + // *gain=params->expo.final_gain; + temp_gain=gain_reg[0].data; + + *gain=(u32)(10^((temp_gain*3)/200))*1024; + if (gain_reg[1].data & 0x10) + *gain = (*gain) * 2; + + SENSOR_DMSG("[%s] get gain/reg (1024=1X)= %u/0x%x\n", __FUNCTION__, *gain,gain_reg[0].data); + //return rc; + return SUCCESS; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) +{ + imx307_params *params = (imx307_params *)handle->private_data; + //double gain_double; + u64 gain_double; + params->expo.final_gain = gain; + + if(gain<1024) + gain=1024; + else if(gain>=3980*1024) + gain=3980*1024; + + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3); + + //gain_double = 20*log10((double)gain/1024); + //params->tGain_reg[0].data=(u16)((gain_double*10)/3); + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + + //return CusHW_i2c_array_tx(handle, handle->i2c_cfg, params->tGain_reg, sizeof(gain_reg)/sizeof(CUS_I2C_ARRAY)); + //return SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, sizeof(gain_reg)/sizeof(I2C_ARRAY)); + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + //extern DBG_ITEM Dbg_Items[DBG_TAG_MAX]; + imx307_params *params = (imx307_params *)handle->private_data; + u32 i;//, gain_before=0; + CUS_GAIN_GAP_ARRAY* Sensor_Gain_Linearity; + //double gain_double; + u64 gain_double; + + //return SUCCESS; //TBD + + // u32 times = log2((double)gain/1024.0f)/log(2); + params->expo.final_gain = gain; + if(gain < SENSOR_MIN_GAIN) + gain = SENSOR_MIN_GAIN; + else if(gain >= SENSOR_MAX_GAIN) + gain = SENSOR_MAX_GAIN; + Sensor_Gain_Linearity = gain_gap_compensate; + + for(i = 0; i < sizeof(gain_gap_compensate)/sizeof(CUS_GAIN_GAP_ARRAY); i++){ + //LOGD("GAP:%x %x\r\n",Sensor_Gain_Linearity[i].gain, Sensor_Gain_Linearity[i].offset); + + if (Sensor_Gain_Linearity[i].gain == 0) + break; + if((gain>Sensor_Gain_Linearity[i].gain) && (gain < (Sensor_Gain_Linearity[i].gain + Sensor_Gain_Linearity[i].offset))){ + gain=Sensor_Gain_Linearity[i].gain; + break; + } + } + + if(gain>=22925)//if gain exceed 2x , enable high conversion gain, >27DB, enable HCG + { + + if(params->tGain_reg[1].data==0x02){ + // params->change = true; + // gain_reg[2].data=0x08; + } + else{ + // params->change = false; + // gain_reg[2].data=0x09; + } + //gain_before=gain; + params->tGain_reg[1].data |= 0x10; + // gain_reg[2].data=0x08; + gain /= 2; + + } + else{ + + if(params->tGain_reg[1].data==0x12){ + // params->change = true; + // gain_reg[2].data=0x08; + } + else{ + // params->change = false; + // gain_reg[2].data=0x09; + } + // printf("[%s] params->change=%d\n", __FUNCTION__, params->change); + + // gain_before=gain; + params->tGain_reg[1].data &= ~0x10; + //gain_reg[2].data=0x09; + + } + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3); + //gain_double = 20*log10((double)gain/1024); + //params->tGain_reg[0].data=(u16)((gain_double*10)/3); + + //SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + + //LOGD("s:%x %x\r\n", params->tGain_reg[0].data, params->tGain_reg[1].data); + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + params->dirty = true; + return SUCCESS; + //return CusHW_i2c_array_tx(handle, handle->i2c_cfg, params->tGain_reg, sizeof(gain_reg)/sizeof(CUS_I2C_ARRAY)); + // return SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, sizeof(gain_reg)/sizeof(I2C_ARRAY)); +} + +static void pCus_SetAEGainHDR_DOL_Calculate(u32 gain, u16 *gain_reg) +{ + //double gain_double; + u64 gain_double; + + if(gain < SENSOR_MIN_GAIN){ + gain = SENSOR_MIN_GAIN; + } + else if(gain >= SENSOR_MAX_GAIN){ + gain = SENSOR_MAX_GAIN; + } + gain_double = 20*(intlog10(gain)-intlog10(1024)); + *gain_reg=(u16)(((gain_double*10)>> 24)/3); + //gain_double = 20*log10((double)gain/1024); //gain to db + //*gain_reg = (u16)((gain_double*10)/3); //db to sensor reg +} + +static int pCus_SetAEGainHDR_DOL_SEF1(ms_cus_sensor *handle, u32 gain) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u16 gain_reg = 0; + + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_sef_reg[0].data = gain_reg; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_sef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = SENSOR_MIN_GAIN;//handle->sat_mingain; + *max = SENSOR_MAX_GAIN;//3980*1024; + return SUCCESS; +} +#if 0 +static int pCus_GetDGainRemainder(ms_cus_sensor *handle, u32 *dgain_remainder) +{ + *dgain_remainder = handle->dgain_remainder; + + return SUCCESS; +} +#endif +static int IMX307_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = (Preview_line_period * 1); + info->step = Preview_line_period; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + u32 i, j; + + for(i=0,j=0;i< num ;i++,j+=2){ + gain_gap_compensate[i].gain=pArray[i].gain; + gain_gap_compensate[i].offset=pArray[i].offset; + } + + //LOGD("[%s]%d, %d, %d, %d\n", __FUNCTION__, num, pArray[0].gain, pArray[1].gain, pArray[num-1].offset); + + return SUCCESS; +} + +int cus_camsensor_init_handle(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx307_params *params; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx307_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tRhs1_reg, expo_RHS1_reg, sizeof(expo_RHS1_reg)); + memcpy(params->tShs2_reg, expo_SHS2_reg, sizeof(expo_SHS2_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX307_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth = 0x79C; + handle->video_res_supported.res[0].nOutputHeight = 0x449; + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps"); + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + ///calibration + handle->sat_mingain = SENSOR_MIN_GAIN;//g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + + if(lane_num == 2) + handle->pCus_sensor_init = pCus_init_mipi2lane_linear ; + else if(lane_num == 4) + handle->pCus_sensor_init = pCus_init_mipi4lane_linear ; + else + handle->pCus_sensor_init = pCus_init_mipi2lane_linear ; + + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = imx307_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = IMX307_GetShutterInfo; + + params->expo.vts=vts_30fps; + params->expo.expo_lines = 673; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.fps = 29; + else + params->expo.fps = 30; + params->dirty = false; + + return SUCCESS; +} + +static int IMX307_GetShutterInfo_hdr_dol_sef1(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = Preview_line_period_HDR_DOL_4LANE * 211; + info->min = (Preview_line_period_HDR_DOL_4LANE * 2); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef1(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx307_params *params = NULL; + + cus_camsensor_init_handle(drv_handle); + params = (imx307_params *)handle->private_data; + + sprintf(handle->model_id,"IMX307_MIPI_HDR_SEF"); + + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->data_prec = SENSOR_DATAPREC_DOL; + handle->interface_attr.attr_mipi.mipi_lane_num = hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT_HDR_DOL; //TBD. Workaround for Sony DOL HDR mode + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth = 0x79C; + handle->video_res_supported.res[0].nOutputHeight = 0x449; + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps_HDR"); + + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + + if(hdr_lane_num == 4) + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + else if(hdr_lane_num == 2) + handle->pCus_sensor_init = pCus_init_mipi2lane_HDR_DOL; + else + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF1; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF1; + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF1; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF1; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF1; + handle->pCus_sensor_GetShutterInfo = IMX307_GetShutterInfo_hdr_dol_sef1; + + if(hdr_lane_num == 4) + params->expo.vts = vts_30fps_HDR_DOL_4lane; + else if(hdr_lane_num == 2) + params->expo.vts = vts_30fps_HDR_DOL_2lane; + else + params->expo.vts = vts_30fps_HDR_DOL_4lane; + + + params->expo.expo_lines = 673; + + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_DOL; + + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + + return SUCCESS; +} +#if 1//(SENSOR_MIPI_LANE_NUM == 4) +static int pCus_init_mipi4lane_linear_isp_calibration(ms_cus_sensor *handle) +{ + return SUCCESS; +} +#endif +#if 1//(SENSOR_MIPI_LANE_NUM == 2) +static int pCus_init_mipi2lane_linear_isp_calibration(ms_cus_sensor *handle) +{ + return SUCCESS; +} +#endif +static int pCus_poweron_isp_calibration( ms_cus_sensor *handle, u32 idx) +{ + //ISensorIfAPI *sensor_if = &handle->sensor_if_api; + //SENSOR_DMSG( "[%s] ", __FUNCTION__ ); + + return SUCCESS; +} + +static int pCus_poweroff_isp_calibration( ms_cus_sensor *handle, u32 idx) +{ + //ISensorIfAPI *sensor_if = &handle->sensor_if_api; + //SENSOR_DMSG( "[%s] power low\n", __FUNCTION__ ); + + return SUCCESS; +} + +static int pCus_GetSensorID_isp_calibration( ms_cus_sensor *handle, u32 *id ) +{ + *id = 0; + return SUCCESS; +} + +static int imx307_SetPatternMode_isp_calibration( ms_cus_sensor *handle, u32 mode ) +{ + return SUCCESS; +} +#if 0 +static int pCus_I2CWrite_isp_calibration(ms_cus_sensor *handle, unsigned short usreg, unsigned short usval) +{ + return SUCCESS; +} + +static int pCus_I2CRead_isp_calibration(ms_cus_sensor *handle, unsigned short usreg) +{ + return SUCCESS; +} + +static int pCus_init_isp_calibration( ms_cus_sensor *handle ) +{ + return SUCCESS; +} +#endif +static int pCus_GetVideoRes_isp_calibration( ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res ) +{ + *res = &handle->video_res_supported.res[res_idx]; + return SUCCESS; +} + +static int pCus_SetVideoRes_isp_calibration( ms_cus_sensor *handle, u32 res ) +{ + handle->video_res_supported.ulcur_res = 0; //TBD + return SUCCESS; +} + +static int pCus_GetOrien_isp_calibration( ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit ) +{ + //imx307_params *params = ( imx307_params * ) handle->private_data; + //return params->mirror_flip.cur; + return SUCCESS; +} + +static int pCus_SetOrien_isp_calibration( ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit ) +{ + return SUCCESS; +} + +static int pCus_GetFPS_isp_calibration( ms_cus_sensor *handle ) +{ + return SUCCESS; +} + +static int pCus_SetFPS_isp_calibration( ms_cus_sensor *handle, u32 fps ) +{ + return SUCCESS; +} +#if 0 +static int pCus_GetSensorCap_isp_calibration( ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap ) +{ + if( cap ) + memcpy( cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP) ); + else + return FAIL; + return SUCCESS; +} +#endif +static int pCus_AEStatusNotify_isp_calibration( ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status ) +{ + return SUCCESS; +} + +static int pCus_GetAEUSecs_isp_calibration( ms_cus_sensor *handle, u32 *us ) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecs_isp_calibration( ms_cus_sensor *handle, u32 us ) +{ + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain_isp_calibration( ms_cus_sensor *handle, u32* gain ) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGain_cal_isp_calibration( ms_cus_sensor *handle, u32 gain ) +{ + return SUCCESS; +} +static int pCus_SetAEGain_isp_calibration( ms_cus_sensor *handle, u32 gain ) +{ + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_isp_calibration( ms_cus_sensor *handle, u32 *min, u32 *max ) +{ + *min = 1; + *max = 1000000 / 30; + + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_isp_calibration( ms_cus_sensor *handle, u32 *min, u32 *max ) +{ + *min = 1024; //1024*1.1*2 + *max = 1024*8; + + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_isp_calibration( ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num ) +{ + return SUCCESS; +} + +static int IMX307_GetShutterInfo_isp_calibration( struct __ms_cus_sensor* handle, CUS_SHUTTER_INFO *info ) +{ + info->max = 1000000000 / 12; + info->min = Preview_line_period; + info->step = Preview_line_period; + return SUCCESS; +} +#if 0 +static int pCus_GetDGainRemainder_isp_calibration(ms_cus_sensor *handle, u32 *dgain_remainder) +{ + return SUCCESS; +} +#endif +int cus_camsensor_init_handle_linear_isp_calibration(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx307_params *params; +#if defined(__RTK_OS__) + //CamOsRet_e eCamOsRet = CAM_OS_OK; + void* pvBufVirt = NULL; + //u64 u64BufPhy = 0; + //u64 u64BufMiu = 0; + char str[20]; +#endif + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init +#if defined(__RTK_OS__) + sprintf(str, "IMX307linear"); + //eCamOsRet = CamOsDirectMemAlloc(str, sizeof(imx307_params), &pvBufVirt, &u64BufMiu, &u64BufPhy); + pvBufVirt = CamOsMemAlloc(sizeof(imx307_params)); + if (pvBufVirt == NULL) { + //UartSendTrace("[%s:%d] fail!\n", __FUNCTION__, __LINE__); + return FAIL; + } + handle->private_data = (imx307_params *)pvBufVirt; + memset(handle->private_data, 0, sizeof(imx307_params)); +#else + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } +#endif + params = (imx307_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tRhs1_reg, expo_RHS1_reg, sizeof(expo_RHS1_reg)); + memcpy(params->tShs2_reg, expo_SHS2_reg, sizeof(expo_SHS2_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX307_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps"); + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth = 0x79C; + handle->video_res_supported.res[0].nOutputHeight = 0x449; + + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + ///calibration + handle->sat_mingain = SENSOR_MIN_GAIN;//g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + + if(lane_num == 2) + handle->pCus_sensor_init = pCus_init_mipi2lane_linear_isp_calibration ; + else if(lane_num == 4) + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_isp_calibration ; + else + handle->pCus_sensor_init = pCus_init_mipi2lane_linear_isp_calibration ; + + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_isp_calibration ; + handle->pCus_sensor_poweroff = pCus_poweroff_isp_calibration; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_isp_calibration ; + //handle->pCus_sensor_GetStillResCap = pCus_GetStillResCap; + //handle->pCus_sensor_GetStillRes = pCus_GetStillRes ; + //handle->pCus_sensor_SetStillRes = pCus_SetStillRes ; + //handle->pCus_sensor_GetVideoResCap = pCus_GetVideoResCap; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes_isp_calibration ; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_isp_calibration ; + handle->pCus_sensor_GetOrien = pCus_GetOrien_isp_calibration ; + handle->pCus_sensor_SetOrien = pCus_SetOrien_isp_calibration ; + handle->pCus_sensor_GetFPS = pCus_GetFPS_isp_calibration ; + handle->pCus_sensor_SetFPS = pCus_SetFPS_isp_calibration ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_isp_calibration; + handle->pCus_sensor_SetPatternMode = imx307_SetPatternMode_isp_calibration; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify_isp_calibration; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_isp_calibration; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs_isp_calibration; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_isp_calibration; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain_isp_calibration; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_isp_calibration; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_isp_calibration; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder_isp_calibration; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_isp_calibration; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity_isp_calibration; + handle->pCus_sensor_GetShutterInfo = IMX307_GetShutterInfo_isp_calibration; +#if 0//defined(__MV5_FPGA__) + handle->pCus_sensor_I2CWrite = pCus_I2CWrite_isp_calibration; //Andy Liu + handle->pCus_sensor_I2CRead = pCus_I2CRead_isp_calibration; //Andy Liu +#endif + params->expo.vts=vts_30fps; + params->expo.expo_lines = 673; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.fps = 29; + else + params->expo.fps = 30; + params->dirty = false; + + return SUCCESS; +} +//lef functions +static int pCus_init_hdr_dol_lef(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static int pCus_poweron_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ +#if 0 + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG( "[%s] ", __FUNCTION__ ); + + sensor_if->PowerOff(CUS_SENSOR_PAD_GROUP_B/*TBD?*/, !handle->pwdn_POLARITY ); + MsSleep(RTK_MS_TO_TICK(10));//usleep( 500 ); + + //sensor_if->Reset(CUS_SENSOR_PAD_GROUP_B, !handle->reset_POLARITY ); + //MsSleep(RTK_MS_TO_TICK(5));//usleep( 500 ); + + // pure power on + sensor_if->PowerOff(CUS_SENSOR_PAD_GROUP_B/*TBD?*/, !handle->pwdn_POLARITY ); +#endif + return SUCCESS; +} + +static int pCus_poweroff_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ +#if 0 + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG( "[%s] power low\n", __FUNCTION__ ); + + sensor_if->PowerOff(CUS_SENSOR_PAD_GROUP_B/*TBD?*/, handle->pwdn_POLARITY ); + MsSleep(RTK_MS_TO_TICK(5));//usleep( 1000 ); +#endif + return SUCCESS; +} + +static int pCus_GetSensorID_hdr_dol_lef(ms_cus_sensor *handle, u32 *id) +{ + *id = 0; + return SUCCESS; +} +#if 0 +static int pCus_GetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + *orit = CUS_ORIT_M0F0; + return SUCCESS; +} + +static int pCus_SetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + return SUCCESS; +} +#endif + +static int pCus_GetFPS_hdr_dol_lef(ms_cus_sensor *handle) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + } + + if (params->expo.fps >= 3000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_hdr_dol_lef(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0, cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + imx307_params *params = (imx307_params *)handle->private_data; + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + } + + if(fps>=3 && fps <= 30){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29?29:fps;//limit fps at 29 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (cur_vts_30fps*29091 + fps * 500 )/ (fps * 1000); + else + params->expo.vts= (cur_vts_30fps*30000 + fps * 500 )/ (fps * 1000); + params->dirty = true; + }else if(fps>=3000 && fps <= 30000){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) + fps = fps>29091?29091:fps;//limit fps at 29.091 fps due to MCLK=36MHz + params->expo.fps = fps; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.vts= (cur_vts_30fps*29091 + (fps >> 1))/fps; + else + params->expo.vts= (cur_vts_30fps*30000 + (fps >> 1))/fps; + params->dirty = true; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 -3){ + vts = (params->expo.expo_lines + params->max_rhs1 + 3 + 1) / 2; + }else{ + vts = params->expo.vts; + } + + params->expo.vts = vts; + params->skip_cnt = 1; + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_lef_us); + + return SUCCESS; +} +#if 0 +static int pCus_GetSensorCap_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) +{ + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif +static int imx307_SetPatternMode_hdr_dol_lef(ms_cus_sensor *handle,u32 mode) +{ + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx307_params *params = (imx307_params *)handle->private_data; + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) + { + SensorReg_Write(0x3001,1); + SensorRegArrayW((I2C_ARRAY*)params->tShs2_reg, ARRAY_SIZE(expo_SHS2_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tRhs1_reg, ARRAY_SIZE(expo_RHS1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_lef_reg, ARRAY_SIZE(gain_HDR_DOL_LEF_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_sef_reg, ARRAY_SIZE(gain_HDR_DOL_SEF1_reg)); + params->dirty = false; + + if(params->orien_dirty) + { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } + + if(params->skip_cnt){ + sensor_if->SetSkipFrame(handle->snr_pad_group, params->expo.fps, params->skip_cnt); + params->skip_cnt = 0; + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs_hdr_dol_lef(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 vts = 0, fsc = 0, cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + imx307_params *params = (imx307_params *)handle->private_data; + + params->expo.expo_lef_us = us; + + if(2 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_line_period = Preview_line_period_HDR_DOL_2LANE; + //cur_vts_30fps =vts_30fps_HDR_DOL_2lane; + } + else if(4 == handle->interface_attr.attr_mipi.mipi_lane_num) + { + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //cur_vts_30fps =vts_30fps_HDR_DOL_4lane; + } + + params->expo.expo_lines = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + + if (params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 - 3) { + vts = (params->expo.expo_lines + params->max_rhs1 + 3 + 1) / 2; + } + else{ + vts = params->expo.vts; + } + + // lines=us/Preview_line_period_HDR_DOL_4LANE; + SENSOR_DMSG("[%s] us %u, lines %u, vts %u\n", __FUNCTION__, + us, + params->expo.expo_lines, + params->expo.vts + ); + + fsc = vts * 2; + + if(params->expo.expo_lines <= 1) { + params->expo.expo_lines = 1; + } + + if(params->expo.expo_lines > fsc - 104) { + params->expo.expo_lines = fsc - 104; + } + + params->lef_shs2 = fsc - params->expo.expo_lines - 1; + + params->tShs2_reg[0].data = (params->lef_shs2 >> 16) & 0x0003; + params->tShs2_reg[1].data = (params->lef_shs2 >> 8) & 0x00ff; + params->tShs2_reg[2].data = (params->lef_shs2 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_hdr_dol_lef(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_LEF(ms_cus_sensor *handle, u32 gain) +{ + imx307_params *params = (imx307_params *)handle->private_data; + u16 gain_reg = 0; + + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_lef_reg[0].data = gain_reg; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_lef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_hdr_dol_lef(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = handle->sat_mingain; + *max = 3980*1024; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_hdr_dol_lef(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +//static int pCus_GetDGainRemainder(ms_cus_sensor *handle, u32 *dgain_remainder) +//{ +// *dgain_remainder = handle->dgain_remainder; + +// return SUCCESS; +//} + +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} + +static int IMX307_GetShutterInfo_hdr_dol_lef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = (Preview_line_period_HDR_DOL_4LANE * 5); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} +#if 0 +static int pCus_I2CWrite_hdr_dol_lef(ms_cus_sensor *handle, unsigned short usreg, unsigned short usval) +{ + return SUCCESS; +} + +static int pCus_I2CRead_hdr_dol_lef(ms_cus_sensor *handle, unsigned short usreg) +{ + return SUCCESS; +} +#endif +// +static int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx307_params *params; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx307_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tRhs1_reg, expo_RHS1_reg, sizeof(expo_RHS1_reg)); + memcpy(params->tShs2_reg, expo_SHS2_reg, sizeof(expo_SHS2_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX307_MIPI_HDR_LEF"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT_HDR_DOL; //TBD. Workaround for Sony DOL HDR mode + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth = 0x79C; + handle->video_res_supported.res[0].nOutputHeight = 0x449; + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps_HDR"); + + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + //handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_DOL; + + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + + ///calibration + handle->sat_mingain = SENSOR_MIN_GAIN;//g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_hdr_dol_lef; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_hdr_dol_lef; + handle->pCus_sensor_poweroff = pCus_poweroff_hdr_dol_lef; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_hdr_dol_lef; + + handle->pCus_sensor_GetVideoResNum = NULL; + handle->pCus_sensor_GetVideoRes = NULL; + handle->pCus_sensor_GetCurVideoRes = NULL; + handle->pCus_sensor_SetVideoRes = NULL; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_GetFPS = pCus_GetFPS_hdr_dol_lef; + handle->pCus_sensor_SetFPS = pCus_SetFPS_hdr_dol_lef; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + handle->pCus_sensor_SetPatternMode = imx307_SetPatternMode_hdr_dol_lef; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_hdr_dol_lef; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_hdr_dol_lef; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain_hdr_dol_lef; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_LEF; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_hdr_dol_lef; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_hdr_dol_lef; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_hdr_dol_lef; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity_hdr_dol_lef; + handle->pCus_sensor_GetShutterInfo = IMX307_GetShutterInfo_hdr_dol_lef; + + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.expo_lines = 673; + if (CUS_CMU_CLK_36MHZ == handle->mclk) + params->expo.fps = 29; + else + params->expo.fps = 30; + + params->dirty = false; + + return SUCCESS; +} + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static CUS_MCLK_FREQ UseParaMclk(const char *mclk) +{ +/* + CUS_CMU_CLK_27MHZ, + CUS_CMU_CLK_21P6MHZ, + CUS_CMU_CLK_12MHZ, + CUS_CMU_CLK_5P4MHZ, + CUS_CMU_CLK_36MHZ, + CUS_CMU_CLK_54MHZ, + CUS_CMU_CLK_43P2MHZ, + CUS_CMU_CLK_61P7MHZ, + CUS_CMU_CLK_72MHZ, + CUS_CMU_CLK_48MHZ, + CUS_CMU_CLK_24MHZ, + CUS_CMU_CLK_37P125MHZ, +*/ + if (strcmp(mclk, "27M") == 0) { + return CUS_CMU_CLK_27MHZ; + } else if (strcmp(mclk, "12M") == 0) { + return CUS_CMU_CLK_12MHZ; + } else if (strcmp(mclk, "36M") == 0) { + return CUS_CMU_CLK_36MHZ; + } else if (strcmp(mclk, "48M") == 0) { + return CUS_CMU_CLK_48MHZ; + } else if (strcmp(mclk, "54M") == 0) { + return CUS_CMU_CLK_54MHZ; + } else if (strcmp(mclk, "24M") == 0) { + return CUS_CMU_CLK_24MHZ; + } else if (strcmp(mclk, "37.125M") == 0) { + return CUS_CMU_CLK_37P125MHZ; + } + + return Preview_MCLK_SPEED; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( IMX307_HDR, + cus_camsensor_init_handle, + cus_camsensor_init_handle_hdr_dol_sef1, + cus_camsensor_init_handle_hdr_dol_lef, + imx307_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx335_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx335_mipi.c new file mode 100644 index 00000000..ee11c3b4 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_imx335_mipi.c @@ -0,0 +1,3707 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX335_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +//#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +//#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +#define ENABLE 1 +#define DISABLE 0 +#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define DEBUG_INFO 0 + +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +//#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// // +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +//////////////////////////////////// +// Sensor-If Info // +//////////////////////////////////// +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (lane_num) //IMX335 Linear mode supports MIPI 2/4 Lane +#define SENSOR_MIPI_LANE_NUM_DOL (4) //(hdr_lane_num)//IMX335 DOL mode supports MIPI 4 Lane +//#define SENSOR_MIPI_HDR_MODE (0) //0: Non-HDR mode. 1:Sony DOL mode + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC (Non-used) +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //0h: CUS_BAYER_RG, 1h: CUS_BAYER_GR, 2h: CUS_BAYER_BG, 3h: CUS_BAYER_GB +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +//#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +//////////////////////////////////// +// MCLK Info // +//////////////////////////////////// +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CUS_CMU_CLK_24MHZ //CUS_CMU_CLK_37P125MHZ//CUS_CMU_CLK_27MHZ +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_27MHZ + +//////////////////////////////////// +// I2C Info // +//////////////////////////////////// +#define SENSOR_I2C_ADDR 0x34 //I2C slave address +#define SENSOR_I2C_SPEED 300000 //200000 //300000 //240000 //I2C speed, 60000~320000 +//#define SENSOR_I2C_CHANNEL 1 //I2C Channel +//#define SENSOR_I2C_PAD_MODE 2 //Pad/Mode Number +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +//////////////////////////////////// +// Sensor Signal // +//////////////////////////////////// +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + // VSYNC/HSYNC POL can be found in data sheet timing diagram, + // Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +//////////////////////////////////// +// Sensor ID // +//////////////////////////////////// +//define SENSOR_ID + +#undef SENSOR_NAME +#define SENSOR_NAME IMX335 + +//////////////////////////////////// +// Image Info // +//////////////////////////////////// +static struct { // LINEAR + // Modify it based on number of support resolution + enum {LINEAR_RES_1 = 0, LINEAR_RES_2, LINEAR_RES_END}mode; + // Sensor Output Image info + struct _senout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _sensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _senstr{ + const char* strResDesc; + }senstr; +}imx335_mipi_linear[] = { + {LINEAR_RES_1, {2592, 1944, 3, 25}, {0, 0, 2592, 1944}, {"2592x1944@25fps"}}, + {LINEAR_RES_2, {2592, 1944, 3, 30}, {0, 0, 2592, 1944}, {"2592x1944@30fps"}}, // Modify it +}; + +static struct { // HDR + // Modify it based on number of support resolution + enum {HDR_RES_1 = 0, HDR_RES_2, HDR_RES_3, HDR_RES_END}mode; + // Sensor Output Image info + struct _hsenout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _hsensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _hsenstr{ + const char* strResDesc; + }senstr; +}imx335_mipi_hdr[] = { + {HDR_RES_1, {2592, 1944, 3, 25}, {4, 0, 2592, 1944}, {"2592x1944@25fps_HDR"}}, // Modify it + {HDR_RES_2, {2592, 1944, 3, 20}, {4, 0, 2592, 1944}, {"2592x1944@20fps_HDR"}}, // Modify it + {HDR_RES_3, {2592, 1944, 3, 30}, {4, 0, 2592, 1944}, {"2592x1944@30fps_HDR"}}, // Modify it +}; + +#define IMX335_HDR_BRL 2228 + +u32 Preview_line_period; +u32 vts_30fps; +u32 Preview_MAX_FPS; +u32 Preview_line_period_HDR_DOL; +u32 vts_30fps_HDR_DOL; + +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +//#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +//#define long_packet_type_enable 0x00 //UD1~UD8 (user define) +//////////////////////////////////// +// AE Info // +//////////////////////////////////// +#define SENSOR_MAX_GAIN (1412 * 1024) // max sensor again, a-gain * conversion-gain*d-gain +#define SENSOR_MIN_GAIN (1 * 1024) +#define SENSOR_GAIN_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT (2) +#define SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL (1) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL (2) + +//////////////////////////////////// +// Mirror-Flip Info // +//////////////////////////////////// +#define REG_MIRROR 0x304E +#define REG_FLIP 0x304F +#define SENSOR_NOR 0x0 +#define MIRROR_EN 0x1 << (0) +#define FLIP_EN 0x1 << (0) + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +//static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +//static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lines; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + u32 max_rhs1; + int sen_init; + int still_min_fps; + int video_min_fps; + bool dirty; + bool orien_dirty; + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tGain_reg[2]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tExpo_shr_dol1_reg[3]; + I2C_ARRAY tExpo_rhs1_reg[3]; + I2C_ARRAY tGain_hdr_dol_lef_reg[2]; + I2C_ARRAY tGain_hdr_dol_sef_reg[2]; +} imx335_params; +// set sensor ID address and data, + +const static I2C_ARRAY Sensor_id_table[] = +{ + {0x3003, 0x00}, // {address of ID, ID }, + {0x3033, 0x00} +}; + +const static I2C_ARRAY Sensor_init_table_2lane_5m25fps[] = +{ + /*"IMX335LQN All-pixel scan CSI-2_2lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 25fps"*/ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, //BCWAIT_TIME + {0x300D,0x2E}, //CPWAIT_TIME + {0x3030,0x56}, //VMAX //101Dh: 4125 //1518h: 5400 + {0x3031,0x13}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x3050,0x00}, //ADBIT + {0x314C,0xB0}, //INCKSEL1 + {0x315A,0x02}, //INCKSEL2 + {0x3168,0x8F}, //INCKSEL3 + {0x316A,0x7E}, //INCKSEL4 + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, //XH&VSOUTSEL + {0x31A1,0x00}, //XVS/XHS pin setting + {0x31A4,0x00}, //PULSE1_UP + {0x31A5,0x00}, //PULSE1_UP + {0x31A6,0x00}, //PULSE1_UP + {0x31A8,0x00}, //PULSE1EN/PULSE1_POL + {0x31AC,0x00}, //PULSE1_DN + {0x31AD,0x00}, //PULSE1_DN + {0x31AE,0x00}, //PULSE1_DN + {0x31D4,0x00}, //XVSLNG + {0x31D5,0x00}, //XHSLNG + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x341D,0x01}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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,0x01}, //LANEMODE 0x03:4Lane 0x01:2Lane + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_2lane_5m30fps[] = +{ + /*"IMX335LQN All-pixel scan CSI-2_2lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 30fps"*/ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, //BCWAIT_TIME + {0x300D,0x2E}, //CPWAIT_TIME + {0x3030,0x1D}, //VMAX //1194 :4500 //101D: 4125 + {0x3031,0x10}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x3050,0x00}, //ADBIT + {0x314C,0xB0}, //INCKSEL1 + {0x315A,0x02}, //INCKSEL2 + {0x3168,0x8F}, //INCKSEL3 + {0x316A,0x7E}, //INCKSEL4 + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, //XH&VSOUTSEL + {0x31A1,0x00}, //XVS/XHS pin setting + {0x31A4,0x00}, //PULSE1_UP + {0x31A5,0x00}, //PULSE1_UP + {0x31A6,0x00}, //PULSE1_UP + {0x31A8,0x00}, //PULSE1EN/PULSE1_POL + {0x31AC,0x00}, //PULSE1_DN + {0x31AD,0x00}, //PULSE1_DN + {0x31AE,0x00}, //PULSE1_DN + {0x31D4,0x00}, //XVSLNG + {0x31D5,0x00}, //XHSLNG + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x341D,0x01}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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,0x01}, //LANEMODE 0x03:4Lane 0x01:2Lane + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_4lane_5m25fps[] = +{ +/* "IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x56}, //VMAX //101Dh: 4125 //1518h: 5400 + {0x3031,0x13}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xFF}, //0x47--12-bit 0xff--10bit + {0x341d,0x01}, //0x00--12-bit 0x01--10bit + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + //{0x3A18,0x7F}, //TCLKPOST + //{0x3A19,0x00}, //TCLKPOST + //{0x3A1A,0x37}, //TCLKPREPARE + //{0x3A1B,0x00}, //TCLKPREPARE + //{0x3A1C,0x37}, //TCLKTRAIL + //{0x3A1D,0x00}, //TCLKTRAIL + //{0x3A1E,0xF7}, //TCLKZERO + //{0x3A1F,0x00}, //TCLKZERO + //{0x3A20,0x3F}, //THSPREPARE + //{0x3A21,0x00}, //THSPREPARE + //{0x3A22,0x6F}, //THSZERO + //{0x3A23,0x00}, //THSZERO + //{0x3A24,0x3F}, //THSTRAIL + //{0x3A25,0x00}, //THSTRAIL + //{0x3A26,0x5F}, //THSEXIT + //{0x3A27,0x00}, //THSEXIT + //{0x3A28,0x2F}, //TLPX + //{0x3A29,0x00}, //TLPX + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_4lane_5m30fps[] = +{ +/* "IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 30fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x1D}, //VMAX //1194 :4500 //101D: 4125 + {0x3031,0x10}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xFF}, //0x47--12-bit 0xff--10bit + {0x341d,0x01}, //0x00--12-bit 0x01--10bit + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + //{0x3A18,0x7F}, //TCLKPOST + //{0x3A19,0x00}, //TCLKPOST + //{0x3A1A,0x37}, //TCLKPREPARE + //{0x3A1B,0x00}, //TCLKPREPARE + //{0x3A1C,0x37}, //TCLKTRAIL + //{0x3A1D,0x00}, //TCLKTRAIL + //{0x3A1E,0xF7}, //TCLKZERO + //{0x3A1F,0x00}, //TCLKZERO + //{0x3A20,0x3F}, //THSPREPARE + //{0x3A21,0x00}, //THSPREPARE + //{0x3A22,0x6F}, //THSZERO + //{0x3A23,0x00}, //THSZERO + //{0x3A24,0x3F}, //THSTRAIL + //{0x3A25,0x00}, //THSTRAIL + //{0x3A26,0x5F}, //THSEXIT + //{0x3A27,0x00}, //THSEXIT + //{0x3A28,0x2F}, //TLPX + //{0x3A29,0x00}, //TLPX + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m25fps[] = +{ +#if 1 +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x9A}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x88}, + {0x3059,0x1D}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + //{0x37b0,0x36}, + //{0x3a01,0x03}, + //{0x3a04,0x90}, + //{0x3a05,0x12}, + //{0x3a18,0x8f}, + //{0x3a19,0x00}, + //{0x3a1a,0x4f}, + //{0x3a1b,0x00}, + //{0x3a1c,0x47}, + //{0x3a1d,0x00}, + //{0x3a1e,0x37}, + //{0x3a1f,0x01}, + //{0x3a20,0x4f}, + //{0x3a21,0x00}, + //{0x3a22,0x87}, + //{0x3a23,0x00}, + //{0x3a24,0x4f}, + //{0x3a25,0x00}, + //{0x3a26,0x7f}, + //{0x3a27,0x00}, + //{0x3a28,0x3f}, + //{0x3a29,0x00}, + {0x3000,0x00}, + {0x3002,0x00}, +#else //Ori_24Mhz + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + + {0x3030,0x9A}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x88}, + {0x3059,0x1d}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x00}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m20fps[] = +{ +#if 1 +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0xC0}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x14}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x88}, + {0x3059,0x1D}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + //{0x37b0,0x36}, + //{0x3a01,0x03}, + //{0x3a04,0x90}, + //{0x3a05,0x12}, + //{0x3a18,0x8f}, + //{0x3a19,0x00}, + //{0x3a1a,0x4f}, + //{0x3a1b,0x00}, + //{0x3a1c,0x47}, + //{0x3a1d,0x00}, + //{0x3a1e,0x37}, + //{0x3a1f,0x01}, + //{0x3a20,0x4f}, + //{0x3a21,0x00}, + //{0x3a22,0x87}, + //{0x3a23,0x00}, + //{0x3a24,0x4f}, + //{0x3a25,0x00}, + //{0x3a26,0x7f}, + //{0x3a27,0x00}, + //{0x3a28,0x3f}, + //{0x3a29,0x00}, + {0x3000,0x00}, + {0x3002,0x00}, +#else //Ori_24Mhz + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + {0x3030,0x5e}, //1A5Eh : 6750 // 16A8h : 5800 + {0x3031,0x1a}, + {0x3032,0x00}, + {0x3033,0x00}, + {0x3034,0x13}, //113h : 275 // 140h : 320 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x14}, + {0x3059,0x28}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x00}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m30fps[] = +{ +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 30fps"*/ +#if 1 + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x00}, //4096 1000h + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x2C}, //HMAX 300 : 12Ch + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x1C}, + {0x3059,0x22}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + //{0x37b0,0x36}, + //{0x3a01,0x03}, + //{0x3a04,0x90}, + //{0x3a05,0x12}, + //{0x3a18,0x8f}, + //{0x3a19,0x00}, + //{0x3a1a,0x4f}, + //{0x3a1b,0x00}, + //{0x3a1c,0x47}, + //{0x3a1d,0x00}, + //{0x3a1e,0x37}, + //{0x3a1f,0x01}, + //{0x3a20,0x4f}, + //{0x3a21,0x00}, + //{0x3a22,0x87}, + //{0x3a23,0x00}, + //{0x3a24,0x4f}, + //{0x3a25,0x00}, + //{0x3a26,0x7f}, + //{0x3a27,0x00}, + //{0x3a28,0x3f}, + //{0x3a29,0x00}, + {0x3000,0x00}, + {0x3002,0x00}, +#else + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + + {0x3030,0x9A}, //VMAX + {0x3031,0x11}, + {0x3032,0x00}, + {0x3033,0x00}, + {0x3034,0x13}, //HMAX + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x9c}, + {0x3059,0x18}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x02}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +static I2C_ARRAY PatternTbl[] = { + {0x308c,0x20}, //colorbar pattern , bit 0 to enable +}; + +const static I2C_ARRAY gain_HDR_DOL_LEF_reg[] = +{ + {0x30E8, 0x00},// bit0-7 low + {0x30E9, 0x00},// bit0-2(8-10) +}; + +const static I2C_ARRAY gain_HDR_DOL_SEF1_reg[] = +{ + {0x30EA, 0x00},// bit0-7 low + {0x30EB, 0x00},// bit0-2(8-10) +}; + +const static I2C_ARRAY expo_shr_dol1_reg[] = +{ //SEL + {0x305e, 0x00}, // bit0-3(16-18) + {0x305d, 0x00}, // bit0-7(8-15) + {0x305c, 0x12}, // bit0-7 +}; + +const I2C_ARRAY expo_rhs1_reg[] = +{ //SEL + {0x306a, 0x00}, // bit0-3(16-18) + {0x3069, 0x00}, // bit0-7(8-15) + {0x3068, 0xCE}, // bit0-7 +}; + +const static I2C_ARRAY mirr_flip_table[] = +{ + {0x304e, 0x00}, //M0F0 + {0x304f, 0x00}, //M0F0 + {0x3081, 0x02}, + {0x3083, 0x02}, + {0x30b6, 0x00}, + {0x30b7, 0x00}, + {0x3016, 0x08}, + + {0x304e, 0x01}, //M1F0 + {0x304f, 0x00}, //M1F0 + {0x3081, 0x02}, + {0x3083, 0x02}, + {0x30b6, 0x00}, + {0x30b7, 0x00}, + {0x3016, 0x08}, + + {0x304e, 0x00}, //M0F1 + {0x304f, 0x01}, //M0F1 + {0x3081, 0xfe}, + {0x3083, 0xfe}, + {0x30b6, 0xfa}, + {0x30b7, 0x01}, + {0x3016, 0x02}, + + {0x304e, 0x01}, //M1F1 + {0x304f, 0x01}, //M1F1 + {0x3081, 0xfe}, + {0x3083, 0xfe}, + {0x30b6, 0xfa}, + {0x30b7, 0x01}, + {0x3016, 0x02}, +}; + +const static I2C_ARRAY gain_reg[] = { + {0x30E8, 0x00},// bit0-7 low + {0x30E9, 0x00},// bit0-2(8-10) +}; + +//static int g_sensor_ae_min_gain = 1024; +static CUS_GAIN_GAP_ARRAY gain_gap_compensate[16] = { //compensate gain gap + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +const static I2C_ARRAY expo_reg[] = { + {0x305a, 0x00}, // bit0-3(16-18) + {0x3059, 0x00}, // bit0-7(8-15) + {0x3058, 0x09}, // bit0-7 +}; + +const static I2C_ARRAY vts_reg[] = { + {0x3032, 0x00}, // bit0-3(16-18) + {0x3031, 0x11}, // bit0-7(8-15) + {0x3030, 0x94}, // bit0-7 +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@@ // +// @@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { +#if 0 + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); +#endif + return SUCCESS; +} +#endif + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +/*******I5/I6 Support MCLK List******* + * CUS_CMU_CLK_27MHZ, + * CUS_CMU_CLK_21P6MHZ, + * CUS_CMU_CLK_12MHZ, + * CUS_CMU_CLK_5P4MHZ, + * CUS_CMU_CLK_36MHZ, + * CUS_CMU_CLK_54MHZ, + * CUS_CMU_CLK_43P2MHZ, + * CUS_CMU_CLK_61P7MHZ, + * CUS_CMU_CLK_72MHZ, + * CUS_CMU_CLK_48MHZ, + * CUS_CMU_CLK_24MHZ, + * CUS_CMU_CLK_37P125MHZ, + ******End of Support MCLK List*******/ + #if 0 +static CUS_MCLK_FREQ UseParaMclk(const char *mclk) +{ + if (strcmp(mclk, "27M") == 0) { + return CUS_CMU_CLK_27MHZ; + } else if (strcmp(mclk, "12M") == 0) { + return CUS_CMU_CLK_12MHZ; + } else if (strcmp(mclk, "36M") == 0) { + return CUS_CMU_CLK_36MHZ; + } else if (strcmp(mclk, "48M") == 0) { + return CUS_CMU_CLK_48MHZ; + } else if (strcmp(mclk, "54M") == 0) { + return CUS_CMU_CLK_54MHZ; + } else if (strcmp(mclk, "24M") == 0) { + return CUS_CMU_CLK_24MHZ; + } else if (strcmp(mclk, "37.125M") == 0) { + return CUS_CMU_CLK_37P125MHZ; + } + return Preview_MCLK_SPEED; +} +#endif + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //Sensor power on sequence + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, !handle->reset_POLARITY); + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + //Sensor board PWDN Enable, 1.8V & 2.9V need 30ms then Pull High + SENSOR_MSLEEP(31); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_UDELAY(1); + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_DMSG("Sensor Power On finished\n"); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + handle->orient = SENSOR_ORIT; + + return SUCCESS; +} + +/////////////////// Check Sensor Product ID ///////////////////////// +#if 0 +static int pCus_CheckSensorProductID(ms_cus_sensor *handle) +{ + u16 sen_id_msb, sen_id_lsb, sen_data; + + /* Read Product ID */ + SensorReg_Read(0x3f12, &sen_id_lsb); + SensorReg_Read(0x3f13, &sen_id_msb);//CHIP_ID_r3F13 + sen_data = ((sen_id_lsb & 0x0F) << 8) | (sen_id_lsb & 0xF0) | (sen_id_msb & 0x0F); +#if 0 + if (sen_data != CHIP_ID) { + printk("[***ERROR***]Check Product ID Fail: 0x%x\n", sen_data); + return FAIL; + } +#endif + return SUCCESS; +} +#endif +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if(/* SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == */SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_MSLEEP(1); + } + + //convert sensor id to u32 format + for(i=0;i=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_2lane_5m25fps[i].reg, Sensor_init_table_2lane_5m25fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_2lane_5m25fps[i].reg, &sen_data ); + if(Sensor_init_table_2lane_5m25fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_2lane_5m25fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_2lane_5m25fps[i].reg, Sensor_init_table_2lane_5m25fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi2lane_5m30fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_2lane_5m30fps);i++) + { + if(Sensor_init_table_2lane_5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_2lane_5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_2lane_5m30fps[i].reg,Sensor_init_table_2lane_5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_2lane_5m30fps[i].reg, Sensor_init_table_2lane_5m30fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_2lane_5m30fps[i].reg, &sen_data ); + if(Sensor_init_table_2lane_5m30fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_2lane_5m30fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_2lane_5m30fps[i].reg, Sensor_init_table_2lane_5m30fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane_5m30fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5m30fps);i++) + { + if(Sensor_init_table_4lane_5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5m30fps[i].reg,Sensor_init_table_4lane_5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_5m30fps[i].reg, Sensor_init_table_4lane_5m30fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_5m30fps[i].reg, &sen_data ); + if(Sensor_init_table_4lane_5m30fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_5m30fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_5m30fps[i].reg, Sensor_init_table_4lane_5m30fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane_5m25fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5m25fps);i++) + { + if(Sensor_init_table_4lane_5m25fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5m25fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5m25fps[i].reg,Sensor_init_table_4lane_5m25fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_5m25fps[i].reg, Sensor_init_table_4lane_5m25fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_5m25fps[i].reg, &sen_data ); + if(Sensor_init_table_4lane_5m25fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_5m25fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_5m25fps[i].reg, Sensor_init_table_4lane_5m25fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m25fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m25fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m25fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m25fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m25fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg, &sen_data ); + if(Sensor_init_table_HDR_DOL_4lane5m25fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m25fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m20fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m20fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m20fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m20fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m20fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg, &sen_data ); + if(Sensor_init_table_HDR_DOL_4lane5m20fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m20fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m30fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m30fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m30fps[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg, &sen_data ); + if(Sensor_init_table_HDR_DOL_4lane5m30fps[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg); + //printk("IMX335 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg, Sensor_init_table_HDR_DOL_4lane5m30fps[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + if(lane_num == 2){ + handle->pCus_sensor_init = pCus_init_mipi2lane_5m25fps_linear; + } + else if (lane_num == 4){ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m25fps_linear; + } + else{ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m25fps_linear; + } + vts_30fps = 4950; + Preview_MAX_FPS = 25; + Preview_line_period = 8080; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + if(lane_num == 2){ + handle->pCus_sensor_init = pCus_init_mipi2lane_5m30fps_linear; + } + else if (lane_num == 4){ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + } + else{ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + } + + vts_30fps = 4125; + Preview_MAX_FPS = 30; + Preview_line_period = 8080; + break; + default: + break; + } + params->expo.vts = vts_30fps; + params->expo.fps = Preview_MAX_FPS; + + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL(ms_cus_sensor *handle, u32 res_idx) +{ + imx335_params *params = (imx335_params *)handle->private_data; + //ISensorIfAPI *sensor_if = &handle->sensor_if_api; + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane5m25fps_HDR_DOL; + vts_30fps_HDR_DOL = 4250; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 25; + params->expo.fps=Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 9411; //8889 + params->max_rhs1 = 290; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_mipi4lane5m20fps_HDR_DOL; + vts_30fps_HDR_DOL = 5312; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 20; + params->expo.fps=Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 9411; + params->max_rhs1 = 290; + break; + case 2: + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_mipi4lane5m30fps_HDR_DOL; + vts_30fps_HDR_DOL = 4096; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 30; + params->expo.fps= Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 8318; + params->max_rhs1 = 290; + break; + default: + break; + } + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + short Horiz_Inv = 0; + short Verti_Inv = 0; + short Orien_Mode = 0; + SensorReg_Read(0x304e, &Horiz_Inv); + SensorReg_Read(0x304f, &Verti_Inv); + Horiz_Inv &= 0x01; + Verti_Inv &= 0X01; + Orien_Mode = Horiz_Inv |(Verti_Inv << 2); + switch(Orien_Mode) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x01: + *orit = CUS_ORIT_M1F0; + break; + case 0x02: + *orit = CUS_ORIT_M0F1; + break; + case 0x03: + *orit = CUS_ORIT_M1F1; + break; + } + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int DoOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + int table_length = ARRAY_SIZE(mirr_flip_table); + int seg_length = table_length/4; + int i,j; + + switch(orit) + { + case CUS_ORIT_M0F0: + handle->orient = CUS_ORIT_M0F0; + for(i = 0, j = 0; i < seg_length; i++, j++){ + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + //SensorReg_Write(0x304e,0x00); + //SensorReg_Write(0x304f,0x00); + } + break; + case CUS_ORIT_M1F0: + for(i = seg_length, j = 0; i < seg_length*2; i++, j++){ + handle->orient = CUS_ORIT_M1F0; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + //SensorReg_Write(0x304e,0x01); + //SensorReg_Write(0x304f,0x00); + } + break; + case CUS_ORIT_M0F1: + for(i = seg_length * 2, j = 0; i < seg_length*3; i++, j++){ + handle->orient = CUS_ORIT_M0F1; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + //SensorReg_Write(0x304e,0x00); + //SensorReg_Write(0x304f,0x01); + } + break; + case CUS_ORIT_M1F1: + for(i = seg_length * 3, j = 0; i < seg_length*4; i++, j++){ + handle->orient = CUS_ORIT_M1F1; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + //SensorReg_Write(0x304e,0x01); + //SensorReg_Write(0x304e,0x01); + } + break; + default : + handle->orient = CUS_ORIT_M0F0; + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0; + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if((fps>=(min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps*(max_fps*1000) + (fps>>1))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=25; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts -2){ + vts = params->expo.expo_lines + 8; + }else{ + vts = params->expo.vts; + } + params->expo.vts = vts; + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle, u32 fps) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps_HDR_DOL*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps_HDR_DOL*(max_fps*1000) + (fps>>1))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + params->dirty = true; //reg need to update = true; + pCus_SetAEUSecsHDR_DOL_SEF1(handle, params->expo.expo_sef_us); + + return SUCCESS; +} +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) +{ + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + params->dirty = false; + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF1(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //imx335_params *params = (imx335_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + u32 lines = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + lines |= (u32)(params->tExpo_reg[0].data&0xff)<<16; + lines |= (u32)(params->tExpo_reg[1].data&0xff)<<8; + lines |= (u32)(params->tExpo_reg[2].data&0xff)<<0; + + *us = (lines*Preview_line_period)/1000; + SENSOR_DMSG("[%s] sensor expo lines/us %u,%u us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0,activeline = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + params->expo.expo_lef_us = us; + + lines = (1000 * us) / Preview_line_period; + if(lines < 9) lines = 9; + params->expo.expo_lines = lines; + + if (lines >params->expo.vts-1) + vts = lines +1; + else + vts = params->expo.vts; + + SENSOR_DMSG("[%s] us %u, lines %u, vts %u\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + + activeline = vts - lines; + if(activeline < 9) activeline = 9; + + params->tExpo_reg[0].data = (activeline>>16) & 0x000f; + params->tExpo_reg[1].data = (activeline>>8) & 0x00ff; + params->tExpo_reg[2].data = (activeline>>0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x000f; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us) +{ + u32 qua_lines = 0, lines = 0, long_lines = 0,vts = 0, fsc = 0; + u32 rhs1 = 0, shs1 = 0, shs0 = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + params->expo.expo_sef_us = us; + qua_lines = (1000 * us) / Preview_line_period_HDR_DOL /4; + vts = params->expo.vts; + shs0 = (params->tExpo_reg[0].data << 16) | (params->tExpo_reg[1].data << 8) | (params->tExpo_reg[2].data << 0); + fsc = vts * 2; + long_lines = fsc - shs0; + params->expo.expo_lines = long_lines; + + //params->max_rhs1 = 290; + rhs1 = params->max_rhs1;//(params->tExpo_rhs1_reg[0].data << 16) | (params->tExpo_rhs1_reg[1].data << 8) | (params->tExpo_rhs1_reg[2].data << 0); + + if(qua_lines <= 1) + qua_lines = 1; + if((4*qua_lines) > (rhs1- 18)) + qua_lines = (rhs1 - 18)/4; + + lines = 4*qua_lines; + if((rhs1 - 18) <= lines){ + shs1 = 18; + } + else if((rhs1 <= params->max_rhs1) && (rhs1 <= shs0 - 18)){ + shs1 = rhs1 - lines; + if((shs1 < 18) || (shs1 > (rhs1 - 4))){ //Check boundary + //shs1 = 0; + //UartSendTrace("[SEF1 NG1]"); + } + } + else{ + //UartSendTrace("[SEF1 NG2]"); + } + + params->tExpo_shr_dol1_reg[0].data = (shs1 >> 16) & 0x000f; + params->tExpo_shr_dol1_reg[1].data = (shs1 >> 8) & 0x00ff; + params->tExpo_shr_dol1_reg[2].data = (shs1 >> 0) & 0x00ff; + params->tExpo_rhs1_reg[0].data = (rhs1 >> 16) & 0x000f; + params->tExpo_rhs1_reg[1].data = (rhs1 >> 8) & 0x00ff; + params->tExpo_rhs1_reg[2].data = (rhs1 >> 0) & 0x00ff; + + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + //int rc = SensorRegArrayR((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + unsigned short temp_gain; + // *gain=params->expo.final_gain; + temp_gain=gain_reg[0].data; + + *gain=(u32)(10^((temp_gain*3)/200))*1024; + if (gain_reg[1].data & 0x10) + *gain = (*gain) * 2; + + SENSOR_DMSG("[%s] get gain/reg (1024=1X)= %u/0x%x\n", __FUNCTION__, *gain,gain_reg[0].data); + //return rc; + return SUCCESS; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + //double gain_double; + u64 gain_double; + params->expo.final_gain = gain; + + if(gain<1024) + gain=1024; + else if(gain>=3980*1024) + gain=3980*1024; + + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3); + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + //extern DBG_ITEM Dbg_Items[DBG_TAG_MAX]; + imx335_params *params = (imx335_params *)handle->private_data; + u32 i=0; + CUS_GAIN_GAP_ARRAY* Sensor_Gain_Linearity; + u64 gain_double; + + params->expo.final_gain = gain; + if(gain < SENSOR_MIN_GAIN) + gain = SENSOR_MIN_GAIN; + else if(gain >= SENSOR_MAX_GAIN) + gain = SENSOR_MAX_GAIN; + Sensor_Gain_Linearity = gain_gap_compensate; + + for(i = 0; i < sizeof(gain_gap_compensate)/sizeof(CUS_GAIN_GAP_ARRAY); i++){ + + if (Sensor_Gain_Linearity[i].gain == 0) + break; + if((gain>Sensor_Gain_Linearity[i].gain) && (gain < (Sensor_Gain_Linearity[i].gain + Sensor_Gain_Linearity[i].offset))){ + gain=Sensor_Gain_Linearity[i].gain; + break; + } + } + + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3) & 0x00ff; + params->tGain_reg[1].data=(u16)((((gain_double*10)>> 24)/3) >> 8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + params->dirty = true; + return SUCCESS; +} + +static void pCus_SetAEGainHDR_DOL_Calculate(u32 gain, u16 *gain_reg) +{ + //double gain_double; + u64 gain_double; + + if(gain < SENSOR_MIN_GAIN){ + gain = SENSOR_MIN_GAIN; + } + else if(gain >= SENSOR_MAX_GAIN){ + gain = SENSOR_MAX_GAIN; + } + gain_double = 20*(intlog10(gain)-intlog10(1024)); + *gain_reg=(u16)(((gain_double*10)>> 24)/3) & 0x07ff; +} + +static int pCus_SetAEGainHDR_DOL_SEF1(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_sef_reg[0].data = gain_reg & 0x00ff; + params->tGain_hdr_dol_sef_reg[1].data = (gain_reg>>8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_sef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx335_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = SENSOR_MIN_GAIN;//handle->sat_mingain; + *max = SENSOR_MAX_GAIN;//3980*1024; + return SUCCESS; +} + +static int IMX335_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx335_mipi_linear[0].senout.min_fps; + info->min = (Preview_line_period * 9); + info->step = Preview_line_period; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + u32 i, j; + + for(i=0,j=0;i< num ;i++,j+=2){ + gain_gap_compensate[i].gain=pArray[i].gain; + gain_gap_compensate[i].offset=pArray[i].offset; + } + return SUCCESS; +} + +static int IMX335_GetShutterInfoHDR_DOL_SEF1(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + imx335_params *params = (imx335_params *)handle->private_data; + info->max = Preview_line_period_HDR_DOL * params->max_rhs1; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL; + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx335_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + //memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + //memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + //memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + //memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D8; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x34; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //300000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = LINEAR_RES_END; + for (res = 0; res < LINEAR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_linear[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_linear[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_linear[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_linear[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_linear[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_linear[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_linear[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_linear[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_linear[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + //handle->pCus_sensor_powerupseq = pCus_powerupseq; + handle->pCus_sensor_poweron = pCus_poweron; + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_GetFPS = pCus_GetFPS; + handle->pCus_sensor_SetFPS = pCus_SetFPS; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = imx335_SetPatternMode; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + handle->sat_mingain = SENSOR_MIN_GAIN; //calibration + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfo; + + params->expo.vts = vts_30fps; + params->expo.expo_lines = 5000; + params->dirty = false; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef1(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params = NULL; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx335_params *)handle->private_data; + memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI_HDR_SEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC_DOL; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM_DOL; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane5m25fps_HDR_DOL; + handle->pCus_sensor_poweron = pCus_poweron; // Need to check + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; // Need to check + handle->pCus_sensor_SetOrien = pCus_SetOrien; // Need to check + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF1; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF1; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; //g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF1; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF1; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF1; + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfoHDR_DOL_SEF1; + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.expo_lines = 4250; + return SUCCESS; +} + +//lef functions +static int pCus_init_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static int pCus_poweron_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_GetSensorID_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *id) +{ + *id = 0; + return SUCCESS; +} + +static int pCus_GetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + *orit = CUS_ORIT_M0F0; + return SUCCESS; +} + +static int pCus_SetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_LEF(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0; + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*(max_fps*1000))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 -18){ + vts = (params->expo.expo_lines + params->max_rhs1 + 18) / 2; + }else{ + vts = params->expo.vts; + } + + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_lef_us); + + return SUCCESS; +} +#if 0 +static int pCus_GetSensorCap_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) +{ + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif +static int imx335_SetPatternMode_hdr_dol_lef(ms_cus_sensor *handle,u32 mode) +{ + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) + { + SensorReg_Write(0x3001,1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_shr_dol1_reg, ARRAY_SIZE(expo_shr_dol1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_rhs1_reg, ARRAY_SIZE(expo_rhs1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_lef_reg, ARRAY_SIZE(gain_HDR_DOL_LEF_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_sef_reg, ARRAY_SIZE(gain_HDR_DOL_SEF1_reg)); + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 qua_lines = 0,lines = 0, half_vts = 0, vts = 0, shr_dol0 = 0, fsc = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + qua_lines = (1000 * us) / Preview_line_period_HDR_DOL / 4; + // lines=us/Preview_line_period_HDR_DOL; + params->expo.expo_lef_us = us; + + if (4 * qua_lines > 2 * params->expo.vts - params->max_rhs1 - 18) { // shs2 > max_rhs1 +2 + half_vts = (4 * qua_lines + params->max_rhs1 + 19) / 4; + } + else{ + half_vts = params->expo.vts / 2; + } + + SENSOR_DMSG("[%s] us %u, qua_lines %u, vts %u\n", __FUNCTION__, + us, + qua_lines, + params->expo.vts + ); + + //exposure limit lines = fsc - (shs2 + 1) = fsc - 1 - ( rhs1 + 2 ~ fsc - 2) = 1 ~ fsc - 104 (rhs1 fix to 101) + vts = half_vts * 2; + fsc = half_vts * 4; + if(qua_lines < 1) // shs2 < fsc - 2 + qua_lines = 1; + if(4 * qua_lines > fsc - params->max_rhs1 - 18) + qua_lines = (fsc - params->max_rhs1 - 18) / 4; + + lines = 4*qua_lines; + params->expo.expo_lines = lines; + + shr_dol0 = fsc - lines; +#if 0 + printk("[%s] us %u, qua_lines %u, vts %u shr_dol0 %u\n", __FUNCTION__, + us, + qua_lines, + params->expo.vts, + shr_dol0 + ); +#endif + params->tExpo_reg[0].data = (shr_dol0 >> 16) & 0x000f; + params->tExpo_reg[1].data = (shr_dol0 >> 8) & 0x00ff; + params->tExpo_reg[2].data = (shr_dol0 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x000f; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_LEF(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_lef_reg[0].data = gain_reg & 0x00ff; + params->tGain_hdr_dol_lef_reg[1].data = (gain_reg>>8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_lef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = handle->sat_mingain; + *max = SENSOR_MAX_GAIN; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx335_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} + +static int IMX335_GetShutterInfo_hdr_dol_lef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx335_mipi_linear[0].senout.min_fps; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL; + return SUCCESS; +} + +static int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params; + s32 res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx335_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI_HDR_LEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + //sensor_if->MCLK(0,1,handle->mclk); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM_DOL; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_HDR_DOL_LEF; + //handle->pCus_sensor_powerupseq = pCus_powerupseq; + handle->pCus_sensor_poweron = pCus_poweron_HDR_DOL_LEF; + handle->pCus_sensor_poweroff = pCus_poweroff_HDR_DOL_LEF; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_HDR_DOL_LEF; + //handle->pCus_sensor_GetVideoResNum = NULL; + //handle->pCus_sensor_GetVideoRes = NULL; + //handle->pCus_sensor_GetCurVideoRes = NULL; + //handle->pCus_sensor_SetVideoRes = NULL; // Need to check + + handle->pCus_sensor_GetOrien = pCus_GetOrien_HDR_DOL_LEF; + handle->pCus_sensor_SetOrien = pCus_SetOrien_HDR_DOL_LEF; + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_LEF; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_LEF; + + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + handle->pCus_sensor_SetPatternMode = imx335_SetPatternMode_hdr_dol_lef; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_HDR_DOL_LEF; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_HDR_DOL_LEF; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_HDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_HDR_DOL_LEF; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_hdr_dol_lef; + handle->pCus_sensor_setCaliData_gain_linearity = pCus_setCaliData_gain_linearity_hdr_dol_lef; + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfo_hdr_dol_lef; + + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.expo_lines = 673; + params->expo.fps = 25; + params->dirty = false; + + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX(IMX335_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef1, + cus_camsensor_init_handle_hdr_dol_lef, + imx335_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2239_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2239_mipi.c new file mode 100644 index 00000000..e8c52057 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2239_mipi.c @@ -0,0 +1,1086 @@ +/* SigmaStar trade secret */ +/* Copyright (c) [2019~2020] SigmaStar Technology. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained + herein regardless in any format shall remain the sole proprietary of + SigmaStar and be kept in strict confidence + (SigmaStar Confidential Information) by the recipient. + Any unauthorized act including without limitation unauthorized disclosure, + copying, use, reproduction, sale, distribution, modification, disassembling, + reverse engineering and compiling of the contents of SigmaStar Confidential + Information is unlawful and strictly prohibited. SigmaStar hereby reserves the + rights to any and all damages, losses, costs and expenses resulting therefrom. + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(SC2239); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +//#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (1) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 +#define SENSOR_BAYERID CUS_BAYER_BG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAXGAIN (155*31)/10 // (15.5*31) max sensor gain, a-gain*conversion-gain*d-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +#define Preview_line_period 29630 //1/30/1500 +#define vts_30fps 1125 //for 30 fps + +#define Preview_WIDTH 1920 //resolution Width when preview +#define Preview_HEIGHT 1080 //resolution Height when preview +#define Preview_MAX_FPS 30 //25 //fastest preview FPS +#define Preview_MIN_FPS 3 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x60 //I2C slave address +#define SENSOR_I2C_SPEED 240000 //I2C speed,60000~320000 +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_POS // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif +static int cus_camsensor_release_handle(ms_cus_sensor *handle); +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +//#define ABS(a) ((a)>(0) ? (a) : (-(a))) +static int g_sensor_ae_min_gain = 1024; +#define ENABLE_NR 1 + +CUS_MCLK_FREQ UseParaMclk(void); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 line; + } expo; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool reg_mf; + bool reg_dirty; + bool nr_dirty; + CUS_CAMSENSOR_ORIT cur_orien; +} sc2239_params; +// set sensor ID address and data, + +typedef struct { + u64 gain; + u8 fine_gain_reg; +} FINE_GAIN; + +I2C_ARRAY Sensor_id_table[] = +{ + {0x3107, 0xCB}, + {0x3108, 0x10}, +}; + +I2C_ARRAY Sensor_init_table[] = +{ + //ipc_0x21_SC2239_MIPI_27Minput_1lane_10bit_742.5Mbps_1920x1080_30fps_non_continue + {0x0103,0x01}, //disable reset, just for 0x60&0x64 case + {0x0100,0x00}, + {0x36e9,0x80}, + {0x36f9,0x80}, + {0x301f,0x21}, + {0x3038,0x44}, + {0x3253,0x12}, + {0x3301,0x04}, + {0x3304,0xa8}, + {0x3306,0x44}, + {0x3308,0x10}, + {0x3309,0x48}, + {0x330a,0x01}, + {0x330b,0x40}, + {0x331e,0xa1}, + {0x331f,0x41}, + {0x3333,0x10}, + {0x3364,0x17}, + {0x3390,0x08}, + {0x3391,0x18}, + {0x3392,0x38}, + {0x3393,0x08}, + {0x3394,0x0d}, + {0x3395,0x70}, + {0x33af,0x20}, + {0x360f,0x01}, + {0x3630,0x00}, + {0x3634,0x64}, + {0x3637,0x10}, + {0x363c,0x05}, + {0x3670,0x0c}, + {0x3671,0xc2}, + {0x3672,0x02}, + {0x3673,0x02}, + {0x3677,0x84}, + {0x3678,0x84}, + {0x3679,0x8e}, + {0x367a,0x18}, + {0x367b,0x38}, + {0x367e,0x08}, + {0x367f,0x38}, + {0x3690,0x74}, + {0x3691,0x64}, + {0x3692,0x64}, + {0x369c,0x08}, + {0x369d,0x18}, + {0x3904,0x08}, + {0x3908,0x82}, + {0x3933,0x82}, + {0x3934,0x1b}, + {0x3940,0x77}, + {0x3941,0x18}, + {0x3942,0x02}, + {0x3943,0x1c}, + {0x3944,0x0b}, + {0x3945,0x80}, + {0x3e01,0x8c}, + {0x3e02,0x20}, + {0x4509,0x20}, + {0x4800,0x64}, + {0x4819,0x09}, + {0x481b,0x05}, + {0x481d,0x14}, + {0x4821,0x0a}, + {0x4823,0x05}, + {0x5000,0x06}, + {0x5780,0x7f}, + {0x5781,0x04}, + {0x5782,0x03}, + {0x5783,0x02}, + {0x5784,0x01}, + {0x5785,0x18}, + {0x5786,0x10}, + {0x5787,0x08}, + {0x5788,0x02}, + {0x5789,0x20}, + {0x578a,0x7f}, + {0x36e9,0x20}, + {0x36f9,0x27}, + {0x0100,0x01}, + {0xffff,0x10}, //mdelay(10), +}; + +I2C_ARRAY mirror_reg[] = { + {0x3221, 0x00}, // mirror[2:1], flip[6:5] +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +static I2C_ARRAY gain_reg[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80},//[7:0] + {0x3e08, 0x00|0x03}, + {0x3e09, 0x20}, //low bit, 0x20 - 0x3f, step 1/32 +}; + +I2C_ARRAY expo_reg[] = { + {0x3e00, 0x00}, //expo [20:17] + {0x3e01, 0x02}, // expo[15:8] + {0x3e02, 0x00}, // expo[7:0], [3:0] fraction of line +}; + +I2C_ARRAY vts_reg[] = { + {0x320e, 0x04}, + {0x320f, 0x65}, +}; + +#if ENABLE_NR +I2C_ARRAY nr_reg[] = { + {0x3634,0x64}, + {0x3306,0x44}, + {0x3301,0x05}, +}; +#endif +I2C_ARRAY PatternTbl[] = { + {0x4501,0xc8}, //testpattern , bit 3 to enable +}; + +CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +/* +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME sc2239 +*/ + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +//int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY);////pwd low + sensor_if->Reset(idx, handle->reset_POLARITY); + CamOsMsSleep(1); + //Sensor power on sequence + sensor_if->MCLK(idx, 1, handle->mclk); + + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + //sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + //sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + //sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + CamOsMsSleep(2); + sensor_if->Reset(idx, !handle->reset_POLARITY); + CamOsMsSleep(1); + + SENSOR_DMSG("[%s] pwd high\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->reset_POLARITY); + CamOsMsSleep(5); + + //sensor_if->Set3ATaskOrder(handle, def_order); + // pure power on + //ISP_config_io(handle); + // sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + // CamOsMsSleep(5); + //handle->i2c_bus->i2c_open(handle->i2c_bus,&handle->i2c_cfg); + + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sc2239_params *params = (sc2239_params *)handle->private_data; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + CamOsMsSleep(1); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + sensor_if->MCLK(idx, 0, handle->mclk); + + params->cur_orien = CUS_ORIT_M0F0; + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(n=0;n8) table_length=8; + for(n=0; n<4; ++n) { //retry , until I2C success + if(n>2) return FAIL; + if(SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + CamOsMsSleep(1); + } + + for(i=0; i>= 8; + SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + return SUCCESS; +} + +static int sc2239_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + int i; + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + switch(mode) { + case 1: + PatternTbl[0].data = 0xc8; //enable + break; + case 0: + PatternTbl[0].data = 0xc0; //disable + break; + default: + PatternTbl[0].data = 0xc0; //disable + break; + } + for(i=0; i< ARRAY_SIZE(PatternTbl); i++) { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + return FAIL; + } + + return SUCCESS; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); +static int pCus_init(ms_cus_sensor *handle) +{ + sc2239_params *params = (sc2239_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + SensorReg_Write(0x3011,0x60); + SensorReg_Write(0x3004,0x60); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table);i++) + { + if(Sensor_init_table[i].reg==0x0100 && 0x01 == Sensor_init_table[i].data) + { + sensor_if->SetCSI_Clk(0, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(0, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(0, 0, 0x1C00, 0); + SENSOR_MSLEEP(50); + } + + if(Sensor_init_table[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table[i].reg, Sensor_init_table[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + + return SUCCESS; +} + +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = &handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: //"1920x1080@30fps" + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + char sen_data; + sen_data = mirror_reg[0].data; + SENSOR_DMSG("mirror:%x\r\n", sen_data); + switch(sen_data) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x06: + *orit = CUS_ORIT_M1F0; + break; + case 0x60: + *orit = CUS_ORIT_M0F1; + break; + case 0x66: + *orit = CUS_ORIT_M1F1; + break; + } + + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + sc2239_params *params = (sc2239_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + switch(orit) + { + case CUS_ORIT_M0F0: + mirror_reg[0].data = 0x00; + params->cur_orien = CUS_ORIT_M0F0; + params->reg_mf = true; + break; + case CUS_ORIT_M1F0: + mirror_reg[0].data = 0x06; + params->cur_orien = CUS_ORIT_M1F0; + params->reg_mf = true; + break; + case CUS_ORIT_M0F1: + mirror_reg[0].data = 0x60; + params->cur_orien = CUS_ORIT_M0F1; + params->reg_mf = true; + break; + case CUS_ORIT_M1F1: + mirror_reg[0].data = 0x66; + params->cur_orien = CUS_ORIT_M1F1; + params->reg_mf = true; + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + sc2239_params *params = (sc2239_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (vts_reg[0].data << 8) | (vts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts=0; + sc2239_params *params = (sc2239_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.line > 2*(params->expo.vts) -8){ + vts = (params->expo.line + 9)/2; + }else{ + vts = params->expo.vts; + } + + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + params->reg_dirty = true; + return SUCCESS; +} + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + sc2239_params *params = (sc2239_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + + break; + case CUS_FRAME_ACTIVE: + if(params->reg_mf) + { + SensorRegArrayW((I2C_ARRAY*)mirror_reg, sizeof(mirror_reg)/sizeof(I2C_ARRAY)); + params->reg_mf = false; + } + if(params->reg_dirty) + { + SensorRegArrayW((I2C_ARRAY*)expo_reg, sizeof(expo_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)gain_reg, sizeof(gain_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)vts_reg, sizeof(vts_reg)/sizeof(I2C_ARRAY)); + params->reg_dirty = false; + } +#if ENABLE_NR + if(params->nr_dirty) + { + SensorReg_Write(0x3812,0x00); + SensorRegArrayW((I2C_ARRAY*)nr_reg, sizeof(nr_reg)/sizeof(I2C_ARRAY)); + params->nr_dirty = false; + SensorReg_Write(0x3812,0x30); + } +#endif + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { + int rc=0; + u32 lines = 0; + lines |= (u32)(expo_reg[0].data&0x000f)<<16; + lines |= (u32)(expo_reg[1].data&0x00ff)<<8; + lines |= (u32)(expo_reg[2].data&0x00f0)<<0; + lines >>= 4; + *us = (lines*Preview_line_period)/1000/2; //return us + + SENSOR_DMSG("[%s] sensor expo lines/us %d, %dus\n", __FUNCTION__, lines, *us); + return rc; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + int i; + u32 half_lines = 0,vts = 0; + sc2239_params *params = (sc2239_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { // max expo line vts-4! + {0x3e00, 0x00},//expo [20:17] + {0x3e01, 0x00}, // expo[16:8] + {0x3e02, 0x10}, // expo[7:0], [3:0] fraction of line + }; + memcpy(expo_reg_temp, expo_reg, sizeof(expo_reg)); + + half_lines = (1000*us*2)/Preview_line_period; // Preview_line_period in ns + if(half_lines<2) half_lines=2; + if (half_lines > 2 * (params->expo.vts)-8) { + vts = (half_lines+9)/2; + } + else + vts=params->expo.vts; + params->expo.line = half_lines; + SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; +// printf("===================================================================\n"); +// printf("us = %d half_lines = %x params->expo.vts = %x\n",us, half_lines, params->expo.vts); +// printf("===================================================================\n"); + expo_reg[0].data = (half_lines>>16) & 0x0f; + expo_reg[1].data = (half_lines>>8) & 0xff; + expo_reg[2].data = (half_lines>>0) & 0xf0; + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + + for (i = 0; i < sizeof(expo_reg)/sizeof(I2C_ARRAY); i++) + { + if (expo_reg[i].data != expo_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + int rc = 0; + + return rc; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) { + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + sc2239_params *params = (sc2239_params *)handle->private_data; + int i = 0; + u8 Dgain_reg = 0, Cgain_reg = 0, Fine_again_reg= 0x20,Fine_dgain_reg= 0x80; + + I2C_ARRAY gain_reg_temp[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, + {0x3e08, (0x00|0x03)}, + {0x3e09, 0x20}, + }; + I2C_ARRAY nr_reg_temp[] ={ + {0x3634, 0x64}, + {0x3306, 0x44}, + {0x3301, 0x05}, + }; + memcpy(gain_reg_temp, gain_reg, sizeof(gain_reg)); + memcpy(nr_reg_temp, nr_reg, sizeof(nr_reg)); + + if (gain<1024){ + gain=1024; + }else if (gain>=SENSOR_MAXGAIN*1024){ + gain=SENSOR_MAXGAIN*1024; + } + + if (gain < 2 * 1024) + { + Cgain_reg = 0x03; Fine_again_reg = gain>>5; + Dgain_reg = 0; Fine_dgain_reg = (gain<<2)/Fine_again_reg; + } + else if (gain < 4 * 1024) + { + Cgain_reg = 0x07; Fine_again_reg = gain>>6; + Dgain_reg = 0; Fine_dgain_reg = (gain<<1)/Fine_again_reg; + } + else if (gain < 8 * 1024) + { + Cgain_reg = 0x0f; Fine_again_reg = gain>>7; + Dgain_reg = 0; Fine_dgain_reg = gain/Fine_again_reg; + } + else if (gain <= 16128) + { + Cgain_reg = 0x1f; Fine_again_reg = gain>>8; + Dgain_reg = 0; Fine_dgain_reg = (gain>>1)/Fine_again_reg; + } + else if (gain < 32256) + { + Cgain_reg = 0x1f; Fine_again_reg = 0x3f; + Dgain_reg = 0; Fine_dgain_reg = gain/126; + } + else if (gain < 63 * 1024) + { + Cgain_reg = 0x1f; Fine_again_reg = 0x3f; + Dgain_reg = 1; Fine_dgain_reg = gain/252; + } + else if (gain < 126 * 1024) + { + Cgain_reg = 0x1f; Fine_again_reg = 0x3f; + Dgain_reg = 3; Fine_dgain_reg = gain/504; + } + else if (gain < 252 * 1024) + { + Cgain_reg = 0x1f; Fine_again_reg = 0x3f; + Dgain_reg = 7; Fine_dgain_reg = gain/1008; + }else if (gain <= SENSOR_MAXGAIN * 1024) + { + Cgain_reg = 0x1f; Fine_again_reg = 0x3f; + Dgain_reg = 0x0f; Fine_dgain_reg = gain/2016; + } + + gain_reg[3].data = Fine_again_reg; + gain_reg[2].data = Cgain_reg; + gain_reg[1].data = Fine_dgain_reg; + gain_reg[0].data = Dgain_reg & 0x0f; + +#if ENABLE_NR + if (gain_reg_temp[2].data == 0x03 && gain_reg_temp[3].data <= 0x28) + { + nr_reg[0].data = 0x64; //0x05; + nr_reg[1].data = 0x44; + nr_reg[2].data = 0x04; + } else if (gain_reg_temp[2].data < 0x07) + { + nr_reg[0].data = 0x64; //0x05; + nr_reg[1].data = 0x68; + nr_reg[2].data = 0x05; + } else if (gain_reg_temp[2].data < 0x0f) + { + nr_reg[0].data = 0x64; //0x05; + nr_reg[1].data = 0x68; + nr_reg[2].data = 0x05; + } else if (gain_reg_temp[2].data < 0x1f) + { + nr_reg[0].data = 0x44; //0x05; + nr_reg[1].data = 0x68; + nr_reg[2].data = 0x05; + } else if (gain_reg_temp[2].data == 0x1f) + { + nr_reg[0].data = 0x24; //0x14; + nr_reg[1].data = 0x68; + nr_reg[2].data = 0x05; + } + + #if 1 + /* Each frame refresh to avoid the red flash when linear and wide dynamic switching */ + for (i = 0; i < sizeof(nr_reg)/sizeof(I2C_ARRAY); i++) + { + if (nr_reg[i].data != nr_reg_temp[i].data) + { + params->nr_dirty = true; + break; + } + } + #endif +#endif + + for (i = 0; i < sizeof(gain_reg)/sizeof(I2C_ARRAY); i++) + { + if (gain_reg[i].data != gain_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1; + *max = 1000000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1024; + *max = SENSOR_MAXGAIN*1024; + return SUCCESS; +} + +static int sc2239_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period; + info->step = Preview_line_period/2; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + sc2239_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (sc2239_params *)handle->private_data; + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + strcpy(handle->model_id,"sc2239_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 1920; + handle->video_res_supported.res[0].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps"); + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = sc2239_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = sc2239_GetShutterInfo; + params->expo.vts=vts_30fps; + params->expo.fps = 30; + params->expo.line= 1000; + params->reg_dirty = false; + params->reg_mf = false; + params->nr_dirty = false; + return SUCCESS; +} + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( SC2239, + cus_camsensor_init_handle_linear, + NULL, + NULL, + sc2239_params + ); \ No newline at end of file diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2335_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2335_mipi.c new file mode 100644 index 00000000..8cff6d94 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc2335_mipi.c @@ -0,0 +1,1107 @@ +/* SigmaStar trade secret */ +/* Copyright (c) [2019~2020] SigmaStar Technology. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained + herein regardless in any format shall remain the sole proprietary of + SigmaStar and be kept in strict confidence + (SigmaStar Confidential Information) by the recipient. + Any unauthorized act including without limitation unauthorized disclosure, + copying, use, reproduction, sale, distribution, modification, disassembling, + reverse engineering and compiling of the contents of SigmaStar Confidential + Information is unlawful and strictly prohibited. SigmaStar hereby reserves the + rights to any and all damages, losses, costs and expenses resulting therefrom. + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(SC2335); + +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +//#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (2) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 +#define SENSOR_BAYERID CUS_BAYER_BG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAXGAIN (15875*31)/1000 // (15.5*31) max sensor gain, a-gain*conversion-gain*d-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +//#define Preview_line_period 30000 ////HTS/PCLK=4455 pixels/148.5MHZ=30usec @MCLK=36MHz +//#define vts_30fps 1125//1346,1616 //for 29.1fps @ MCLK=36MHz +//#define Line_per_second 32727 +//#define vts_30fps +#define Preview_line_period 29630 //1/30/1500 +#define vts_30fps 1125 //for 30 fps + +#define Preview_WIDTH 1920 //resolution Width when preview +#define Preview_HEIGHT 1080 //resolution Height when preview +#define Preview_MAX_FPS 30 //25 //fastest preview FPS +#define Preview_MIN_FPS 3 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x60 //I2C slave address +#define SENSOR_I2C_SPEED 240000 //I2C speed,60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_POS // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG +#define ENABLE_NR 1 + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static int g_sensor_ae_min_gain = 1024; + +CUS_MCLK_FREQ UseParaMclk(void); + +typedef struct { + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 half_lines; + u32 half_line; + u32 fps; + u32 preview_fps; + u32 line; + } expo; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool reg_mf; + bool reg_dirty; + bool nr_dirty; + bool temperature_reg_1_dirty; +// bool temperature_reg_2_dirty; + CUS_CAMSENSOR_ORIT cur_orien; +} sc2335_params; +// set sensor ID address and data, + +typedef struct { + u64 gain; + u8 fine_gain_reg; +} FINE_GAIN; + +I2C_ARRAY Sensor_id_table[] = { + {0x3107, 0xCB}, + {0x3108, 0x14}, // 0x07 +}; + +I2C_ARRAY Sensor_init_table_2M30fps[] = { + // printf("===SC2335_mipi_lane2_bit10_1080P_30fps_20200309\n"); + {0x0103,0x01}, + {0xffff,0x50}, + {0x0100,0x00}, + {0x36e9,0x80}, + {0x36f9,0x80}, + {0x301f,0x02}, + {0x3207,0x3f}, + {0x3249,0x0f}, + {0x3253,0x08}, + {0x3271,0x00}, + {0x3273,0x03}, + {0x3301,0x06}, + {0x3302,0x09}, + {0x3304,0x28}, + {0x3306,0x30}, + {0x330b,0x94}, + {0x330c,0x08}, + {0x330d,0x18}, + {0x330e,0x14}, + {0x330f,0x05}, + {0x3310,0x06}, + {0x3314,0x96}, + {0x3316,0x00}, + {0x331e,0x21}, + {0x332b,0x08}, + {0x3333,0x10}, + {0x3338,0x80}, + {0x333a,0x04}, + {0x334c,0x04}, + {0x335f,0x04}, + {0x3364,0x17}, + {0x3366,0x62}, + {0x337c,0x05}, + {0x337d,0x09}, + {0x337e,0x00}, + {0x3390,0x08}, + {0x3391,0x18}, + {0x3392,0x38}, + {0x3393,0x09}, + {0x3394,0x20}, + {0x3395,0x20}, + {0x33a2,0x07}, + {0x33ac,0x04}, + {0x33ae,0x14}, + {0x3614,0x00}, + {0x3622,0x16}, + {0x3630,0x68}, + {0x3631,0x84}, + {0x3637,0x20}, + {0x363a,0x1f}, + {0x363c,0x0e}, + {0x3670,0x0e}, + {0x3674,0xa1}, + {0x3675,0x9c}, + {0x3676,0x9e}, + {0x3677,0x84}, + {0x3678,0x85}, + {0x3679,0x87}, + {0x367c,0x18}, + {0x367d,0x38}, + {0x367e,0x08}, + {0x367f,0x18}, + {0x3690,0x32}, + {0x3691,0x32}, + {0x3692,0x44}, + {0x369c,0x08}, + {0x369d,0x38}, + {0x3908,0x82}, + {0x391f,0x18}, + {0x3e01,0x8c}, + {0x3e02,0x00}, + {0x3f00,0x0d}, + {0x3f04,0x02}, + {0x3f05,0x0e}, + {0x3f09,0x48}, + {0x4505,0x0a}, + {0x4509,0x20}, + {0x481d,0x0a}, + {0x4827,0x03}, + {0x5787,0x10}, + {0x5788,0x06}, + {0x578a,0x10}, + {0x578b,0x06}, + {0x5790,0x10}, + {0x5791,0x10}, + {0x5792,0x00}, + {0x5793,0x10}, + {0x5794,0x10}, + {0x5795,0x00}, + {0x5799,0x00}, + {0x57c7,0x10}, + {0x57c8,0x06}, + {0x57ca,0x10}, + {0x57cb,0x06}, + {0x57d1,0x10}, + {0x57d4,0x10}, + {0x57d9,0x00}, + {0x36e9,0x20},// pll + {0x36f9,0x27}, + {0x0100,0x01}, + {0xffff,0x50}, +}; + +I2C_ARRAY mirror_reg[] = { + {0x3221, 0x00}, // mirror[2:1], flip[6:5] +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +static I2C_ARRAY gain_reg[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, // 128 + {0x3e08, 0x03}, + {0x3e09, 0x40}, // 64 +}; + +I2C_ARRAY expo_reg[] = { + {0x3e00, 0x00}, //expo [20:17] + {0x3e01, 0x02}, // expo[15:8] + {0x3e02, 0x00}, // expo[7:0], [3:0] fraction of line +}; + +I2C_ARRAY vts_reg[] = { + {0x320e, 0x04}, + {0x320f, 0x65}, +}; + +#if ENABLE_NR +I2C_ARRAY nr_reg[] = { + {0x363c, 0x0e}, +}; +#endif + +I2C_ARRAY temperature_reg_1[] = { + {0x5799, 0x07}, +}; + +I2C_ARRAY PatternTbl[] = { + {0x4501,0xb4}, //testpattern , bit 3 to enable +}; + +#if 0 +CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME ov2710 + + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus,&(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus,&(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY);////pwd low + sensor_if->Reset(idx, handle->reset_POLARITY); + CamOsMsSleep(1); + //Sensor power on sequence + sensor_if->MCLK(idx, 1, handle->mclk); + + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + //sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + //sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + //sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + CamOsMsSleep(2); + sensor_if->Reset(idx, !handle->reset_POLARITY); + CamOsMsSleep(1); + + SENSOR_DMSG("[%s] pwd high\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->reset_POLARITY); + CamOsMsSleep(2); + + //sensor_if->Set3ATaskOrder(handle, def_order); + // pure power on + //ISP_config_io(handle); + // sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + // CamOsMsSleep(5); + //handle->i2c_bus->i2c_open(handle->i2c_bus,&handle->i2c_cfg); + + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sc2335_params *params = (sc2335_params *)handle->private_data; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + CamOsMsSleep(1); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + sensor_if->MCLK(idx, 0, handle->mclk); + + params->cur_orien = CUS_ORIT_M0F0; + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + //printk("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + for(n=0;n8) table_length=8; + for(n=0; n<4; ++n) { //retry , until I2C success + if(n>2) return FAIL; + if(SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + CamOsMsSleep(1); + } + + for(i=0; i>= 8; + SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + //printk("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + + return SUCCESS; +} + +static int sc2335_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + int i; + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + switch(mode) { + case 1: + PatternTbl[0].data = 0xbc; //enable + break; + case 0: + PatternTbl[0].data = 0xb4; //disable + break; + default: + PatternTbl[0].data = 0xb4; //disable + break; + } + for(i=0; i< ARRAY_SIZE(PatternTbl); i++) { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + return FAIL; + } + + return SUCCESS; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); + +static u16 reg3040; + +static int pCus_init(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sc2335_params *params = (sc2335_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + + //logic + SensorReg_Read(0x3040, ®3040); + + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_2M30fps);i++) + { + if(Sensor_init_table_2M30fps[i].reg==0x0100 && 0x01 == Sensor_init_table_2M30fps[i].data) + { + //platform dependent + SensorReg_Write(0x3802, 0x00); //sync + sensor_if->SetCSI_Clk(0, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(0, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(0, 0, 0x1C00, 0); + SENSOR_MSLEEP(50); + } + + if(Sensor_init_table_2M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_2M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_2M30fps[i].reg, Sensor_init_table_2M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + if(reg3040 == 0x40) { + SensorReg_Write(0x363c, 0x0e); + } else { + SensorReg_Write(0x363c, 0x0f); + } + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = &handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: //"1920x1080@30fps" + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + char sen_data; + sen_data = mirror_reg[0].data; + SENSOR_DMSG("mirror:%x\r\n", sen_data); + switch(sen_data & 0x66) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x06: + *orit = CUS_ORIT_M1F0; + break; + case 0x60: + *orit = CUS_ORIT_M0F1; + break; + case 0x66: + *orit = CUS_ORIT_M1F1; + break; + } + + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + sc2335_params *params = (sc2335_params *)handle->private_data; + // pr_info("Connect %s table_length %d\n",__FUNCTION__, table_length); + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + switch(orit) + { + case CUS_ORIT_M0F0: + mirror_reg[0].data = 0x00; + params->cur_orien = CUS_ORIT_M0F0; + params->reg_mf = true; + break; + case CUS_ORIT_M1F0: + mirror_reg[0].data = 0x06; + params->cur_orien = CUS_ORIT_M1F0; + params->reg_mf = true; + break; + case CUS_ORIT_M0F1: + mirror_reg[0].data = 0x60; + params->cur_orien = CUS_ORIT_M0F1; + params->reg_mf = true; + break; + case CUS_ORIT_M1F1: + mirror_reg[0].data = 0x66; + params->cur_orien = CUS_ORIT_M1F1; + params->reg_mf = true; + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + sc2335_params *params = (sc2335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (vts_reg[0].data << 8) | (vts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts=0; + sc2335_params *params = (sc2335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.line > 2* (params->expo.vts) -10){ + vts = (params->expo.line + 11)/2; + }else{ + vts = params->expo.vts; + } + + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + params->reg_dirty = true; + return SUCCESS; +} + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + sc2335_params *params = (sc2335_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->reg_mf) { + SensorRegArrayW((I2C_ARRAY*)mirror_reg, sizeof(mirror_reg)/sizeof(I2C_ARRAY)); + params->reg_mf = false; + } + if(params->reg_dirty) { + SensorRegArrayW((I2C_ARRAY*)expo_reg, sizeof(expo_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)gain_reg, sizeof(gain_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)vts_reg, sizeof(vts_reg)/sizeof(I2C_ARRAY)); + params->reg_dirty = false; + } +#if ENABLE_NR + + if(params->nr_dirty || params->temperature_reg_1_dirty) { + SensorReg_Write(0x3812,0x00); + if(params->nr_dirty) { + SensorRegArrayW((I2C_ARRAY*)nr_reg, sizeof(nr_reg)/sizeof(I2C_ARRAY)); + params->nr_dirty = false; + } + if(params->temperature_reg_1_dirty) { + SensorRegArrayW((I2C_ARRAY*)temperature_reg_1, sizeof(temperature_reg_1)/sizeof(I2C_ARRAY)); + params->temperature_reg_1_dirty = false; + } + SensorReg_Write(0x3812,0x30); + } +#endif + + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { + int rc=0; + u32 lines = 0; + lines |= (u32)(expo_reg[0].data&0x000f)<<16; + lines |= (u32)(expo_reg[1].data&0x00ff)<<8; + lines |= (u32)(expo_reg[2].data&0x00f0)<<0; + lines >>= 4; + *us = (lines*Preview_line_period)/1000/2; //return us + + SENSOR_DMSG("[%s] sensor expo lines/us %d, %dus\n", __FUNCTION__, lines, *us); + return rc; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + int i; + u32 half_lines = 0,vts = 0; + sc2335_params *params = (sc2335_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { // max expo line vts-4! + {0x3e00, 0x00},//expo [20:17] + {0x3e01, 0x00}, // expo[16:8] + {0x3e02, 0x10}, // expo[7:0], [3:0] fraction of line + }; + memcpy(expo_reg_temp, expo_reg, sizeof(expo_reg)); + + half_lines = (1000*us*2)/Preview_line_period; // Preview_line_period in ns + if(half_lines<2) + half_lines=2; + if (half_lines > 2 * (params->expo.vts) - 10) { + vts = (half_lines+11)/2; + } + else + vts= params->expo.vts; + + params->expo.line = half_lines; + SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; + // printk("us = %d half_lines = %x params->expo.vts = %x\n",us, half_lines, params->expo.vts); + expo_reg[0].data = (half_lines>>16) & 0x0f; + expo_reg[1].data = (half_lines>>8) & 0xff; + expo_reg[2].data = (half_lines>>0) & 0xf0; + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + + for (i = 0; i < sizeof(expo_reg)/sizeof(I2C_ARRAY); i++) { + if (expo_reg[i].data != expo_reg_temp[i].data) { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + int rc = 0; + + return rc; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) { + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + sc2335_params *params = (sc2335_params *)handle->private_data; + u8 i=0 ,Dgain = 1, Ana_gain = 1; + u64 Fine_againx64 = 64,Fine_dgainx128 = 128; + u8 Dgain_reg = 0, Ana_gain_reg = 0, Fine_again_reg= 0x40,Fine_dgain_reg= 0x80; + + I2C_ARRAY gain_reg_temp[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, + {0x3e08, 0x03}, + {0x3e09, 0x40}, + }; + I2C_ARRAY nr_reg_temp[] ={ + {0x363c, 0x0e}, + }; + I2C_ARRAY temperature_reg_1_temp[] ={ + {0x5799, 0x07}, + }; + + memcpy(gain_reg_temp, gain_reg, sizeof(gain_reg)); + memcpy(nr_reg_temp, nr_reg, sizeof(nr_reg)); + memcpy(temperature_reg_1_temp, temperature_reg_1, sizeof(temperature_reg_1)); + + if (gain<1024){ + gain=1024; + }else if (gain>=SENSOR_MAXGAIN*1024){ + gain=SENSOR_MAXGAIN*1024; + } + + if (gain < 2 * 1024) { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 1; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x03; + } else if (gain < 4 * 1024) { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 2; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x07; + } else if (gain < 8 * 1024) { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 4; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x0f; + } else if (gain <= 16256) { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 8; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x1f; + } else if (gain < 32512) { + Dgain = 1; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x00; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } else if (gain < 65024) { + Dgain = 2; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x01; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } else if (gain < 127 * 1024) { + Dgain = 4; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x03; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } else if (gain < 254 * 1024) { + Dgain = 8; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x07; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } else if (gain <= SENSOR_MAXGAIN * 1024) { + Dgain = 16; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x0f; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + + if (gain <= 16256) { + Fine_againx64 = abs(8 * gain/ (Dgain * Ana_gain * Fine_dgainx128)); + //Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_again_reg = Fine_againx64; + //Fine_dgain_reg = Fine_dgainx128; + } else { + Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_dgain_reg = Fine_dgainx128; + } + + gain_reg[3].data = Fine_again_reg; + gain_reg[2].data = Ana_gain_reg; + gain_reg[1].data = Fine_dgain_reg; + gain_reg[0].data = Dgain_reg & 0x0f; + + for (i = 0; i < sizeof(gain_reg)/sizeof(I2C_ARRAY); i++) { + if (gain_reg[i].data != gain_reg_temp[i].data) { + params->reg_dirty = true; + break; + } + } + +#if ENABLE_NR + if(reg3040 == 0x40) { + if (gain_reg_temp[2].data < 0x07) { // delay 1 frame group, group & exp & gain active at the same time + nr_reg[0].data = 0x0e; + } else { + nr_reg[0].data = 0x07; + } + } else if(reg3040 == 0x41) { + if (gain_reg_temp[2].data < 0x07) { + nr_reg[0].data = 0x0f; + } else { + nr_reg[0].data = 0x07; + } + } else { + nr_reg[0].data = 0x07; + } + + /* Each frame refresh to avoid the red flash when linear and wide dynamic switching */ + for (i = 0; i < sizeof(nr_reg)/sizeof(I2C_ARRAY); i++) { + if (nr_reg[i].data != nr_reg_temp[i].data) { + params->nr_dirty = true; + break; + } + } +#endif + + if (gain >= 16256) + temperature_reg_1[0].data = 0x07; + else if (gain <= 10240) + temperature_reg_1[0].data = 0x00; + + for (i = 0; i < sizeof(temperature_reg_1)/sizeof(I2C_ARRAY); i++) { + if (temperature_reg_1[i].data != temperature_reg_1_temp[i].data) { + params->temperature_reg_1_dirty = true; + break; + } + } + + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1; + *max = 1000000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1024; + *max = SENSOR_MAXGAIN*1024; + return SUCCESS; +} + +static int sc2335_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period;// * 3; + info->step = Preview_line_period/2; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + sc2335_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (sc2335_params *)handle->private_data; + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + strcpy(handle->model_id,"sc2335_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 1920; + handle->video_res_supported.res[0].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[0].strResDesc, "1920x1080@30fps"); + + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = sc2335_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = sc2335_GetShutterInfo; + params->expo.vts=vts_30fps; + params->expo.fps = 30; + params->expo.line= 1000; + params->reg_dirty = false; + params->reg_mf = false; + params->nr_dirty = false; + return SUCCESS; +} + +int cus_camsensor_release_handle(ms_cus_sensor *handle) { + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( SC2335, + cus_camsensor_init_handle_linear, + NULL, + NULL, + sc2335_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc3335_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc3335_mipi.c new file mode 100644 index 00000000..71cc8cc2 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6b0/sensor/sensor_sc3335_mipi.c @@ -0,0 +1,1118 @@ +/* SigmaStar trade secret */ +/* Copyright (c) [2019~2020] SigmaStar Technology. +All rights reserved. + +Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +SigmaStar and be kept in strict confidence +(SigmaStar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of SigmaStar Confidential +Information is unlawful and strictly prohibited. SigmaStar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(SC3335); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (2) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 +#define SENSOR_BAYERID CUS_BAYER_BG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAXGAIN (15875*31875)/1000000 //max sensor gain, a-gain*conversion-gain*d-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +//#define Preview_line_period 30000 ////HTS/PCLK=4455 pixels/148.5MHZ=30usec @MCLK=36MHz +//#define vts_30fps 1125//1346,1616 //for 29.1fps @ MCLK=36MHz +//#define Line_per_second 32727 +//#define vts_30fps +u32 Preview_line_period; +u32 vts_30fps; +#define Preview_WIDTH 2304 //resolution Width when preview +#define Preview_HEIGHT 1296 //resolution Height when preview +#define Preview_MAX_FPS 30 //25 //fastest preview FPS +#define Preview_MIN_FPS 5 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x60 //I2C slave address +#define SENSOR_I2C_SPEED 240000 //I2C speed,60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_POS // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif +static int cus_camsensor_release_handle(ms_cus_sensor *handle); +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +//#define ABS(a) ((a)>(0) ? (a) : (-(a))) +static int g_sensor_ae_min_gain = 1024; +#define ENABLE_NR 1 + +CUS_MCLK_FREQ UseParaMclk(void); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + u32 sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 line; + } expo; + struct { + bool bVideoMode; + u16 res_idx; + CUS_CAMSENSOR_ORIT orit; + } res; + I2C_ARRAY tVts_reg[2]; + I2C_ARRAY tGain_reg[4]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tMirror_reg[1]; + I2C_ARRAY tNr_reg[3]; + int sen_init; + int still_min_fps; + int video_min_fps; + bool orient_dirty; + bool reg_dirty; + bool nr_dirty; + CUS_CAMSENSOR_ORIT cur_orien; +} sc3335_params; +// set sensor ID address and data, + +typedef struct { + u64 gain; + u8 fine_gain_reg; +} FINE_GAIN; + +const I2C_ARRAY Sensor_id_table[] = +{ + {0x3107, 0xcc}, + {0x3108, 0x1a}, +}; + +const I2C_ARRAY Sensor_init_table_3M30fps[] = +{ + {0x0103,0x01}, + {0x0100,0x00}, + {0x36e9,0x80}, + {0x36f9,0x80}, + {0x301f,0x01}, + {0x3253,0x04}, + {0x3301,0x04}, + {0x3302,0x10}, + {0x3304,0x40}, + {0x3306,0x40}, + {0x3309,0x50}, + {0x330b,0xb6}, + {0x330e,0x29}, + {0x3310,0x06}, + {0x3314,0x96}, + {0x331e,0x39}, + {0x331f,0x49}, + {0x3320,0x09}, + {0x3333,0x10}, + {0x334c,0x01}, + {0x3364,0x17}, + {0x3367,0x01}, + {0x3390,0x04}, + {0x3391,0x08}, + {0x3392,0x38}, + {0x3393,0x05}, + {0x3394,0x09}, + {0x3395,0x16}, + {0x33ac,0x0c}, + {0x33ae,0x1c}, + {0x3622,0x16}, + {0x3637,0x22}, + {0x363a,0x1f}, + {0x363c,0x05}, + {0x3670,0x0e}, + {0x3674,0xb0}, + {0x3675,0x88}, + {0x3676,0x68}, + {0x3677,0x84}, + {0x3678,0x85}, + {0x3679,0x86}, + {0x367c,0x18}, + {0x367d,0x38}, + {0x367e,0x08}, + {0x367f,0x18}, + {0x3690,0x43}, + {0x3691,0x43}, + {0x3692,0x44}, + {0x369c,0x18}, + {0x369d,0x38}, + {0x36ea,0x3b}, + {0x36eb,0x0d}, + {0x36ec,0x1c}, + {0x36ed,0x24}, + {0x36fa,0x3b}, + {0x36fb,0x00}, + {0x36fc,0x10}, + {0x36fd,0x24}, + {0x3908,0x82}, + {0x391f,0x18}, + {0x3e01,0xa8}, + {0x3e02,0x20}, + {0x3f09,0x48}, + {0x4505,0x08}, + {0x4509,0x20}, + {0x5799,0x00}, + {0x59e0,0x60}, + {0x59e1,0x08}, + {0x59e2,0x3f}, + {0x59e3,0x18}, + {0x59e4,0x18}, + {0x59e5,0x3f}, + {0x59e6,0x06}, + {0x59e7,0x02}, + {0x59e8,0x38}, + {0x59e9,0x10}, + {0x59ea,0x0c}, + {0x59eb,0x10}, + {0x59ec,0x04}, + {0x59ed,0x02}, + {0x36e9,0x23}, + {0x36f9,0x23}, + {0x0100,0x01}, + {0xffff,0x0a}, +}; + +I2C_ARRAY mirror_reg[] = { + {0x3221, 0x00}, // mirror[2:1], flip[6:5] +}; + + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +static I2C_ARRAY gain_reg[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, + {0x3e08, 0x00|0x03}, + {0x3e09, 0x40}, //low bit, 0x40 - 0x7f, step 1/64 +}; + +I2C_ARRAY expo_reg[] = { + {0x3e00, 0x00}, //expo [20:17] + {0x3e01, 0x30}, // expo[16:8] + {0x3e02, 0x00}, // expo[7:0], [3:0] fraction of line +}; + +I2C_ARRAY vts_reg[] = { + {0x320e, 0x05}, + {0x320f, 0x46}, +}; + +#if ENABLE_NR +I2C_ARRAY nr_reg[] = { +{0x363c,0x05}, +{0x330e,0x29}, +{0x5799,0x07}, +}; +#endif + +I2C_ARRAY PatternTbl[] = { + {0x4501,0xc8}, //testpattern , bit 3 to enable +}; + +CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +/* +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME sc3335 +*/ +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +//int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY);////pwd low + sensor_if->Reset(idx, handle->reset_POLARITY); + SENSOR_USLEEP(1000); + //Sensor power on sequence + sensor_if->MCLK(idx, 1, handle->mclk); + + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + //sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + //sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + //sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + SENSOR_USLEEP(2000); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_USLEEP(1000); + + SENSOR_DMSG("[%s] pwd high\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->reset_POLARITY); + SENSOR_USLEEP(2000); + + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sc3335_params *params = (sc3335_params *)handle->private_data; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + SENSOR_USLEEP(1000); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + sensor_if->MCLK(idx, 0, handle->mclk); + + params->cur_orien = CUS_ORIT_M0F0; + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(n=0;n8) table_length=8; + for(n=0; n<4; ++n) { //retry , until I2C success + if(n>2) return FAIL; + if(SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_USLEEP(1000); + } + + for(i=0; i>= 8; + SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + return SUCCESS; +} + +static int sc3335_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + int i; + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + switch(mode) { + case 1: + PatternTbl[0].data = 0xc8; //enable + break; + case 0: + PatternTbl[0].data = 0xc0; //disable + break; + default: + PatternTbl[0].data = 0xc0; //disable + break; + } + for(i=0; i< ARRAY_SIZE(PatternTbl); i++) { + if(SensorReg_Write(PatternTbl[i].reg,PatternTbl[i].data) != SUCCESS) + return FAIL; + } + + return SUCCESS; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); +static int pCus_init_linear_3M30fps(ms_cus_sensor *handle) +{ + sc3335_params *params = (sc3335_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_3M30fps);i++) + { + if(Sensor_init_table_3M30fps[i].reg==0x0100 && 0x01 == Sensor_init_table_3M30fps[i].data) + { + sensor_if->SetCSI_Clk(0, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(0, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(0, 0, 0x1C00, 0); + SENSOR_MSLEEP(50); + } + + if(Sensor_init_table_3M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_3M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_3M30fps[i].reg, Sensor_init_table_3M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + params->tVts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + params->tVts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + return SUCCESS; +} + +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + sc3335_params *params = (sc3335_params *)handle->private_data; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: //"2304x1296@30fps" + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_linear_3M30fps; + vts_30fps=1350;//1500 + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 24691; + break; + + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + char sen_data; + sc3335_params *params = (sc3335_params *)handle->private_data; + sen_data = params->tMirror_reg[0].data; + SENSOR_DMSG("[%s] mirror:%x\r\n", __FUNCTION__, sen_data & 0x66); + switch(sen_data & 0x66) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x06: + *orit = CUS_ORIT_M1F0; + break; + case 0x60: + *orit = CUS_ORIT_M0F1; + break; + case 0x66: + *orit = CUS_ORIT_M1F1; + break; + } + + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + + sc3335_params *params = (sc3335_params *)handle->private_data; + + switch(orit) { + case CUS_ORIT_M0F0: + { + params->tMirror_reg[0].data = 0; + //params->tMirror_reg[1].data = 8; + params->orient_dirty = true; + } + break; + case CUS_ORIT_M1F0: + { + params->tMirror_reg[0].data = 6; + //params->tMirror_reg[1].data = 8; + params->orient_dirty = true; + } + break; + case CUS_ORIT_M0F1: + { + params->tMirror_reg[0].data = 0x60; + //params->tMirror_reg[1].data = 8; + params->orient_dirty = true; + } + break; + case CUS_ORIT_M1F1: + { + params->tMirror_reg[0].data = 0x66; + //params->tMirror_reg[1].data = 8; + params->orient_dirty = true; + } + break; +} + + SENSOR_DMSG("pCus_SetOrien:%x\r\n", orit); + + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + sc3335_params *params = (sc3335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 8) | (params->tVts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts=0; + sc3335_params *params = (sc3335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.line > 2 * (params->expo.vts) -8){ + vts = (params->expo.line + 9)/2; + }else{ + vts = params->expo.vts; + } + params->tVts_reg[0].data = (vts >> 8) & 0x00ff; + params->tVts_reg[1].data = (vts >> 0) & 0x00ff; + params->reg_dirty = true; + return SUCCESS; +} + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + sc3335_params *params = (sc3335_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->orient_dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tMirror_reg, sizeof(mirror_reg)/sizeof(I2C_ARRAY)); + params->orient_dirty = false; + } + if(params->reg_dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, sizeof(expo_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, sizeof(gain_reg)/sizeof(I2C_ARRAY)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, sizeof(vts_reg)/sizeof(I2C_ARRAY)); + params->reg_dirty = false; + } +#if ENABLE_NR + if(params->nr_dirty) + { + SensorReg_Write(0x3812,0x00); + if(params->nr_dirty) + { + SensorRegArrayW((I2C_ARRAY*)params->tNr_reg, sizeof(nr_reg)/sizeof(I2C_ARRAY)); + params->nr_dirty = false; + //printk("nr_reg update --------------------- \n"); + } + SensorReg_Write(0x3812,0x30); + + } +#endif + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { + int rc=0; + u32 lines = 0; + sc3335_params *params = (sc3335_params *)handle->private_data; + lines |= (u32)(params->tExpo_reg[0].data&0x0f)<<16; + lines |= (u32)(params->tExpo_reg[1].data&0xff)<<8; + lines |= (u32)(params->tExpo_reg[2].data&0xf0)<<0; + lines >>= 4; + *us = (lines*Preview_line_period)/1000/2; //return us + + SENSOR_DMSG("[%s] sensor expo lines/us %d, %dus\n", __FUNCTION__, lines, *us); + return rc; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + int i; + u32 half_lines = 0,vts = 0; + sc3335_params *params = (sc3335_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { // max expo line vts-4! + {0x3e00, 0x00},//expo [20:17] + {0x3e01, 0x00}, // expo[16:8] + {0x3e02, 0x10}, // expo[7:0], [3:0] fraction of line + }; + memcpy(expo_reg_temp, params->tExpo_reg, sizeof(expo_reg)); + + half_lines = (1000*us*2)/Preview_line_period; // Preview_line_period in ns + if(half_lines<3) half_lines=3; + if (half_lines > 2 * (params->expo.vts)-8) { + vts = (half_lines+9)/2; + } + else + vts=params->expo.vts; + params->expo.line = half_lines; + SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; + params->tExpo_reg[0].data = (half_lines>>16) & 0x0f; + params->tExpo_reg[1].data = (half_lines>>8) & 0xff; + params->tExpo_reg[2].data = (half_lines>>0) & 0xf0; + params->tVts_reg[0].data = (vts >> 8) & 0x00ff; + params->tVts_reg[1].data = (vts >> 0) & 0x00ff; + + for (i = 0; i < sizeof(expo_reg)/sizeof(I2C_ARRAY); i++) + { + if (params->tExpo_reg[i].data != expo_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + int rc = 0; + + return rc; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) { + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + sc3335_params *params = (sc3335_params *)handle->private_data; + + u8 i=0 ,Dgain = 1, Coarse_gain = 1; + u32 Fine_againx64 = 64,Fine_dgainx128 = 128; + u8 Dgain_reg = 0, Coarse_gain_reg = 0, Fine_again_reg= 0x10,Fine_dgain_reg= 0x80; + + I2C_ARRAY gain_reg_temp[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, + {0x3e08, (0x00|0x03)}, + {0x3e09, 0x40}, + }; + I2C_ARRAY nr_reg_temp[] = { + {0x363c,0x05}, + {0x330e,0x29}, + {0x5799,0x07}, + }; + + memcpy(gain_reg_temp, params->tGain_reg, sizeof(gain_reg)); + memcpy(nr_reg_temp, params->tNr_reg, sizeof(nr_reg)); + + if (gain < 1024) { + gain = 1024; + } else if (gain > SENSOR_MAXGAIN*1024) { + gain = SENSOR_MAXGAIN*1024; + } + + if (gain < 2 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Coarse_gain = 1; + Dgain_reg = 0; Fine_dgain_reg = 0x80; Coarse_gain_reg = 0x3; + } + else if (gain < 4 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Coarse_gain = 2; + Dgain_reg = 0; Fine_dgain_reg = 0x80; Coarse_gain_reg = 0x7; + } + else if (gain < 8 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Coarse_gain = 4; + Dgain_reg = 0; Fine_dgain_reg = 0x80; Coarse_gain_reg = 0xf; + } + else if (gain <= 16256) + { + Dgain = 1; Fine_dgainx128 = 128; Coarse_gain = 8; + Dgain_reg = 0; Fine_dgain_reg = 0x80; Coarse_gain_reg = 0x1f; + } + else if (gain < 32512) + { + Dgain = 1; Fine_againx64 = 127; Coarse_gain = 8; + Dgain_reg = 0; Fine_again_reg = 0x7f; Coarse_gain_reg = 0x1f; + } + else if (gain < 65024) + { + Dgain = 2; Fine_againx64 = 127; Coarse_gain = 8; + Dgain_reg = 1; Fine_again_reg = 0x7f; Coarse_gain_reg = 0x1f; + } + else if (gain < 127 * 1024) + { + Dgain = 4; Fine_againx64 = 127; Coarse_gain = 8; + Dgain_reg = 0x03; Fine_again_reg = 0x7f; Coarse_gain_reg = 0x1f; + } + else if (gain < 254 * 1024) + { + Dgain = 8; Fine_againx64 = 127; Coarse_gain = 8; + Dgain_reg = 0x07; Fine_again_reg = 0x7f; Coarse_gain_reg = 0x1f; + } + else if (gain <= SENSOR_MAXGAIN * 1024) + { + Dgain = 16; Fine_againx64 = 127; Coarse_gain = 8; + Dgain_reg = 0x0f; Fine_again_reg = 0x7f; Coarse_gain_reg = 0x1f; + } + + if (gain <= 16256){ + Fine_againx64 = abs(8 * gain / (Dgain * Coarse_gain * Fine_dgainx128)); + Fine_again_reg = Fine_againx64; + }else{ + Fine_dgain_reg = abs(8 * gain / (Dgain * Coarse_gain * Fine_againx64)); + } + + params->tGain_reg[3].data = Fine_again_reg; // 9 + params->tGain_reg[2].data = Coarse_gain_reg; // 8 + params->tGain_reg[1].data = Fine_dgain_reg; // 7 + params->tGain_reg[0].data = Dgain_reg; // 6 + + for (i = 0; i < sizeof(gain_reg)/sizeof(I2C_ARRAY); i++) + { + if (params->tGain_reg[i].data != gain_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + +#if ENABLE_NR + if (gain_reg_temp[2].data < 0x07) { // gain<2 + params->tNr_reg[0].data = 0x05; + params->tNr_reg[1].data = 0x29; + } else if (gain_reg_temp[2].data < 0x0F) { // 2<=gain<4 + params->tNr_reg[0].data = 0x07; + params->tNr_reg[1].data = 0x25; + } else if (gain_reg_temp[2].data < 0x1F) { // 4<=gain<8 + params->tNr_reg[0].data = 0x07; + params->tNr_reg[1].data = 0x25; + } else if (gain_reg_temp[2].data == 0x1F) { // gain >= 8 + params->tNr_reg[0].data = 0x07; + params->tNr_reg[1].data = 0x18; + } + // highTemp dpc + if (gain >= 16256) + { + params->tNr_reg[2].data = 0x07; + } + else if (gain <= 10240) + { + params->tNr_reg[2].data = 0x00; + } + for (i = 0; i < sizeof(nr_reg)/sizeof(I2C_ARRAY); i++) + { + if (params->tNr_reg[i].data != nr_reg_temp[i].data) + { + params->nr_dirty = true; + break; + } + } +#endif + + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1; + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1024; + *max = SENSOR_MAXGAIN*1024; + return SUCCESS; +} + +static int sc3335_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = (Preview_line_period * 3) / 2; + info->step = Preview_line_period/2; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +int cus_camsensor_init_handle(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + sc3335_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (sc3335_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tMirror_reg, mirror_reg, sizeof(mirror_reg)); + memcpy(params->tNr_reg, nr_reg, sizeof(nr_reg)); + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + strcpy(handle->model_id,"sc3335_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 2304; + handle->video_res_supported.res[0].nOutputHeight= 1296; + sprintf(handle->video_res_supported.res[0].strResDesc, "2304x1296@30fps"); + + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_linear_3M30fps; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = sc3335_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = sc3335_GetShutterInfo; + params->expo.vts=vts_30fps; + params->expo.fps = 30; + params->expo.line= 1000; + params->reg_dirty = false; + params->nr_dirty = false; + + params->orient_dirty = false; + + //handle->snr_pad_group = SENSOR_PAD_GROUP_SET; + + return SUCCESS; +} + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} +SENSOR_DRV_ENTRY_IMPL_END_EX( SC3335, + cus_camsensor_init_handle, + NULL, + NULL, + sc3335_params + ); + diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/Makefile b/general/package/sigmastar-osdrv-sensor/src/infinity6e/Makefile new file mode 100644 index 00000000..b18f8982 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/Makefile @@ -0,0 +1,9 @@ +EXTRA_CFLAGS += -I $(PWD)/include -I $(KSRC)/drivers/sstar/include +EXTRA_CFLAGS += -D SENSOR_MODULE_VERSION=$(OPENIPC_SOC_MODEL)-$(OPENIPC_SOC_FAMILY) +obj-m := $(patsubst $(PWD)/%.c, %.o, $(wildcard $(PWD)/sensor/*.c)) + +modules: + $(MAKE) -C $(KSRC) M=$(PWD) modules + +clean: + $(MAKE) -C $(KSRC) M=$(PWD) clean diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_ms_cus_sensor.h b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_ms_cus_sensor.h new file mode 100644 index 00000000..b4929f1b --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_ms_cus_sensor.h @@ -0,0 +1,1045 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +/*! @file drv_ms_cus_sensor.h + @brief This file contains Infinity ISP sensor driver interface. +*/ + +/** @defgroup group1 ISP Sensor Driver Interface +* @{ +*/ + +#ifndef DRV_MS_CUS_SENSOR_H_ +#define DRV_MS_CUS_SENSOR_H_ +#ifdef __cplusplus +extern "C" +{ +#endif + +#include + +#define I2C_RETRYTIME (5) + +#ifndef SUCCESS +#define FAIL (-1) +#define SUCCESS 0 +#endif + +#ifdef __cplusplus +#define EXPORT_CUS extern "C" +#else +#define EXPORT_CUS +#endif + +#define CUS_CAMSENSOR_HANDLE_MAJ_VER 0x0002 +#define CUS_CAMSENSOR_HANDLE_MIN_VER 0x0002 + +#define CUS_CAMSENSORIF_MAJ_VER 0x0001 +#define CUS_CAMSENSORIF_MIN_VER 0x0002 + +#define CUS_CAMSENSOR_I2C_MAJ_VER 0x0001 +#define CUS_CAMSENSOR_I2C_MIN_VER 0x0001 + +#define CUS_MSTART_CAMSENSOR_CAP_VERSION 0x0001 + +//#define usleep(usec) CamOsMsSleep(usec*1000); +//#define usleep(usec) udelay(usec) +//#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) + +#define SENSOR_DRIVER_MODE_NOT_SUUPORT (0xFFFF) + +struct __ms_cus_sensor; /**< Sensor driver handle */ +//struct __ISensorAPI; /**< Sensor to ISP control interface */ + +/*! @brief Resolution descriptor*/ +typedef struct _cus_camsensor_res{ + u32 width; /**< Image crop width */ + u32 height; /**< Image crop height */ + u32 max_fps; /**< Max fps in this resolution */ + u32 min_fps; /**< Min fps in this resolution*/ + u32 crop_start_x; + u32 crop_start_y; + u32 nOutputWidth; /**< Sensor actual output width */ + u32 nOutputHeight; /**< Sensor actual output height */ + char strResDesc[32]; + u32 nMinFrameLengthLine; // in Line + u32 nRowTime; +} __attribute__((packed, aligned(4))) cus_camsensor_res; + +/*! @brief Resolution list*/ +typedef struct _cus_camsensor_res_list +{ + u32 num_res; /**< number of sensor resolution in list */ + u32 ulcur_res; /**< current sensor resolution*/ + cus_camsensor_res res[12]; /**< resolution list */ +} __attribute__((packed, aligned(4))) cus_camsensor_res_list; + + +/*! @brief Select sensor type */ +typedef enum { + ISP_SOC, /**< Not support */ + ISP_EXT /**< sensor without built-in ISP */ +} CUS_CAMSENSOR_ISPTYPE; + +/*! @brief Sensor bayer raw pixel order */ +typedef enum { + CUS_BAYER_RG = 0, /**< bayer data start with R channel */ + CUS_BAYER_GR, /**< bayer data start with Gr channel */ + CUS_BAYER_BG, /**< bayer data start with B channel */ + CUS_BAYER_GB /**< bayer data start with Gb channel */ +} CUS_SEN_BAYER; + +typedef enum { + CUS_RGBIR_NONE = 0, /** modify RGBIR pixel order enumeration */ + CUS_RGBIR_R0 = 1, + CUS_RGBIR_G0 = 2, + CUS_RGBIR_B0 = 3, + CUS_RGBIR_G1 = 4, + CUS_RGBIR_G2 = 5, + CUS_RGBIR_I0 = 6, + CUS_RGBIR_G3 = 7, + CUS_RGBIR_I1 = 8 +} CUS_SEN_RGBIR; + +/*! @brief Set sensor image mirror and flip.*/ +typedef enum { + CUS_ORIT_M0F0, /**< mirror, flip unchanged */ + CUS_ORIT_M1F0, /**< mirror changed, flip unchanged */ + CUS_ORIT_M0F1, /**< mirror unchanged, flip changed */ + CUS_ORIT_M1F1, /**< mirror and flip changed */ +} CUS_CAMSENSOR_ORIT; + + +/*! @brief Get input source type.*/ +typedef enum { + CUS_SNR_ANADEC_SRC_NO_READY, /**< input no ready */ + CUS_SNR_ANADEC_SRC_DISCNT, /**< input disconnect */ + CUS_SNR_ANADEC_SRC_PAL, /**< input type is PAL */ + CUS_SNR_ANADEC_SRC_NTSC, /**< input type is NTSC */ + CUS_SNR_ANADEC_SRC_HD_25P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_30P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_50P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_HD_60P, /**< input source type is HD */ + CUS_SNR_ANADEC_SRC_FHD_25P, /**< input source type is FHD */ + CUS_SNR_ANADEC_SRC_FHD_30P, /**< input source type is FHD */ +}CUS_SNR_ANADEC_SRC_TYPE; + + +/*! @brief ISP AE event notifycation*/ +typedef enum { + CUS_FRAME_INACTIVE = 0, /**< Frame end */ + CUS_FRAME_ACTIVE = 1,/**< Frame start */ +} CUS_CAMSENSOR_AE_STATUS_NOTIFY; + +/*! @brief Sensor bayer raw (8/10 bits) to 12bits mode control */ +typedef enum { + CUS_SEN_8TO12_7074, /**< Do not use*/ + CUS_SEN_8TO12_7000, /**< Sensor bayer raw is 8 bits*/ + CUS_SEN_8TO12_114118, /**< Do not use*/ + CUS_SEN_8TO12_11400, /**< Do not use*/ + CUS_SEN_10TO12_9098, /**< Do not use*/ + CUS_SEN_10TO12_9000, /**< Sensor bayer raw is 10 bits*/ + CUS_SEN_10TO12_1121110, /**< Do not use*/ + CUS_SEN_10TO12_11200 /**< Do not use*/ +} CUS_SEN_FMT_CONV_MODE; + +/*! @brief Sensor input raw data precision */ +typedef enum { + CUS_DATAPRECISION_8 = 0, /**< raw data precision is 8bits */ + CUS_DATAPRECISION_10 = 1, /**< raw data precision is 10bits */ + CUS_DATAPRECISION_16 = 2, /**< raw data precision is 16bits */ + CUS_DATAPRECISION_12 = 3, /**< raw data precision is 12bits */ + CUS_DATAPRECISION_14 = 4, /**< raw data precision is 14bits */ +} CUS_DATAPRECISION; + +/*! @brief Select sensor data intarface */ +typedef enum { + CUS_SENIF_BUS_PARL = 0, /**< sensor data bus is parallel bus */ + CUS_SENIF_BUS_MIPI = 1, /**< sensor data bus is mipi */ + CUS_SENIF_BUS_BT601 = 2, + CUS_SENIF_BUS_BT656 = 3, + CUS_SENIF_BUS_BT1120 = 4, +} CUS_SENIF_BUS; + +typedef enum { + CUS_SEN_INPUT_FORMAT_YUV422, + CUS_SEN_INPUT_FORMAT_RGB, +} CUS_SEN_INPUT_FORMAT; + +/*! @brief Select pin polarity */ +typedef enum { + CUS_CLK_POL_POS = 0, /**< High active */ + CUS_CLK_POL_NEG /**< Low active */ +} CUS_CLK_POL; + +typedef enum +{ + CUS_SENSOR_YUV_ORDER_CY = 0, + CUS_SENSOR_YUV_ORDER_YC = 1, +}CUS_SENSOR_YUV_ORDER; + +/*! @brief Sensor master clock select */ +typedef enum { + CUS_CMU_CLK_27MHZ, + CUS_CMU_CLK_21P6MHZ, + CUS_CMU_CLK_12MHZ, + CUS_CMU_CLK_5P4MHZ, + CUS_CMU_CLK_36MHZ, + CUS_CMU_CLK_54MHZ, + CUS_CMU_CLK_43P2MHZ, + CUS_CMU_CLK_61P7MHZ, + CUS_CMU_CLK_72MHZ, + CUS_CMU_CLK_48MHZ, + CUS_CMU_CLK_24MHZ, + CUS_CMU_CLK_37P125MHZ, + CUS_CMU_CLK_LPLL_DIV1, + CUS_CMU_CLK_LPLL_DIV2, + CUS_CMU_CLK_LPLL_DIV4, + CUS_CMU_CLK_LPLL_DIV8, +} CUS_MCLK_FREQ; //Depends on chip. + +//Depends on chip definition. +typedef enum { + CUS_SR0_PAR_DISABLE, + CUS_SR0_PAR_MODE_1, + CUS_SR0_PAR_MODE_2, +} CUS_SR0_PAR_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_BT656_DISABLE, + CUS_SR0_BT656_MODE_1, + CUS_SR0_BT656_MODE_2, + CUS_SR0_BT656_MODE_3, + CUS_SR0_BT656_MODE_4, +} CUS_SR0_BT656_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR1_BT656_DISABLE, + CUS_SR1_BT656_MODE_1, +} CUS_SR1_BT656_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_BT601_DISABLE, + CUS_SR0_BT601_MODE_1, + CUS_SR0_BT601_MODE_2, + CUS_SR0_BT601_MODE_3, + CUS_SR0_BT601_MODE_4, +} CUS_SR0_BT601_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR0_MIPI_DISABLE, + CUS_SR0_MIPI_MODE_1, + CUS_SR0_MIPI_MODE_2, +} CUS_SR0_MIPI_MODE; + +//Depends on chip definition. +typedef enum { + CUS_SR1_MIPI_DISABLE, + CUS_SR1_MIPI_MODE_1, + CUS_SR1_MIPI_MODE_2, + CUS_SR1_MIPI_MODE_3, + CUS_SR1_MIPI_MODE_4, +} CUS_SR1_MIPI_MODE; + +//Depends on chip definition. +typedef enum +{ + CUS_VIF_BT656_EAV_DETECT = 0, + CUS_VIF_BT656_SAV_DETECT = 1, +}CUS_VIF_BT656_CHANNEL_SELECT; + +//Depends on chip definition. +typedef enum +{ + CUS_VIF_BT656_VSYNC_DELAY_1LINE = 0, + CUS_VIF_BT656_VSYNC_DELAY_2LINE = 1, + CUS_VIF_BT656_VSYNC_DELAY_0LINE = 2, + CUS_VIF_BT656_VSYNC_DELAY_AUTO = 3, +}CUS_VIF_BT656_VSYNC_DELAY; + +typedef enum +{ + CUS_SENSOR_FUNC_DISABLE = 0, + CUS_SENSOR_FUNC_ENABLE = 1, +}CUS_SENSOR_FUNC; + +typedef enum +{ + CUS_SENSOR_PAD_GROUP_A = 0, + CUS_SENSOR_PAD_GROUP_B = 1, + CUS_SENSOR_PAD_GROUP_C = 2, + CUS_SENSOR_PAD_GROUP_D = 3, +}CUS_SENSOR_PAD_GROUP; + +typedef enum +{ + CUS_SENSOR_MASTER_MODE = 0, + CUS_SENSOR_SLAVE_MODE = 1, +}CUS_SENSOR_MODE; + +typedef enum +{ + CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL = 0, + CUS_SENSOR_CHANNEL_MODE_REALTIME_HDR = 1, + CUS_SENSOR_CHANNEL_MODE_RAW_STORE = 2, + CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR = 3, +}CUS_SENSOR_CHANNEL_MODE; + +typedef struct { + unsigned int gain; + unsigned int offset; +} CUS_GAIN_GAP_ARRAY; + +////////////////////////////////////// +// sensor functions +////////////////////////////////////// + +typedef struct { + u32 length; //header length + u32 version; //version +}CUS_CAMSENSOR_CAP; + +/////////////////// ISP for SENSOR API /////////////////// +typedef enum { + CUS_INT_TASK_AE = (1<<0), + CUS_INT_TASK_AWB = (1<<1), + CUS_INT_TASK_AF = (1<<2), + CUS_INT_TASK_VS = (1<<3), + CUS_INT_TASK_VDOS = (1<<4), +} CUS_INT_TASK_TYPE; + +#define MAX_RUN_ORDER 16 +typedef struct { + u8 RunLength; + u8 Orders[MAX_RUN_ORDER]; + u8 CurTaskType; +} CUS_INT_TASK_ORDER; + +/////////////////// Shutter Info /////////////////////// +/*! @brief Report shutter information */ +typedef struct { + u32 length; /**< struct size */ + u32 max; /**< maximun shutter in us*/ + u32 min; /**< minimum shutter in us*/ + u32 step; /**< shutter in step us*/ +} CUS_SHUTTER_INFO; + +////////////////// CSI CLOCK //////////////////////// +/*! @brief Select MIPI clock*/ +typedef enum { + CUS_CSI_CLK_DISABLE = -1, /**< Disable MIPI clock*/ + CUS_CSI_CLK_108M = 0, /**< MIPI pixel rate 864Mbps (1-lane)*/ + CUS_CSI_CLK_86M = 1, /**< MIPI pixel rate 344Mbps(1-lane)*/ + CUS_CSI_CLK_144M = 2, /**< MIPI pixel rate 1152Mbps(1-lane)*/ + CUS_CSI_CLK_172M = 3, + CUS_CSI_CLK_216M = 4, + CUS_CSI_CLK_288M = 5, + CUS_CSI_CLK_40M = 6, + CUS_CSI_CLK_24M = 7, + CUS_CSI_CLK_12M = 8, + CUS_CSI_CLK_123M = 9 +}CUS_CSI_CLK; + +///////////////// SENSOR PIN CONFIG///////////////// +/*! @brief Sensor pin assignment*/ +typedef enum { + CUS_SR_PAD_CFG_1 = 1, /**< Pin config for MIPI 1/2 lanes*/ + CUS_SR_PAD_CFG_MIPI = 1, /**< Pin config for MIPI 1/2 lanes*/ + CUS_SR_PAD_CFG_2 = 2, /**< Reserved */ + CUS_SR_PAD_CFG_3 = 3, /**< Reserved */ + CUS_SR_PAD_CFG_10BITS = 4, /**< Pin config for parallel interface 10 bits */ + CUS_SR_PAD_CFG_4 = 4, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_12BITS = 5, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_5 = 5, /**< Pin config for parallel interface 12 bits */ + CUS_SR_PAD_CFG_6 = 6 /**< Pin config for parallel interface 12 bits */ + }CUS_SR_PAD_CFG; + +/*! @brief virtual channel0 hsync. mode */ +typedef enum +{ + PACKET_HEADER_EDGE1 = 0, /**< packet header edge */ + PACKET_HEADER_EDGE2 = 1, /**< line end edge */ + PACKET_HEADER_EDGE3 = 2, /**< line start edge */ + PACKET_FOOTER_EDGE = 3, /**< packet footer edge */ +}CUS_CSI_VC_HS_MODE; + +typedef enum +{ + CUS_HDR_MODE_NONE = 0, + CUS_HDR_MODE_SONY_DOL = 1, + CUS_HDR_MODE_DCG = 2, + CUS_HDR_MODE_EMBEDDED_RAW8 = 3, + CUS_HDR_MODE_EMBEDDED_RAW10 = 4, + CUS_HDR_MODE_EMBEDDED_RAW12 = 5, + CUS_HDR_MODE_EMBEDDED_RAW16 = 6, //Only for OV2718? + CUS_HDR_MODE_LI = 7, + CUS_HDR_MODE_MULTI_VC = 8, +}CUS_HDR_MODE; + +typedef enum +{ + // Index 0 + SENSOR_DRIVER_MODE_VGA_30P_RESOLUTION, // 640*360 30P + SENSOR_DRIVER_MODE_VGA_50P_RESOLUTION, // 640*360 50P + SENSOR_DRIVER_MODE_VGA_60P_RESOLUTION, // 640*360 60P + SENSOR_DRIVER_MODE_VGA_100P_RESOLUTION, // 640*360 100P + SENSOR_DRIVER_MODE_VGA_120P_RESOLUTION, // 640*360 120P + + // Index 5 + SENSOR_DRIVER_MODE_HD_24P_RESOLUTION, // 1280*720 24P + SENSOR_DRIVER_MODE_HD_30P_RESOLUTION, // 1280*720 30P + SENSOR_DRIVER_MODE_HD_50P_RESOLUTION, // 1280*720 50P + SENSOR_DRIVER_MODE_HD_60P_RESOLUTION, // 1280*720 60P + SENSOR_DRIVER_MODE_HD_100P_RESOLUTION, // 1280*720 100P + + // Index 10 + SENSOR_DRIVER_MODE_HD_120P_RESOLUTION, // 1280*720 120P + SENSOR_DRIVER_MODE_1600x900_30P_RESOLUTION, // 1600*900 30P + SENSOR_DRIVER_MODE_FULL_HD_15P_RESOLUTION, // 1920*1080 15P + SENSOR_DRIVER_MODE_FULL_HD_24P_RESOLUTION, // 1920*1080 24P + SENSOR_DRIVER_MODE_FULL_HD_25P_RESOLUTION, // 1920*1080 25P + + // Index 15 + SENSOR_DRIVER_MODE_FULL_HD_30P_RESOLUTION, // 1920*1080 30P + SENSOR_DRIVER_MODE_FULL_HD_50P_RESOLUTION, // 1920*1080 50P + SENSOR_DRIVER_MODE_FULL_HD_60P_RESOLUTION, // 1920*1080 60P + SENSOR_DRIVER_MODE_SUPER_HD_30P_RESOLUTION, // 2304*1296 30P + SENSOR_DRIVER_MODE_SUPER_HD_25P_RESOLUTION, // 2304*1296 25P + + // Index 20 + SENSOR_DRIVER_MODE_SUPER_HD_24P_RESOLUTION, // 2304*1296 24P + SENSOR_DRIVER_MODE_1440_30P_RESOLUTION, // 2560*1440 30P + SENSOR_DRIVER_MODE_2D7K_15P_RESOLUTION, // 2704*1524 15P + SENSOR_DRIVER_MODE_2D7K_30P_RESOLUTION, // 2704*1524 30P + SENSOR_DRIVER_MODE_4K2K_15P_RESOLUTION, // 3840*2160 15P + + // Index 25 + SENSOR_DRIVER_MODE_4K2K_30P_RESOLUTION, // 3840*2160 30P + SENSOR_DRIVER_MODE_4TO3_VGA_30P_RESOLUTION, // 640*480 30P + SENSOR_DRIVER_MODE_4TO3_1D2M_30P_RESOLUTION, // 1280*960 30P + SENSOR_DRIVER_MODE_4TO3_1D5M_30P_RESOLUTION, // 1440*1080 30P + SENSOR_DRIVER_MODE_4TO3_3M_15P_RESOLUTION, // 2048*1536 15P + + // Index 30 + SENSOR_DRIVER_MODE_4TO3_3M_30P_RESOLUTION, // 2048*1536 30P + SENSOR_DRIVER_MODE_4TO3_5M_15P_RESOLUTION, // 2560*1920 15P + SENSOR_DRIVER_MODE_4TO3_5M_30P_RESOLUTION, // 2560*1920 30P + SENSOR_DRIVER_MODE_4TO3_8M_15P_RESOLUTION, // 3264*2448 15P + SENSOR_DRIVER_MODE_4TO3_8M_30P_RESOLUTION, // 3264*2448 30P + + // Index 35 + SENSOR_DRIVER_MODE_4TO3_10M_15P_RESOLUTION, // 3648*2736 15P + SENSOR_DRIVER_MODE_4TO3_10M_30P_RESOLUTION, // 3648*2736 30P + SENSOR_DRIVER_MODE_4TO3_12M_15P_RESOLUTION, // 4032*3024 15P + SENSOR_DRIVER_MODE_4TO3_12M_30P_RESOLUTION, // 4032*3024 30P + SENSOR_DRIVER_MODE_4TO3_14M_15P_RESOLUTION, // 4352*3264 15P + + // Index 40 + SENSOR_DRIVER_MODE_4TO3_14M_30P_RESOLUTION, // 4352*3264 30P + SENSOR_DRIVER_MODE_4K2K_24P_RESOLUTION, + SENSOR_DRIVER_MODE_PAL_25P_RESOLUTION, + SENSOR_DRIVER_MODE_NTSC_30P_RESOLUTION, + + // For Camera Preview + SENSOR_DRIVER_MODE_BEST_CAMERA_PREVIEW_RESOLUTION, + SENSOR_DRIVER_MODE_BEST_CAMERA_CAPTURE_16TO9_RESOLUTION, + SENSOR_DRIVER_MODE_BEST_CAMERA_CAPTURE_4TO3_RESOLUTION, + SENSOR_DRIVER_MODE_FULL_HD_30P_RESOLUTION_HDR, +} CUS_SNR_RESOLUTION; + + +#ifdef __cplusplus +extern "C" +#endif + +/**@brief ISP sensor interface control API */ +typedef struct __ISensorIfAPI //isp sensor interface API +{ + version_info version; + /**@brief Reserved */ + void* pdata; + + /** @brief Set sensor power down pin. + @param[in] idx Sensor pad ID. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*PowerOff)(u32 idx, CUS_CLK_POL pol); + + /** @brief Set sensor power reset pin. + @param[in] idx Sensor pad ID. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*Reset)(u32 idx, CUS_CLK_POL pol); + + /** @brief Configure sensor master clock. + @param[in] idx Sensor pad ID. + @param[in] bONOFF Clock ON/OFF control. + @param[in] mclk Clock frequency Hz. + @retval SUCCESS or FAIL if error occurs. + */ + int (*MCLK)(u32 idx, u8 bONOFF, CUS_MCLK_FREQ mclk); + + /** @brief Query sensor master clock. + @param[in] idx Sensor pad ID. + @param[in] mclk Query if clock frequency Hz is available. + @retval SUCCESS or FAIL if error occurs. + */ + int (*QueryMCLK)(u32 idx, CUS_MCLK_FREQ mclk); + + /** @brief Query MIPI lane number. + @param[in] idx Sensor pad ID. + @param[in] lane_num Query max lane number. + @retval SUCCESS or FAIL if error occurs. + */ + int (*QueryLaneNum)(u32 idx, u8 *max_lane); +#if 0 + /** @brief Select pixel clock source + @remarks Parallel interface only + @param[in] handle Handle to sensor driver. + @param[in] pclk_source Clock source. + @retval SUCCESS or FAIL if error occurs. + */ + int (*PCLK)(CUS_PCLK_SOURCE pclk_source); //senect sensor + + /** @brief Configure HSYNC pin polarity. + @remarks Parallel interface only + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*HsyncPol)(CUS_CLK_POL pol); + + /** @brief [parallel interface only] Configure VSYNC pin polarity. + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*VsyncPol)(CUS_CLK_POL pol); + + /** @brief Configure PCLK pin polarity. + @param[in] handle Handle to sensor driver. + @param[in] pol pin polarity. + @retval SUCCESS or FAIL if error occurs. + */ + int (*ClkPol)(CUS_CLK_POL pol); + + /** @brief Configure sensor bayer raw pixel order + @param[in] handle Handle to sensor driver. + @param[in] bayer_id Select pixel order + @retval SUCCESS or FAIL if error occurs. + */ + int (*BayerFmt)(CUS_SEN_BAYER bayer_id); + + /** @brief Configure sensor RGBIR (8 or 10bits) convert to 12bit bits isp input, This config will be ignore for 12/16 bits sensor bayer raw input. + @param[in] handle Handle to sensor driver. + @param[in] mode Mode select + @retval SUCCESS or FAIL if error occurs. + */ + int (*FmtConv)(CUS_SEN_FMT_CONV_MODE mode); + + /** @brief Select sensor image data interface + @param[in] handle Handle to sensor driver. + @param[in] bus Sensor interface + @retval SUCCESS or FAIL if error occurs. + */ + int (*DataBus)(CUS_SENIF_BUS bus); + + /** @brief Configure sensor bayer raw pixel bits + @param[in] handle Handle to sensor driver. + @param[in] prec Select pixel bits + @retval SUCCESS or FAIL if error occurs. + */ + int (*DataPrecision)(CUS_DATAPRECISION prec); + + /** @brief Wait isp frame start event + @param[in] handle Handle to sensor driver. + @param[in] ms Max timeout in ms + @retval SUCCESS or FAIL if error occurs. + */ + int (*WaitVStart)(int ms); + + /** @brief Wait isp frame end event + @param[in] handle Handle to sensor driver. + @param[in] ms Max timeout in ms + @retval SUCCESS or FAIL if error occurs. + */ + int (*WaitVEnd)(int ms); + + /** @brief Configure 3A task order table + @param[in] handle Handle to sensor driver. + @param[in] tasks Task order table + @retval SUCCESS or FAIL if error occurs. + */ + int (*Set3ATaskOrder)(CUS_INT_TASK_ORDER tasks); +#endif + /** @brief Select sensor IO pin assignment + @param[in] idx Sensor pad ID. + @param[in] ulSnrType Interface type. + @param[in] ulSnrPadCfg Pin config. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetIOPad)(u32 idx, CUS_SENIF_BUS ulSnrType, u32 ulSnrPadCfg); + + //FOR CSI + + /** @brief Set maximum mipi data rate (amount of all lans) + @remarks MIPI interface only. + @param[in] idx Sensor pad ID. + @param[in] clk Max data rate. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_Clk)(u32 idx, CUS_CSI_CLK clk); + + /** @brief Set number of MIPI lanes + @remarks MIPI interface only. + @param[in] idx Sensor pad ID. + @param[in] num_lan Number of lanes. + @param[in] bon_off Clock ON/OFF control. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_Lane)(u32 idx, u16 num_lan, u8 bon_off); + + /** @brief Enable long packet type + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] ctl_cfg0_15 Control flag bit[0:15] + @param[in] ctl_cfg16_31 Control flag bit[16:31] + @param[in] ctl_cfg32_47 Control flag bit[32:47] + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_LongPacketType)(u32 idx, u16 ctl_cfg0_15, u16 ctl_cfg16_31, u16 ctl_cfg32_47); + + /** @brief Virtual channel0 hsync mode + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] mode HSYNC mode. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_VC0HSmode)(CUS_CSI_VC_HS_MODE mode); + + /** @brief Configure MIPI capture start timing + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] rx_clk_skip_ns + @param[in] rx_data_skip_ns + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_clk_data_skip)(u32 idx, u8 rx_clk_skip_ns,u8 rx_data_skip_ns); + + /** @brief Configure MIPI hdr mode + @remarks MIPI interface only + @param[in] idx Sensor pad ID. + @param[in] hdr_mode HDR mode. + @param[in] bon_off Clock ON/OFF control. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetCSI_hdr_mode)(u32 idx, CUS_HDR_MODE hdr_mode, u8 bon_off); + +#if 0 + /** @brief Configure sensor RGBIR raw pixel order + @param[in] handle Handle to sensor driver. + @param[in] bayer_id Select pixel order + @retval SUCCESS or FAIL if error occurs. + */ + int (*RGBIRFmt)(CUS_SEN_RGBIR RGBIR_id); +#endif + + /** @brief Skip vif output frame + @remarks Skip Frame interface only + @param[in] idx Sensor pad ID. + @param[in] fps Sensor current fps. + @param[in] cnt Skip counter + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetSkipFrame)(u32 idx, u32 fps, u32 cnt); + + /** @brief Switch Vif PadID + @remarks Switch Vif PadID mux + @param[in] id Vif Select Source. + @retval SUCCESS or FAIL if error occurs. + */ + int (*SetVIFSelectSource)(u32 id); ///2eff + +}ISensorIfAPI; + +typedef union { + //Parallel sensor + struct { + u32 parallel_reserved; //No additional attribute. + } attr_parallel; + + //MIPI sensor + struct { + u32 mipi_lane_num; + u32 mipi_data_format; //0: YUV 422 format. 1: RGB pattern. + u32 mipi_yuv_order; //YUYV or UYVY + u32 mipi_hsync_mode; + u32 mipi_sampling_delay; /** < MIPI start sampling delay */ /*bit 0~7: clk_skip_ns. bit 8~15: data_skip_ns*/ + CUS_HDR_MODE mipi_hdr_mode; + u32 mipi_hdr_virtual_channel_num; + } attr_mipi; + + //BT656 sensor + struct { + u32 bt656_total_ch; + u32 bt656_cur_ch; + u32 bt656_ch_det_en; + CUS_VIF_BT656_CHANNEL_SELECT bt656_ch_det_sel; + u32 bt656_bit_swap; + u32 bt656_8bit_mode; + CUS_VIF_BT656_VSYNC_DELAY bt656_vsync_delay; + u32 bt656_hsync_inv; + u32 bt656_vsync_inv; + u32 bt656_clamp_en; + u32 bt656_yuv_order; //YUYV or UYVY + } attr_bt656; +} InterfaceAttr_u; + +/////////////////////////////////////////////////////// + +/** @brief Sensor driver interface \n +The function here are implemented by sensor driver. +*/ +typedef struct __ms_cus_sensor{ + //short lib_idx; /**< Reserved , Do not use */ + version_info version; + char model_id[32]; /**< Please fill the sensor modle id string here then libcamera user can read model_id by using cameraGetSensorModelID() .*/ + void *sen_handle; /**< Reserved , Do not use */ + void *private_data; /**< sensor driver dependent variables should store in private_data and free when release */ + void *slave_mode_set; /**< Reserved , For sensor vsync/hsync control*/ + + // i2c + app_i2c_cfg i2c_cfg; /**< Sensor i2c setting */ + i2c_handle_t *i2c_bus; /**< Handle to sensor i2c API. */ + + // sensor if api + ISensorIfAPI *sensor_if_api; /**< sensor interface API */ + + // ae parameters + int ae_gain_delay; /**< How many frame delay from writing AE gain to take effect*/ + int ae_shutter_delay; /**< How many frame delay from writing AE shutter to take effect*/ + int ae_gain_ctrl_num; + int ae_shutter_ctrl_num; + + // polarity + CUS_CLK_POL reset_POLARITY; /** < Sensor REST pin polarity */ + CUS_CLK_POL pwdn_POLARITY; /** < Sensor Power Down pin polarity */ + CUS_CLK_POL VSYNC_POLARITY; /** < Sensor VSYNC polarity */ + CUS_CLK_POL HSYNC_POLARITY; /** < Sensor HSYNC pin polarity */ + CUS_CLK_POL PCLK_POLARITY; /** < Sensor Plxel Clock pin polarity */ + + // sensor data enum list*/ + CUS_CAMSENSOR_ISPTYPE isp_type; /** < Always use ISP_EXT */ + CUS_SEN_BAYER bayer_id; /** < Sensor bayer raw pixel order */ + CUS_SEN_RGBIR RGBIR_id; /** < Sensor bayer raw pixel order */ + CUS_SENIF_BUS sif_bus; /** < Select sensor interface */ + CUS_DATAPRECISION data_prec; /** < Raw data bits */ + CUS_SEN_FMT_CONV_MODE data_mode; /** < Data convert mode*/ + CUS_CAMSENSOR_ORIT orient; /** < Sensor mirror/flip */ + CUS_SENSOR_PAD_GROUP snr_pad_group; + CUS_SENSOR_MODE snr_pad_mode; /** < support master/slave mode sensor */ + + cus_camsensor_res_list video_res_supported; /** < Resolution list */ + InterfaceAttr_u interface_attr; + + //sensor calibration + u32 mclk; /** < Sensor master clock frequency */ + u32 sat_mingain; /**< Minimum AE gain */ + u32 ir_only_fmt; + u32 nPixelSize; //in nano meter + + //////////////////////////////////////////////// + // system functions + //////////////////////////////////////////////// + + /** @brief Sensor power on sequence, I2C must be ready after calling this function + @param[in] handle Handle to sensor driver. + @remark Following configuration need to set up at this stage \n + @ref __ISensorIfAPI::Reset Reset sensor \n + @ref __ISensorIfAPI::PowerOff Sensor power down pin \n + @ref __ISensorIfAPI::MCLK Sensor master clock \n + @ref __ISensorIfAPI::SetIOPad ISP sensor IO \n + @ref __ISensorIfAPI::SetCSI_Clk [MIPI sensor only] MIPI clock\n + @ref __ISensorIfAPI::HsyncPol Hsync polarity\n + @ref __ISensorIfAPI::VsyncPol Vsync polarity\n + @ref __ISensorIfAPI::ClkPol [Parallel sensor only] Pixel clock polarity\n + @ref __ISensorIfAPI::BayerFmt Raw data format\n + @ref __ISensorIfAPI::DataPrecision Raw data pixel bits\n + @ref __ISensorIfAPI::FmtConv Raw data to ISP pixel convert\n + @retval SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_poweron)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Sensor power off + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_poweroff)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Sensor initialization + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Fill sensor initial table here, Sensor beginning to output raw images after calling this function . + */ + int (*pCus_sensor_init)(struct __ms_cus_sensor* handle); + + /** @brief Sensor Post initialization + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Fill sensor initial table here, Sensor beginning to output raw images after calling this function . + */ + int (*pCus_sensor_post_init)(struct __ms_cus_sensor* handle, u32 idx); + + /** @brief Release resources those allocated in cus_camsensor_init_handle() + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark Release resource allocated in \ref cus_camsensor_init_handle + */ + int (*pCus_sensor_release)(struct __ms_cus_sensor* handle); + + /** @brief Enter sensor suspend mode + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark ISP call this function before enter power saving mode + */ + int (*pCus_sensor_suspend)(struct __ms_cus_sensor* handle); + + /** @brief Sensor wakeup + @param[in] handle Handle to sensor driver. + @retval SUCCESS or FAIL if error occurs. + @remark ISP call this function after exit power saving mode + */ + int (*pCus_sensor_resume)(struct __ms_cus_sensor* handle); + + /** @brief Enable sensor pattern mode if sensor hardward supported + @param[in] handle Handle to sensor driver. + @param[in] mode Pattern select, if 0 disable pattern mode. + @retval SUCCESS or FAIL if error occurs. + @remark This function is optional + */ + int (*pCus_sensor_SetPatternMode)(struct __ms_cus_sensor* handle,u32 mode); + + // Normal + + /** @brief Check sensor ID and report to ISP sensor match or not + @param[in] handle Handle to sensor driver. + @param[out] id Receive 4 bytes customer defined sensor ID. + @retval Return SUCCESS if sensor matched or Retuen FAIL if sensor mismatch. + @remark Read sensor ID through I2C + */ + int (*pCus_sensor_GetSensorID)(struct __ms_cus_sensor* handle, u32 *id); + + /** @brief Get resolution list + @param[in] handle Handle to sensor driver. + @param[out] id Receive supported resolution list + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetVideoRes)(struct __ms_cus_sensor* handle, u32 res_idx, cus_camsensor_res **res); + + /** @brief Get resolution list + @param[in] handle Handle to sensor driver. + @param[out] id Receive supported resolution list + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetCurVideoRes)(struct __ms_cus_sensor* handle, u32 *cur_idx, cus_camsensor_res **res); + + /** @brief Select a sensor output resolution sensor list + @param[in] handle Handle to sensor driver. + @param[in] res_id Resolution id + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetVideoRes)(struct __ms_cus_sensor* handle, u32 res_id); + + /** @brief Get sensor current mirror flip setting + @param[in] handle Handle to sensor driver. + @param[out] ori Receive Mirror/Flip setting. + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetOrien)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_ORIT *ori); + + /** @brief Select a sensor mirror flip + @param[in] handle Handle to sensor driver. + @param[in] ori Mirror/Flip configuration. + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetOrien)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_ORIT ori); + + /** @brief Get sensor capability + @param[in] handle Handle to sensor driver. + @param[out] cap Receive sensor capability + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetSensorCap)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_CAP *cap); + + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + + /** @brief AE/Frame status change notification + @param[in] handle Handle to sensor driver. + @param[in] status Current status + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_AEStatusNotify)(struct __ms_cus_sensor* handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); + + /** @brief Get sensor shutter setting in us + @param[in] handle Handle to sensor driver. + @param[out] us Receive current shutter setting + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetAEUSecs)(struct __ms_cus_sensor* handle, u32 *us); + + /** @brief Set sensor shutter in us + @param[in] handle Handle to sensor driver. + @param[in] us Shutter setting in us + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_SetAEUSecs)(struct __ms_cus_sensor* handle, u32 us); + + // Gain: 1x = 1024 + /** @brief Get sensor current AE gain + @param[in] handle Handle to sensor driver. + @param[out] gain Receive current AE gain + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEGain)(struct __ms_cus_sensor* handle, u32* gain); + + /** @brief Set sensor AE gain + @param[in] handle Handle to sensor driver. + @param[in] gain AE gain + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_SetAEGain)(struct __ms_cus_sensor* handle, u32 gain); + + /** @brief Get supported shutter range + @param[in] handle Handle to sensor driver. + @param[out] min Receive minimum shutter which sensor can supported + @param[out] min Receive maxiimum shutter which sensor can supported + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEMinMaxUSecs)(struct __ms_cus_sensor* handle, u32 *min, u32 *max); + + /** @brief Get supported AE gain range + @param[in] handle Handle to sensor driver. + @param[out] min Receive minimum gain which sensor can supported + @param[out] min Receive maxiimum gain which sensor can supported + @retval Return SUCCESS or FAIL if error occurs. + @remark gain: 1x = 1024 + */ + int (*pCus_sensor_GetAEMinMaxGain)(struct __ms_cus_sensor* handle, u32 *min, u32 *max); + + // frame rate control + /** @brief Get current fps + @param[in] handle Handle to sensor driver. + @retval Return current frame rate per second + */ + int (*pCus_sensor_GetFPS)(struct __ms_cus_sensor* handle); + + /** @brief Set sensor output fps + @param[in] handle Handle to sensor driver. + @param[in] fps + @retval Return SUCCESS or FAIL if fps is out of range. + */ + int (*pCus_sensor_SetFPS)(struct __ms_cus_sensor* handle, u32 fps); + + //[OPTIONAL] sensor calibration + /** @brief Optional function */ + int (*pCus_sensor_SetAEGain_cal)(struct __ms_cus_sensor* handle, u32); + + /** @brief Optional function */ + int (*pCus_sensor_setCaliData_gain_linearity)(struct __ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray ,u32 num); + + //Get shutter information + /** @brief Get shutter information + @param[in] handle Handle to sensor driver. + @param[out] info return shutter information. + @retval Return current frame rate per second + */ + int (*pCus_sensor_GetShutterInfo)(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info); + + /** @brief Get resolution list number + @param[in] handle Handle to sensor driver. + @param[out] ulres_num resolution list number + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetVideoResNum)(struct __ms_cus_sensor* handle, u32 *ulres_num); + + //Get shutter information + /** @brief Sensor vendor command + @param[in] handle Handle to sensor driver. + @param[in] reserved + @param[in] param Command input + @param[out] out Command output + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_CustDefineFunction)(struct __ms_cus_sensor* handle,u32 cmd_id, void *param); + + //Get Source Type + /** @brief Get Source Type + @param[in] handle Handle to sensor driver. + @param[in] plane id. + @param[out] psrc_type info + @retval Return SUCCESS or FAIL if error occurs. + */ + int (*pCus_sensor_GetSrcType)(struct __ms_cus_sensor* handle, u32 plane_id, CUS_SNR_ANADEC_SRC_TYPE *psrc_type); + + // Gain: 1x = 1024 + /** @brief Try AE gain value + @param[in] handle Handle to sensor driver. + @param[in] Target AE gain value to try + @retval Return actual sensor gain will apply on the HW. + @remark gain: 1x = 1024 + */ + u32 (*pCus_sensor_TryAEGain)(struct __ms_cus_sensor* handle, u32 gain); + + // Return actual shutter + /** @brief Try AE shutter value + @param[in] handle Handle to sensor driver. + @param[in] Target AE shutter value to try , in us + @retval Return actual sensor gain will apply on the HW. + @remark gain: 1x = 1024 + */ + u32 (*pCus_sensor_TryAEShutter)(struct __ms_cus_sensor* handle, u32 us); + + int (*pCus_sensor_SwitchgSensorId)(struct __ms_cus_sensor* handle,u32 sensorId); + + int (*pCus_sensor_GetCurSwtichSensorId)(struct __ms_cus_sensor* handle,u32 *pu32sensorId); +} ms_cus_sensor; + +/** @brief Sensor driver entry. ISP call this function before start using sensor driver. \n +ISP pass \ref ms_cus_sensor struct to obtain the driver information and function entries. \n +And all allocated resources here should be released at \ref __ms_cus_sensor::pCus_sensor_release. +Every sensor driver must implement this api. +@param[in] drv_handle A uninitialized \ref ms_cus_sensor struct from ISP, Sensor driver fill the driver information and function entries to drv_handle. +@retval SUCCESS or FAIL if error occurs. +*/ + +typedef int (*SensorInitHandle)(ms_cus_sensor* handle); + +#ifdef __cplusplus +} +#endif + +#endif /* DRV_MS_CUS_SENSOR_H_ */ +/** @} */ // end of ISP Sensor Driver Interface diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor.h b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor.h new file mode 100644 index 00000000..36452880 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef DRV_SENSOR_H +#define DRV_SENSOR_H + +#include + +#define SENSOR_DMSG(args...) do{}while(0) +#define SENSOR_EMSG(args...) CamOsPrintf(args) +#define SENSOR_IMSG(args...) CamOsPrintf(args) +#if 0 +typedef enum { + I2C_FMT_A8D8, /**< 8 bits Address, 8 bits Data */ + I2C_FMT_A16D8,/**< 16 bits Address 8 bits Data */ + I2C_FMT_A8D16,/**< 8 bits Address 16 bits Data */ + I2C_FMT_A16D16,/**< 16 bits Address 16 bits Data */ + I2C_FMT_END/**< Reserved */ +} ISP_I2C_FMT; +#endif + +extern s32 WriteRegisterPair(int slaveAddr, short reg, unsigned short value, ISP_I2C_FMT fmt); +extern u64 intlog10(u32 value); +extern u64 intlog2(u32 value); +extern s32 DrvRegisterSensorDriver(u32 nCamID, SensorInitHandle pfnSensorInitHandle); +extern s32 DrvRegisterPlaneDriver(u32 nCamID, u32 nPlaneID, SensorInitHandle pfnSensorInitHandle); +extern s32 DrvRegisterSensorDriverEx(u32 nSNRPadID, SensorInitHandle pfnSensorInitHandle, void *pPrivateData); +extern s32 DrvRegisterPlaneDriverEx(u32 nSNRPadID, u32 nPlaneID, SensorInitHandle pfnSensorInitHandle, void *pPrivateData); +extern s32 DrvSensorRelease(u32 nSNRPadID); +extern s32 DrvSensorEarlyInitSync(u32 nSNRPadID); +extern s32 DrvRegisterSensorI2CSlaveID(u32 nCamID, u32 Slaveid); +extern s32 DrvRegisterPlaneI2CSlaveID(u32 nCamID, u32 nPlaneID, u32 Slaveid); +extern s32 DrvSensorHandleVer(u32 version_major, u32 version_minor); +extern s32 DrvSensorIFVer(u32 version_major, u32 version_minor); +extern s32 DrvSensorI2CVer(u32 version_major, u32 version_minor); +#define DrvUnregisterSensorDriverEx(nSNRPadID) DrvSensorRelease((nSNRPadID)) + +#define SENSOR_USLEEP(us) CamOsUsSleep(us) +#define SENSOR_MSLEEP(ms) CamOsMsSleep(ms) +#define SENSOR_UDELAY(us) CamOsUsDelay(us) +#define SENSOR_MDELAY(ms) CamOsMsDelay(ms) +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_common.h b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_common.h new file mode 100644 index 00000000..88b2b38c --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_common.h @@ -0,0 +1,379 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef _SENSOR_OS_WRAPPER_H_ +#define _SENSOR_OS_WRAPPER_H_ + +#if defined(__KERNEL__) +#define CAM_OS_LINUX_KERNEL +#endif + +#include +#include +#include + +/******************************************************** RTK ***********************************************************/ +#if defined(CAM_OS_RTK) +typedef unsigned char bool; +#ifndef true +#define true 1 +#define false 0 +#endif + +#ifndef _SENSOR_SLAVE_ID_ +#define _SENSOR_SLAVE_ID_ 0 +#endif + +#define SENSOR_DRV_ENTRY_IMPL_BEGIN(NAME) + +#define SENSOR_DRV_ENTRY_IMPL_END(Name,LinearEntry,HdrSefEntry,HdrLefEntry)\ +int Name##_init_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + /*To avoid compile warning*/\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + for(nCamID=0;nCamID<4;++nCamID)\ + {\ + if((chmap>>nCamID)&0x1)\ + {\ + if(p0){ DrvRegisterSensorDriver(nCamID, LinearEntry);\ + DrvRegisterSensorI2CSlaveID(nCamID, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p1){ DrvRegisterPlaneDriver(nCamID, 1, HdrSefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){ DrvRegisterPlaneDriver(nCamID, 0, HdrLefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + }\ + }\ + return 0;\ +} + +static volatile int lane_num = 2; +static volatile int hdr_lane_num=2; + +#define SENSOR_DRV_PARAM_MCLK() "NONE" +#define SENSOR_USLEEP_(us) {CamOsUsDelay(us);} +#define SENSOR_MSLEEP_(ms) {CamOsMsDelay(ms);} + +/*Extension version*/ +#define SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(NAME) SENSOR_DRV_ENTRY_IMPL_BEGIN(NAME) + +#define MAX_CAMID_LEN 4 +#define SENSOR_DRV_ENTRY_IMPL_END_EX(Name,LinearEntry,HdrSefEntry,HdrLefEntry,PrivateDataType)\ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static PrivateDataType g_PrivData[2][MAX_CAMID_LEN];\ +int Name##_init_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + /*To avoid compile warning*/\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + /*void* pData = CamOsMemAlloc(sizeof(PrivateDataType));*/\ + void* pData = &g_PrivData[0][nCamID];/*Change private data to static var*/\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2){\ + /*void* pData = CamOsMemAlloc(sizeof(PrivateDataType));*/\ + void* pData = &g_PrivData[1][nCamID];/*Change private data to static var*/\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 1, HdrSefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 0, HdrLefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (_SENSOR_SLAVE_ID_>>(nCamID*8))&0xFF);\ + SENSOR_DMSG("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + DrvSensorEarlyInitSync(nCamID);\ + }\ + }\ + return 0;\ +}\ +\ +int Name##_deinit_driver(unsigned char chmap)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + /*CamOsMemRelease((void*)g_pData[0][nCamID]);*/\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + /*CamOsMemRelease((void*)g_pData[1][nCamID]);*/\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ + return 0;\ +} +/******************************************************** LINUX ***********************************************************/ +#elif defined(CAM_OS_LINUX_KERNEL) +#include +#include +#include +#include +#include +#define SENSOR_DRV_ENTRY_IMPL_BEGIN(Name) \ +int chmap = 0;\ +module_param(chmap, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(chmap, "VIF channel mapping");\ +char *mclk = "use default parameter";\ +module_param(mclk, charp, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(mclk, "Assign MCLK"); +int lane_num = 2;\ +module_param(lane_num, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(lane_num, "sensor output lane number"); +int hdr_lane_num = 4;\ +module_param(hdr_lane_num, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(hdr_lane_num, "sensor output lane number"); +int i2c_slave_id = 0;\ +module_param(i2c_slave_id, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);\ +MODULE_PARM_DESC(i2c_slave_id, "sensor i2c slave id"); + +#define SENSOR_DRV_ENTRY_IMPL_END(Name,LinearEntry,HdrSefEntry,HdrLefEntry) \ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID<4;++nCamID)\ + {\ + if((chmap>>nCamID)&0x1)\ + {\ + if(p0){ DrvRegisterSensorDriver(nCamID, LinearEntry);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p1){ DrvRegisterPlaneDriver(nCamID, 1, HdrSefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){ DrvRegisterPlaneDriver(nCamID, 0, HdrLefEntry);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + pr_info("sensordrv exit");\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +#define SENSOR_DRV_PARAM_MCLK() (mclk) +#define SENSOR_USLEEP_(us) CamOsUsSleep(us) +#define SENSOR_MSLEEP_(ms) CamOsMsSleep(ms) + +/*Extension version*/ +#define SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(Name) SENSOR_DRV_ENTRY_IMPL_BEGIN(Name) + +#define MAX_CAMID_LEN 4 +#define SENSOR_DRV_ENTRY_IMPL_END_EX(Name,LinearEntry,HdrSefEntry,HdrLefEntry,PrivateDataType) \ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = HdrSefEntry;\ + void* p2 = HdrLefEntry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 1, HdrSefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s SEF to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 0, HdrLefEntry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s LEF to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + CamOsMemRelease((void*)g_pData[0][nCamID]);\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + CamOsMemRelease((void*)g_pData[1][nCamID]);\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +//define 3 ch AHD application impl +#define SENSOR_DRV_ENTRY_3CHAHD_IMPL_END_EX(Name,LinearEntry,AhdCh0Entry,AhdCh1Entry, AhdCh2Entry,PrivateDataType)\ +static PrivateDataType* g_pData[2][MAX_CAMID_LEN] = {{0,0,0,0}, {0,0,0,0}};\ +static int __init Name##_init_driver(void)\ +{\ + int nCamID=0;\ + void* p0 = LinearEntry;\ + void* p1 = AhdCh0Entry;\ + void* p2 = AhdCh1Entry;\ + void* p3 = AhdCh2Entry;\ + if(DrvSensorHandleVer(CUS_CAMSENSOR_HANDLE_MAJ_VER, CUS_CAMSENSOR_HANDLE_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorIFVer(CUS_CAMSENSORIF_MAJ_VER, CUS_CAMSENSORIF_MIN_VER)==FAIL)\ + return FAIL;\ + if(DrvSensorI2CVer(CUS_CAMSENSOR_I2C_MAJ_VER, CUS_CAMSENSOR_I2C_MIN_VER)==FAIL)\ + return FAIL;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(p0){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + DrvRegisterSensorDriverEx(nCamID, LinearEntry,pData);\ + DrvRegisterSensorI2CSlaveID(nCamID, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s linear to sensor pad %d\n",__FUNCTION__, nCamID);\ + g_pData[0][nCamID] = pData;\ + }\ + if(p1||p2||p3){\ + void* pData = CamOsMemAlloc(sizeof(PrivateDataType));\ + memset(pData,0,sizeof(PrivateDataType));\ + if(p1){\ + DrvRegisterPlaneDriverEx(nCamID, 0, AhdCh0Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 0, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD0 to vif sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p2){\ + DrvRegisterPlaneDriverEx(nCamID, 1, AhdCh1Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 1, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD1 to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + if(p3){\ + DrvRegisterPlaneDriverEx(nCamID, 2, AhdCh2Entry,pData);\ + DrvRegisterPlaneI2CSlaveID(nCamID, 2, (i2c_slave_id>>(nCamID*8))&0xFF);\ + pr_info("Connect %s AHD2 to sensor pad %d\n",__FUNCTION__, nCamID);\ + }\ + g_pData[1][nCamID] = pData;\ + }\ + }\ + }\ + return 0;\ +}\ +static void __exit Name##_exit_driver(void)\ +{\ + int nCamID=0;\ + for(nCamID=0;nCamID>nCamID)&0x1)\ + {\ + if(g_pData[0][nCamID] || g_pData[1][nCamID])\ + {\ + DrvUnregisterSensorDriverEx(nCamID);\ + if(g_pData[0][nCamID]){\ + CamOsMemRelease((void*)g_pData[0][nCamID]);\ + g_pData[0][nCamID] = 0;\ + }\ + if(g_pData[1][nCamID]){\ + CamOsMemRelease((void*)g_pData[1][nCamID]);\ + g_pData[1][nCamID] = 0;\ + }\ + }\ + }\ + }\ +}\ +subsys_initcall(Name##_init_driver);\ +module_exit(Name##_exit_driver);\ +MODULE_DESCRIPTION("Sensor_"#Name);\ +MODULE_AUTHOR("SigmaStar");\ +MODULE_LICENSE("Proprietary"); + +#endif //end of CAM_OS_LINUX_KERNEL + + +#endif //endif _SENSOR_OS_WRAPPER_H_ diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_init_table.h b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_init_table.h new file mode 100644 index 00000000..10368d9e --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/drv_sensor_init_table.h @@ -0,0 +1,114 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifndef _DRV_SENSOR_INIT_H_ +#define _DRV_SENSOR_INIT_H_ + +//#define SENSOR_INIT_CMDQ_MODE +#define SENSOR_INIT_DRV_MODE + +/* for sensor driver */ +#define I2C_1A1B_W(reg,val) {(reg),(val)} +#define CMDQ_DELAY_MS(ms) {(0xFFFF),(ms)} + +#define I2CM_1A1D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_1A1D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_1A1D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define I2CM_1A1D_W_BURST4(slave_addr,reg,d0,d1,d2,d3) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)} + +#define I2CM_1A1D_W_BURST5(slave_addr,reg,d0,d1,d2,d3,d4) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)} + +#define I2CM_1A1D_W_BURST6(slave_addr,reg,d0,d1,d2,d3,d4,d5) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)} + +#define I2CM_1A1D_W_BURST7(slave_addr,reg,d0,d1,d2,d3,d4,d5,d6) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)},\ + {(reg)+6,(d6)} + +#define I2CM_2A1D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_2A1D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_2A1D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define I2CM_2A1D_W_BURST4(slave_addr,reg,d0,d1,d2,d3) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)} + +#define I2CM_2A1D_W_BURST5(slave_addr,reg,d0,d1,d2,d3,d4) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)} + +#define I2CM_2A1D_W_BURST6(slave_addr,reg,d0,d1,d2,d3,d4,d5) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)},\ + {(reg)+3,(d3)},\ + {(reg)+4,(d4)},\ + {(reg)+5,(d5)} + +#define I2CM_2A2D_W(slave_addr,reg,val) \ + {(reg),(val)} + +#define I2CM_2A2D_W_BURST2(slave_addr,reg,d0,d1) \ + {(reg),(d0)},\ + {(reg)+1,(d1)} + +#define I2CM_2A2D_W_BURST3(slave_addr,reg,d0,d1,d2) \ + {(reg),(d0)},\ + {(reg)+1,(d1)},\ + {(reg)+2,(d2)} + +#define SENSOR_INIT_TABLE I2C_ARRAY + +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/sensor_i2c_api.h b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/sensor_i2c_api.h new file mode 100644 index 00000000..4de7027c --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/include/sensor_i2c_api.h @@ -0,0 +1,168 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +/*! @file isp_i2c_api.h + @brief This file contains Infinity ISP I2C basic API. +*/ + +/** @defgroup group1 ISP I2C API +* @{ +*/ +#ifndef ISP_I2C_API_H +#define ISP_I2C_API_H + +#define SENSOR_I2C_SUCCESS (0) +#define SENSOR_I2C_FAIL (-1) +#define SENSOR_I2C_NOT_SUPPORT (-2) + +/**@brief handle version info */ +typedef struct _version_info{ + u16 major; + u16 minor; +}__attribute__((packed, aligned(1))) version_info; + +/*! @brief I2C API handle.*/ +struct __i2c_handle_t; + +/*! @brief I2C batch read/write data.*/ +typedef struct _I2C_ARRAY{ + u16 reg; /**< Register address.*/ + u16 data; /**< Data.*/ +} I2C_ARRAY; + +/*! @brief I2C burst read/write data.*/ +typedef struct _I2C_ARRAY_BURST{ + u16 reg; /**< Register address.*/ + u16 *data; /**< Data.*/ +} I2C_ARRAY_BURST; + +/*! @brief I2C data direction*/ +typedef enum { + I2C_RW_R, /**< Data direction read.*/ + I2C_RW_W,/**< Data direction write.*/ +} I2C_RW; + +/*! @brief Use for i2c_array_rw only */ +typedef struct _I2C_CPX_ARRAY{ + I2C_RW rw; /**< Data direction */ + u16 reg; /**< Device register address */ + u16 data; /**< Data write to device or read from device*/ +}__attribute__((packed, aligned(1))) I2C_CPX_ARRAY; + +/*! @brief Internal use for I2C API*/ +typedef enum { + I2C_FMT_A8D8, /**< 8 bits Address, 8 bits Data */ + I2C_FMT_A16D8,/**< 16 bits Address 8 bits Data */ + I2C_FMT_A8D16,/**< 8 bits Address 16 bits Data */ + I2C_FMT_A16D16,/**< 16 bits Address 16 bits Data */ + I2C_FMT_END/**< Reserved */ +} ISP_I2C_FMT; + +/*! @brief ISP_I2C_MODE Internal use for I2C API*/ +typedef enum { + I2C_LEGACY_MODE, /**< Do not use */ + I2C_NORMAL_MODE /**< Sensor driver can only use I2C_NORMAL_MODE */ +} ISP_I2C_MODE; + + +/*! @brief app_i2c_cfg I2C setting for sensor and bus.*/ +typedef struct _app_i2c_cfg{ + ISP_I2C_MODE mode; //!< I2C_NORMAL_MODE only + ISP_I2C_FMT fmt; //!< I2C data format + u32 speed; //!< I2C clock in Hz + u16 address; //!< Sensor slave address , bit[7~1] are available, bit[0] user don't care + u16 reserved; +}__attribute__((packed, aligned(1))) app_i2c_cfg; + +/*! @brief The interface of I2C APIs export to user*/ +typedef struct _i2c_handle_t { + //int version; + version_info version; + void *pdata; //i2c_private_data + + u32 nSensorID; + /** @brief Open isp i2c port. This function must be called before using isp I2C APIs. + Call i2c_close to close isp i2c port and allocated resource. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C initial configuration. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_open)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg); + + /** @brief Close isp I2C port. Call this functon to release resource which allocated form i2c_open. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C configuration mode and spped are necessary in this stage. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_close)(struct _i2c_handle_t* handle ); + + /** @brief Write single data to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] reg Device register address address width depend on cfg->fmt. + @param[in] data Data to write, data width depend on cfg->fmt. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_tx)(struct _i2c_handle_t* handle , app_i2c_cfg *cfg, u16 reg, u16 data); + + /** @brief Read single data from device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] reg Device register address address width depend on cfg->fmt. + @param[out] data Data buffer for read, data width depend on cfg->fmt. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, u16 reg, volatile u16 *data); + + /** @brief Batch write to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_tx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY *pdata, u32 len); + + /** @brief Burst write to device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_burst_tx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY_BURST *pdata, u32 len); + + int (*i2c_burst_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY_BURST *pdata, u32 len); + /** @brief Batch read from device. + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[out] pdata Data array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_rx)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_ARRAY *pdata, u32 len); + + /** @brief Composite batch read/write + @param[in] handle Handle to isp i2c api. + @param[in] cfg I2C config, fmd and address are necessary in this stage. + @param[in][out] pdata Data description array. + @param[in] len Array size. + @retval SENSOR_I2C_SUCCESS or SENSOR_I2C_FAIL if error occurs. + */ + int (*i2c_array_rw)(struct _i2c_handle_t* handle, app_i2c_cfg *cfg, I2C_CPX_ARRAY *pdata, u32 len); +} i2c_handle_t; + +/** @} */ // end of ISP I2C API + +#endif diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx274_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx274_mipi.c new file mode 100644 index 00000000..ae86d60a --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx274_mipi.c @@ -0,0 +1,4112 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX274_HDR); + +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (4) +//#define SENSOR_MIPI_HDR_MODE (1) //0: Non-HDR mode. 1:Sony DOL mode +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + +//#undef SENSOR_DBG +//#define SENSOR_DBG 0 + +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// �@// +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define F_number 22 // CFG, demo module +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_12 //CFG //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAPREC_HDR_DOL CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //CFG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_RG//CUS_BAYER_GR +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +//#define SENSOR_MAX_GAIN 350 // max sensor again, a-gain * conversion-gain*d-gain//51db +//#define SENSOR_MAX_GAIN 22.5 // max sensor again, a-gain * conversion-gain*d-gain*expand gain//63db +#define SENSOR_MAX_GAIN (1412 * 1024) +#define SENSOR_MIN_GAIN (1 * 1024) +#define lane_number 4 +#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_24MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_24MHZ + +u32 Preview_line_period; +u32 vts_30fps; + +u32 Preview_line_period_HDR_DOL; +u32 vts_30fps_HDR_DOL; + +#define Preview_WIDTH 3840 //resolution Width when preview +#define Preview_HEIGHT 2160 //resolution Height when preview +#define Preview_MAX_FPS 15 //fastest preview FPS +#define Preview_MIN_FPS 3 //slowest preview FPS + +#define SENSOR_I2C_ADDR 0x34 //I2C slave address +#define SENSOR_I2C_SPEED 200000 //300000// 240000 //I2C speed, 60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG +//static int drv_Fnumber = 22; + +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y +#define Preview_CROP_START_Y_DOL 8 +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_SEF_Binning(ms_cus_sensor *handle, u32 us); + +CUS_CAMSENSOR_CAP sensor_cap = { + .length = sizeof(CUS_CAMSENSOR_CAP), + .version = 0x0001, +}; + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool dirty; + I2C_ARRAY vwinpos_nor[2]; //normal + I2C_ARRAY vwinpos_inv[2]; //inverted + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tGain_reg[3]; + I2C_ARRAY tExpo_reg[2]; + I2C_ARRAY tExpo_shr_dol1_reg[2]; + I2C_ARRAY tExpo_rhs1_reg[2]; + I2C_ARRAY tExpo_shr_dol2_reg[2]; + CUS_CAMSENSOR_ORIT cur_orien; + int vts_to_rhs1; +} imx274_params; +// set sensor ID address and data, + +const I2C_ARRAY Sensor_id_table[] = +{ + {0x3004, 0x03}, // {address of ID, ID }, + {0x3005, 0x31}, +}; + +const I2C_ARRAY Sensor_init_table_HDR_DOL_4lane_4k15fps[] = +{ +#if 1 //DOL mode, MIPI clock 720M, VMAX 2310 @15fps + {0x3000, 0x12}, //standby + {0x3120, 0xF0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x77}, + {0x3135, 0x00}, + {0x3136, 0x67}, + {0x3137, 0x00}, + {0x3138, 0x37}, + {0x3139, 0x00}, + {0x313a, 0x37}, + {0x313b, 0x00}, + {0x313c, 0x37}, + {0x313d, 0x00}, + {0x313e, 0xdf}, + {0x313f, 0x00}, + {0x3140, 0x37}, + {0x3141, 0x00}, + {0x3142, 0x2f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, +//mode registers 15fps + {0x3004, 0x06},//shutter and gain + {0x3005, 0x01}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x31}, + {0x301A, 0x00}, + {0x3032, 0x40}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x31}, + {0x3042, 0x08}, + {0x3043, 0x02}, + + {0x306b, 0x05}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x01}, + {0x30e9, 0x01}, + + {0x30ee, 0x01}, + {0x30f6, 0x20},//HMAX + {0x30f7, 0x08}, + {0x30f8, 0x06},//VMAX + {0x30f9, 0x09}, + {0x30fa, 0x00},// + {0x3130, 0x86}, + {0x3131, 0x08}, + {0x3132, 0x00}, + {0x3133, 0x00}, + + {0x3342, 0x0a}, + {0x3343, 0x00}, + {0x3344, 0x16}, + {0x3345, 0x00}, + + {0x33a6, 0x01}, + {0x3528, 0x0e}, + {0x3554, 0x1f}, + {0x3555, 0x01}, + {0x3556, 0x01}, + {0x3557, 0x01}, + {0x3558, 0x01}, + {0x3559, 0x00}, + {0x355a, 0x00}, + {0x35ba, 0x0e}, + {0x366a, 0x1b}, + {0x366b, 0x1a}, + {0x366c, 0x19}, + {0x366d, 0x17}, + {0x3a41, 0x08}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + + //{0x300a, 0x80},//analog gain yc add + // {0x300b, 0x00},//yc add + //{0x3012, 0x05},//digital gain + + //{0x300d, 0xff},//MSB + //{0x300c, 0x02}, + + {0x300c, 0x08},//yc add + {0x300d, 0x01},//yc add + + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x02},//?? + {0xffff, 0x07},//delay >=7ms + + // {0x303c, 0x11},//test pattern + // {0x303d, 0x0a}, + + //setting3 + + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + //{0x312e, 0x01}, + //{0x3aa2, 0x01}, + + // {0x3001, 0x06}, // ?��?MIPI 2lane Mode Change +#endif +}; + +const I2C_ARRAY Sensor_init_table_HDR_DOL_4lane_4k20fps[] = +{ +#if 1 //DOL mode, MIPI clock 1152M, VMAX 2500 @20fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + + {0x3134, 0x8f}, + {0x3135, 0x00}, + {0x3136, 0x87}, + {0x3137, 0x00}, + {0x3138, 0x57}, + {0x3139, 0x00}, + {0x313a, 0x4f}, + {0x313b, 0x00}, + {0x313c, 0x4f}, + {0x313d, 0x00}, + {0x313e, 0x3f}, + {0x313f, 0x01}, + {0x3140, 0x57}, + {0x3141, 0x00}, + {0x3142, 0x47}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + + {0x3004, 0x06},//shutter and gain + {0x3005, 0x01}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300C, 0xE0},//yc add + {0x300D, 0x05},//yc add + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x31}, + {0x301A, 0x00}, + {0x3032, 0x40}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x31}, + {0x3042, 0x68}, + {0x3043, 0x01}, + + {0x306b, 0x05}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x01}, + {0x30e9, 0x01}, + + {0x30ee, 0x01}, + {0x30f6, 0xa0},//HMAX + {0x30f7, 0x05}, + {0x30f8, 0xc4},//VMAX + {0x30f9, 0x09}, + {0x30fa, 0x00},// + {0x3130, 0x86}, + {0x3131, 0x08}, + {0x3132, 0x00}, + {0x3133, 0x00}, + + {0x3342, 0x0a}, + {0x3343, 0x00}, + {0x3344, 0x16}, + {0x3345, 0x00}, + + {0x33a6, 0x01}, + {0x3528, 0x0e}, + {0x3554, 0x1f}, + {0x3555, 0x01}, + {0x3556, 0x01}, + {0x3557, 0x01}, + {0x3558, 0x01}, + {0x3559, 0x00}, + {0x355a, 0x00}, + {0x35ba, 0x0e}, + {0x366a, 0x1b}, + {0x366b, 0x1a}, + {0x366c, 0x19}, + {0x366d, 0x17}, + {0x3a41, 0x08}, + {0xffff, 0x0a},//delay >=10ms + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + +#endif +}; + +const I2C_ARRAY Sensor_init_table_HDR_DOL_4lane_4k30fps[] = +{ +#if 1 //DOL mode, MIPI clock 1440M, VMAX 2275 @30fps + {0x3000, 0x12}, //standby + {0x3120, 0xF0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + + {0x3134, 0xa7}, + {0x3135, 0x00}, + {0x3136, 0x9f}, + {0x3137, 0x00}, + {0x3138, 0x6f}, + {0x3139, 0x00}, + {0x313a, 0x5f}, + {0x313b, 0x00}, + {0x313c, 0x5f}, + {0x313d, 0x00}, + {0x313e, 0x7f}, + {0x313f, 0x01}, + {0x3140, 0x6f}, + {0x3141, 0x00}, + {0x3142, 0x4f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + + {0x3004, 0x05},//shutter and gain + {0x3005, 0x01}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300C, 0xFF}, + {0x300D, 0x07}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x31}, + {0x301A, 0x00}, + {0x3032, 0x40}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x31}, + {0x3042, 0x07}, + {0x3043, 0x01}, + + {0x306b, 0x05}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x01}, + {0x30e9, 0x01}, + + {0x30ee, 0x01}, + {0x30f6, 0x20},//HMAX + {0x30f7, 0x04}, + {0x30f8, 0xe3},//VMAX + {0x30f9, 0x08}, + {0x30fa, 0x00},// + {0x3130, 0x86}, + {0x3131, 0x08}, + {0x3132, 0x7E}, + {0x3133, 0x08}, + + {0x3342, 0x0a}, + {0x3343, 0x00}, + {0x3344, 0x16}, + {0x3345, 0x00}, + + {0x33a6, 0x01}, + {0x3528, 0x0e}, + {0x3554, 0x1f}, + {0x3555, 0x01}, + {0x3556, 0x01}, + {0x3557, 0x01}, + {0x3558, 0x01}, + {0x3559, 0x00}, + {0x355a, 0x00}, + {0x35ba, 0x0e}, + {0x366a, 0x1b}, + {0x366b, 0x1a}, + {0x366c, 0x19}, + {0x366d, 0x17}, + {0x3a41, 0x08}, + {0xffff, 0x0a},//delay >=10ms + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x02},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + +#endif +}; + + + +const I2C_ARRAY Sensor_init_table_HDR_DOL_4lane_2M30fps[] = +{ +#if 1 //H/V 2/2 line-binning DOL mode, MIPI clock 1152M, VMAX 2310 @30fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x8f}, + {0x3135, 0x00}, + {0x3136, 0x87}, + {0x3137, 0x00}, + {0x3138, 0x57}, + {0x3139, 0x00}, + {0x313a, 0x4f}, + {0x313b, 0x00}, + {0x313c, 0x4f}, + {0x313d, 0x00}, + {0x313e, 0x3f}, + {0x313f, 0x00}, + {0x3140, 0x57}, + {0x3141, 0x00}, + {0x3142, 0x47}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + +//mode registers 30fps + {0x3004, 0x07},//shutter and gain + {0x3005, 0x21}, + {0x3006, 0x00}, + {0x3007, 0x11}, + + {0x300C, 0x1F}, + {0x300D, 0x08}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x31}, + {0x301A, 0x00}, + {0x3032, 0x40}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x31}, + {0x3042, 0x04}, + {0x3043, 0x01}, + + {0x306b, 0x05}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x02}, + {0x30e9, 0x01}, + + {0x30ee, 0x01}, + {0x30f6, 0x10},//HMAX[7:0] + {0x30f7, 0x04},//HMAX[15:8] + {0x30f8, 0x06},//VMAX[7:0] + {0x30f9, 0x09},//VMAX[15:8] + {0x30fa, 0x00},//VMAX[19:16] + {0x3130, 0x4e}, + {0x3131, 0x04}, + {0x3132, 0x00}, + {0x3133, 0x00}, + + {0x3342, 0x0a}, + {0x3343, 0x00}, + {0x3344, 0x1a}, + {0x3345, 0x00}, + + {0x33a6, 0x01}, + {0x3528, 0x0e}, + {0x3554, 0x00}, + {0x3555, 0x01}, + {0x3556, 0x01}, + {0x3557, 0x01}, + {0x3558, 0x01}, + {0x3559, 0x00}, + {0x355a, 0x00}, + {0x35ba, 0x0e}, + {0x366a, 0x1b}, + {0x366b, 0x1a}, + {0x366c, 0x19}, + {0x366d, 0x17}, + {0x3a41, 0x08}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + + //{0x300a, 0x80},//analog gain yc add + // {0x300b, 0x00},//yc add + //{0x3012, 0x05},//digital gain + + //{0x300d, 0xff},//MSB + //{0x300c, 0x02}, + + //{0x300c, 0x08},//yc add + //{0x300d, 0x01},//yc add + + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + // {0x303c, 0x11},//test pattern + // {0x303d, 0x0a}, + + //setting3 + + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + //{0x312e, 0x01}, + //{0x3aa2, 0x01}, + + {0x3001, 0x10}, //terry +#endif +}; + + +const I2C_ARRAY Sensor_init_table_4lane_4K15fps[] = +{ +//Linear mode, MIPI clock 720M, VMAX 8008 @15fps + {0x3000, 0x12}, //standby + {0x3120, 0xF0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x77}, + {0x3135, 0x00}, + {0x3136, 0x67}, + {0x3137, 0x00}, + {0x3138, 0x37}, + {0x3139, 0x00}, + {0x313a, 0x37}, + {0x313b, 0x00}, + {0x313c, 0x37}, + {0x313d, 0x00}, + {0x313e, 0xdf}, + {0x313f, 0x00}, + {0x3140, 0x37}, + {0x3141, 0x00}, + {0x3142, 0x2f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, +//mode registers 15fps + {0x3004, 0x00},//shutter and gain + {0x3005, 0x07}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x00}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x2e},//HMAX + {0x30f7, 0x04}, + {0x30f8, 0x86},//VMAX + {0x30f9, 0x11}, + {0x30fa, 0x00},// + {0x3130, 0xaa}, + {0x3131, 0x08}, + {0x3132, 0x9a}, + {0x3133, 0x08}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x10}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + + //{0x300a, 0x80},//analog gain yc add + // {0x300b, 0x00},//yc add + //{0x3012, 0x05},//digital gain + + //{0x300d, 0xff},//MSB + //{0x300c, 0x02}, + + {0x300c, 0x08},//yc add + {0x300d, 0x01},//yc add + + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x02},//?? + {0xffff, 0x07},//delay >=7ms + + // {0x303c, 0x11},//test pattern + // {0x303d, 0x0a}, + + //setting3 + + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + //{0x312e, 0x01}, + //{0x3aa2, 0x01}, + + // {0x3001, 0x06}, // ?��?MIPI 2lane Mode Change +}; + +const I2C_ARRAY Sensor_init_table_4lane_4K20fps[] = +{ +//Linear mode, MIPI clock 576Mbps, VMAX 4500 @20fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x5f}, + {0x3135, 0x00}, + {0x3136, 0x47}, + {0x3137, 0x00}, + {0x3138, 0x27}, + {0x3139, 0x00}, + {0x313a, 0x27}, + {0x313b, 0x00}, + {0x313c, 0x27}, + {0x313d, 0x00}, + {0x313e, 0x97}, + {0x313f, 0x00}, + {0x3140, 0x27}, + {0x3141, 0x00}, + {0x3142, 0x1f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, +//mode registers 15fps + {0x3004, 0x00},//shutter and gain + {0x3005, 0x07}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x00}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x20},//HMAX + {0x30f7, 0x03}, + {0x30f8, 0x94},//VMAX + {0x30f9, 0x11}, + {0x30fa, 0x00},// + {0x3130, 0xaa}, + {0x3131, 0x08}, + {0x3132, 0x9a}, + {0x3133, 0x08}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x10}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + + //{0x300a, 0x80},//analog gain yc add + // {0x300b, 0x00},//yc add + //{0x3012, 0x05},//digital gain + + {0x300d, 0xff},//MSB + {0x300c, 0x02}, + + //{0x300c, 0x08},//yc add + //{0x300d, 0x01},//yc add + + + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + // {0x303c, 0x11},//test pattern + // {0x303d, 0x0a}, + + //setting3 + + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + //{0x312e, 0x01}, + //{0x3aa2, 0x01}, + + // {0x3001, 0x06}, // ?��?MIPI 2lane Mode Change +}; + +const I2C_ARRAY Sensor_init_table_4lane_5M30fps[] = +{ +//Linear mode, MIPI clock 576Mbps, VMAX 4620 @30fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x5f}, + {0x3135, 0x00}, + {0x3136, 0x47}, + {0x3137, 0x00}, + {0x3138, 0x27}, + {0x3139, 0x00}, + {0x313a, 0x27}, + {0x313b, 0x00}, + {0x313c, 0x27}, + {0x313d, 0x00}, + {0x313e, 0x97}, + {0x313f, 0x00}, + {0x3140, 0x27}, + {0x3141, 0x00}, + {0x3142, 0x1f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, +//mode registers 5M@30fps + {0x3004, 0x00},//shutter and gain + {0x3005, 0x07}, + {0x3006, 0x00}, + {0x3007, 0xa2}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x01}, + {0x3038, 0x70}, + {0x3039, 0x02},//?? + {0x303a, 0xa8}, + {0x303b, 0x0c}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x01}, + {0x30de, 0x6c}, + {0x30df, 0x00}, + {0x30e0, 0x36},//inverted 0xca + {0x30e1, 0x00},//inverted 0x0f + {0x30e2, 0x00}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x08},//HMAX + {0x30f7, 0x02}, + {0x30f8, 0x0c},//VMAX + {0x30f9, 0x12}, + {0x30fa, 0x00},// + {0x3130, 0xd2}, + {0x3131, 0x07}, + {0x3132, 0xc2}, + {0x3133, 0x07}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x10}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + //expo + {0x300d, 0x10},//MSB + {0x300c, 0x39}, + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + +}; + +const I2C_ARRAY Sensor_init_table_4lane_4P8M30fps[] = +{ +//Linear mode, MIPI clock 576Mbps, VMAX 4004 @30fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x5f}, + {0x3135, 0x00}, + {0x3136, 0x47}, + {0x3137, 0x00}, + {0x3138, 0x27}, + {0x3139, 0x00}, + {0x313a, 0x27}, + {0x313b, 0x00}, + {0x313c, 0x27}, + {0x313d, 0x00}, + {0x313e, 0x97}, + {0x313f, 0x00}, + {0x3140, 0x27}, + {0x3141, 0x00}, + {0x3142, 0x1f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + +//mode registers 4P8M@30fps + {0x3004, 0x00},//shutter and gain + {0x3005, 0x07}, + {0x3006, 0x00}, + {0x3007, 0xa2}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x01}, + {0x3038, 0xbc}, + {0x3039, 0x01},//?? + {0x303a, 0x5c}, + {0x303b, 0x0d}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x01}, + {0x30de, 0xfc}, + {0x30df, 0x00}, + {0x30e0, 0x7e},//inverted 0x82 + {0x30e1, 0x00},//inverted 0x0f + {0x30e2, 0x00}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x58},//HMAX + {0x30f7, 0x02}, + {0x30f8, 0xa4},//VMAX + {0x30f9, 0x0f}, + {0x30fa, 0x00},// + {0x3130, 0xb2}, + {0x3131, 0x06}, + {0x3132, 0xa2}, + {0x3133, 0x06}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x10}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + //expo + {0x300d, 0x0e},//MSB + {0x300c, 0x10}, + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + +}; + +const I2C_ARRAY Sensor_init_table_4lane_3P6M30fps[] = +{ +//Linear mode, MIPI clock 576Mbps, VMAX 4620 @30fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x5f}, + {0x3135, 0x00}, + {0x3136, 0x47}, + {0x3137, 0x00}, + {0x3138, 0x27}, + {0x3139, 0x00}, + {0x313a, 0x27}, + {0x313b, 0x00}, + {0x313c, 0x27}, + {0x313d, 0x00}, + {0x313e, 0x97}, + {0x313f, 0x00}, + {0x3140, 0x27}, + {0x3141, 0x00}, + {0x3142, 0x1f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + +//mode registers 3P6M@30fps + {0x3004, 0x00},//shutter and gain + {0x3005, 0x07}, + {0x3006, 0x00}, + {0x3007, 0xa2}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x01}, + {0x3038, 0x7c}, + {0x3039, 0x02},//?? + {0x303a, 0x9c}, + {0x303b, 0x0c}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x01}, + {0x30de, 0x68}, + {0x30df, 0x01}, + {0x30e0, 0xb4},//inverted 0x4c + {0x30e1, 0x00},//inverted 0x0f + {0x30e2, 0x00}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x08},//HMAX + {0x30f7, 0x02}, + {0x30f8, 0x0c},//VMAX + {0x30f9, 0x12}, + {0x30fa, 0x00},// + {0x3130, 0xda}, + {0x3131, 0x05}, + {0x3132, 0xca}, + {0x3133, 0x05}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x10}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + //expo + {0x300d, 0x10},//MSB + {0x300c, 0x39}, + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + +}; + +const I2C_ARRAY Sensor_init_table_4lane_2M60fps[] = +{ +//Linear mode, MIPI clock 576Mbps, VMAX 2310 @60fps + {0x3000, 0x12}, //standby + {0x3120, 0xC0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x5f}, + {0x3135, 0x00}, + {0x3136, 0x47}, + {0x3137, 0x00}, + {0x3138, 0x27}, + {0x3139, 0x00}, + {0x313a, 0x27}, + {0x313b, 0x00}, + {0x313c, 0x27}, + {0x313d, 0x00}, + {0x313e, 0x97}, + {0x313f, 0x00}, + {0x3140, 0x27}, + {0x3141, 0x00}, + {0x3142, 0x1f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, + +//mode registers 2M@60fps + {0x3004, 0x02},//shutter and gain + {0x3005, 0x27}, + {0x3006, 0x00}, + {0x3007, 0x11}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x02},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x07}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00},// + {0x30e1, 0x00},// + {0x30e2, 0x02}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x08},//HMAX + {0x30f7, 0x02}, + {0x30f8, 0x06},//VMAX + {0x30f9, 0x09}, + {0x30fa, 0x00},// + {0x3130, 0x4e}, + {0x3131, 0x04}, + {0x3132, 0x46}, + {0x3133, 0x04}, + + {0x3342, 0xff}, + {0x3343, 0x01}, + {0x3344, 0xff}, + {0x3345, 0x01}, + + {0x33a6, 0x01}, + {0x3528, 0x0f}, + {0x3554, 0x00}, + {0x3555, 0x00}, + {0x3556, 0x00}, + {0x3557, 0x00}, + {0x3558, 0x00}, + {0x3559, 0x1f}, + {0x355a, 0x1f}, + {0x35ba, 0x0f}, + {0x366a, 0x00}, + {0x366b, 0x00}, + {0x366c, 0x00}, + {0x366d, 0x00}, + {0x3a41, 0x08}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + //expo + {0x300d, 0x10},//MSB + {0x300c, 0x39}, + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x03},//?? + {0xffff, 0x07},//delay >=7ms + + //setting3 + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + +}; + +const I2C_ARRAY Sensor_init_table_4lane_4K30fps[] = +{ +//Linear mode, MIPI clock 720Mbps, VMAX 4620 @20fps + {0x3000, 0x12}, //standby + {0x3120, 0xF0}, + {0x3121, 0x00}, + {0x3122, 0x02}, + {0x3123, 0x01},// + {0x3129, 0x9C}, + {0x312a, 0x02}, + {0x312d, 0x02}, + {0x3ac4, 0x01},// + {0x310b, 0x00}, + {0x304c, 0x00}, + {0x304d, 0x03}, + {0x331c, 0x1a}, + {0x331d, 0x00}, + {0x3502, 0x02}, + {0x3529, 0x0e}, + {0x352a, 0x0e}, + {0x352b, 0x0e}, + {0x3538, 0x0e}, + {0x3539, 0x0e}, + {0x3553, 0x00}, + {0x357d, 0x05}, + {0x357f, 0x05}, + {0x3581, 0x04}, + {0x3583, 0x76}, + {0x3587, 0x01}, + {0x35bb, 0x0e}, + {0x35bc, 0x0e}, + {0x35bd, 0x0e}, + {0x35be, 0x0e}, + {0x35bf, 0x0e}, + {0x366e, 0x00}, + {0x366f, 0x00}, + {0x3670, 0x00}, + {0x3671, 0x00}, + {0x30ee, 0x01}, + {0x3304, 0x32}, + {0x3305, 0x00}, + {0x3306, 0x32}, + {0x3307, 0x00}, + {0x3590, 0x32}, + {0x3591, 0x00}, + {0x3686, 0x32}, + {0x3687, 0x00}, + {0x3134, 0x77}, + {0x3135, 0x00}, + {0x3136, 0x67}, + {0x3137, 0x00}, + {0x3138, 0x37}, + {0x3139, 0x00}, + {0x313a, 0x37}, + {0x313b, 0x00}, + {0x313c, 0x37}, + {0x313d, 0x00}, + {0x313e, 0xDF}, + {0x313f, 0x00}, + {0x3140, 0x37}, + {0x3141, 0x00}, + {0x3142, 0x2f}, + {0x3143, 0x00}, + {0x3144, 0x0f}, + {0x3145, 0x00}, + {0x3a86, 0x47}, + {0x3a87, 0x00}, +//mode registers 15fps + {0x3004, 0x01},//shutter and gain + {0x3005, 0x01}, + {0x3006, 0x00}, + {0x3007, 0x02}, + + {0x300E, 0x00}, + {0x300F, 0x00}, + {0x3019, 0x10}, + {0x301A, 0x00}, + {0x3032, 0x08}, + {0x3033, 0x00}, + + {0x3037, 0x00}, + {0x3038, 0x00}, + {0x3039, 0x00},//?? + {0x303a, 0x00}, + {0x303b, 0x00}, + + {0x3041, 0x30}, + {0x3042, 0x08}, + {0x3043, 0x01}, + + {0x306b, 0x05}, + {0x30dd, 0x00}, + {0x30de, 0x00}, + {0x30df, 0x00}, + {0x30e0, 0x00}, + {0x30e1, 0x00}, + {0x30e2, 0x01}, + {0x30e9, 0x00}, + + {0x30ee, 0x01}, + {0x30f6, 0x08},//HMAX + {0x30f7, 0x02}, + {0x30f8, 0x0c},//VMAX + {0x30f9, 0x12}, + {0x30fa, 0x00},// + {0x3130, 0x86}, + {0x3131, 0x08}, + {0x3132, 0x7e}, + {0x3133, 0x08}, + + {0x3342, 0x0a}, + {0x3343, 0x00}, + {0x3344, 0x16}, + {0x3345, 0x00}, + + {0x33a6, 0x01}, + {0x3528, 0x0e}, + {0x3554, 0x1f}, + {0x3555, 0x01}, + {0x3556, 0x01}, + {0x3557, 0x01}, + {0x3558, 0x01}, + {0x3559, 0x00}, + {0x355a, 0x00}, + {0x35ba, 0x0e}, + {0x366a, 0x1b}, + {0x366b, 0x1a}, + {0x366c, 0x19}, + {0x366d, 0x17}, + {0x3a41, 0x08}, + // {0x3045, 0x28},//black level + {0xffff, 0x0a},//delay >=10ms + + //{0x300a, 0x80},//analog gain yc add + // {0x300b, 0x00},//yc add + //{0x3012, 0x05},//digital gain + + //{0x300d, 0xff},//MSB + //{0x300c, 0x02}, + + //{0x300c, 0x08},//yc add + //{0x300d, 0x01},//yc add + + //expo + {0x300d, 0x10},//MSB + {0x300c, 0x3e}, + //setting 2 + {0x3000, 0x00}, + {0x303e, 0x02},//?? + {0xffff, 0x07},//delay >=7ms + + // {0x303c, 0x11},//test pattern + // {0x303d, 0x0a}, + + //setting3 + + {0x30f4, 0x00}, + {0x3018, 0xa2}, + //{0xffff, 0x60},//delay >=96ms + //{0x312e, 0x01}, + //{0x3aa2, 0x01}, + + // {0x3001, 0x06}, // ?��?MIPI 2lane Mode Change +}; + + + +///////////////////////////////////////////////////////////////// +// @@@@@@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + + +const I2C_ARRAY mirr_flip_table[] = +{ + {0x301a, 0x00},//M0F0 + {0x301a, 0x00},//M1F0 + {0x301a, 0x01},//M0F1 + {0x301a, 0x01},//M1F1 + +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +const I2C_ARRAY gain_reg[] = { + {0x300b, 0x00},//high 10~8bit, analog gain + {0x300a, 0x10},//low byte + {0x3012, 0x10},//low bit 0~2 +}; + +static CUS_GAIN_GAP_ARRAY gain_gap_compensate[16] = { //compensate gain gap + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +const I2C_ARRAY expo_reg[] = { + {0x300d, 0x00},//MSB + {0x300c, 0x00}, +}; + +const I2C_ARRAY expo_shr_dol1_reg[] = +{ //SEL + {0x302F, 0x00},//MSB + {0x302E, 0x04}, +}; +const I2C_ARRAY expo_rhs1_reg[] = +{ //SEL + {0x3033, 0x00},//MSB + {0x3032, 0x08}, +}; +const I2C_ARRAY expo_shr_dol2_reg[] = +{ //LEF + {0x3031, 0x05},//MSB + {0x3030, 0x43}, +}; + +const I2C_ARRAY vts_reg[] = { + {0x30fa, 0x00},//bit0-3-->MSB + {0x30f9, 0x09}, + {0x30f8, 0x06}, +}; + +I2C_ARRAY PatternTbl[] = { + //pattern mode + {0x303c, 0x11},//test pattern + {0x303d, 0x0a}, +}; + +CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +int cus_camsensor_release_handle(ms_cus_sensor *handle); + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //Sensor power on sequence + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, !handle->reset_POLARITY); + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + //sensor_if->SetCSI_VC0HSmode(handle,PACKET_FOOTER_EDGE); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->Reset(idx, handle->reset_POLARITY); + SENSOR_UDELAY(20); + + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + SENSOR_UDELAY(20); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_UDELAY(20); + + SENSOR_DMSG("[%s] reset high\n", __FUNCTION__); + sensor_if->Reset(idx, !handle->reset_POLARITY); + + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_UDELAY(20); + + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + imx274_params *params = (imx274_params *)handle->private_data; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + + params->cur_orien = CUS_ORIT_M0F0; + + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if( SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + continue; + + } + + //convert sensor id to u32 format + for(i=0;iprivate_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K15fps);i++) + { + if(Sensor_init_table_4lane_4K15fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K15fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K15fps[i].reg, Sensor_init_table_4lane_4K15fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_4K20fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K20fps);i++) + { + if(Sensor_init_table_4lane_4K20fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K20fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K20fps[i].reg, Sensor_init_table_4lane_4K20fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_5M30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5M30fps);i++) + { + if(Sensor_init_table_4lane_5M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5M30fps[i].reg, Sensor_init_table_4lane_5M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_4P8M30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4P8M30fps);i++) + { + if(Sensor_init_table_4lane_4P8M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4P8M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4P8M30fps[i].reg, Sensor_init_table_4lane_4P8M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_3P6M30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_3P6M30fps);i++) + { + if(Sensor_init_table_4lane_3P6M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_3P6M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_3P6M30fps[i].reg, Sensor_init_table_4lane_3P6M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_2M60fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_2M60fps);i++) + { + if(Sensor_init_table_4lane_2M60fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_2M60fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_2M60fps[i].reg, Sensor_init_table_4lane_2M60fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + + +static int pCus_init_mipi4lane_linear_4K30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = handle->sensor_if_api; + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K30fps);i++) + { + if(Sensor_init_table_4lane_4K30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K30fps[i].reg, Sensor_init_table_4lane_4K30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + pCus_SetOrien(handle, params->cur_orien); + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + + +static int pCus_init_mipi4lane_HDR_DOL_4k15fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + int i,cnt=0; + + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane_4k15fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + } + else + { + cnt = 0; + SENSOR_DMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg,Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane_4k15fps -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, &sen_data ); + //UartSendTrace("IMX274 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data, sen_data); + } + } + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + + //MSG("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} + + +static int pCus_init_mipi4lane_HDR_DOL_4k20fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + int i,cnt=0; + + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane_4k20fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane_4k20fps[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane_4k20fps[i].data); + } + else + { + cnt = 0; + SENSOR_DMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane_4k20fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k20fps[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane_4k20fps[i].reg,Sensor_init_table_HDR_DOL_4lane_4k20fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane_4k20fps -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, &sen_data ); + //UartSendTrace("IMX274 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data, sen_data); + } + } + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + + //MSG("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} + +static int pCus_init_mipi4lane_HDR_DOL_4k30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + int i,cnt=0; + + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane_4k30fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane_4k30fps[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane_4k30fps[i].data); + } + else + { + cnt = 0; + SENSOR_DMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane_4k30fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k30fps[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane_4k30fps[i].reg,Sensor_init_table_HDR_DOL_4lane_4k30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane_4k25fps -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, &sen_data ); + //UartSendTrace("IMX274 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane_4k15fps[i].reg, Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data, sen_data); + } + } + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + + //MSG("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} + + +static int pCus_init_mipi4lane_HDR_DOL_2M30fps(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + int i,cnt=0; + + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane_2M30fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane_2M30fps[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane_4k15fps[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane_2M30fps[i].data); + } + else + { + cnt = 0; + //SENSOR_IMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane_2M30fps[i].reg, Sensor_init_table_HDR_DOL_4lane_2M30fps[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane_2M30fps[i].reg,Sensor_init_table_HDR_DOL_4lane_2M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane_2M30fps -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane_2M30fps[i].reg, &sen_data ); + //UartSendTrace("IMX274 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane_2M30fps[i].reg, Sensor_init_table_HDR_DOL_4lane_2M30fps[i].data, sen_data); + } + } + + params->tVts_reg[0].data =(u16)((params->expo.vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((params->expo.vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((params->expo.vts >> 0) & 0x00ff); + + //MSG("[%s:%d]Sensor init success!!\n", __FUNCTION__, __LINE__); + return SUCCESS; +} + + +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + imx274_params *params = (imx274_params *)handle->private_data; + + if (res_idx >= num_res) { + return FAIL; + } + handle->data_prec = SENSOR_DATAPREC; + switch (res_idx) { + case 0: //"3840x2160@15fps" + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K15fps; + vts_30fps = 4486; + params->expo.vts = vts_30fps; + params->expo.fps = 15; + Preview_line_period = 14861; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + break; + case 1: //"3840x2160@20fps" + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K20fps; + vts_30fps = 4500; + params->expo.vts = vts_30fps; + params->expo.fps = 20; + Preview_line_period = 11111; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + break; + case 2: //"2592x1944@30fps" + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_5M30fps; + vts_30fps = 4620; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 7222; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0x36; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0xF; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0xCA; + break; + case 3: //"2944x1656@30fps" + handle->video_res_supported.ulcur_res = 3; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4P8M30fps; + vts_30fps = 4004; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 8333; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0x7E; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0xF; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0x82; + break; + case 4: //"2560x1440@30fps" + handle->video_res_supported.ulcur_res = 4; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_3P6M30fps; + vts_30fps = 4620; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 7222; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0xB4; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0xF; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0x4C; + break; + case 5: //"1920x1080@60fps" + handle->video_res_supported.ulcur_res = 5; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_2M60fps; + vts_30fps = 2310; + params->expo.vts = vts_30fps; + params->expo.fps = 60; + Preview_line_period = 7222; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + break; + case 6: //"3840x2160@30fps" + handle->video_res_supported.ulcur_res = 6; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K30fps; + handle->data_prec = CUS_DATAPRECISION_10; + vts_30fps = 4620; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 7215; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + break; + default: + break; + } + + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + imx274_params *params = (imx274_params *)handle->private_data; + + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_4k15fps; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; + } + vts_30fps_HDR_DOL = (2310+Preview_CROP_START_Y_DOL); + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + Preview_line_period_HDR_DOL = 28879; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + params->vts_to_rhs1 = 2310; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_2M30fps; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF_Binning; + } + vts_30fps_HDR_DOL = 2310; + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 30; + Preview_line_period_HDR_DOL = 14430; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + params->vts_to_rhs1 = 2310; + break; + case 2: + handle->video_res_supported.ulcur_res = 2; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_4k20fps; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; + } + vts_30fps_HDR_DOL = (2500+Preview_CROP_START_Y_DOL); + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 20; + Preview_line_period_HDR_DOL = 19936; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + params->vts_to_rhs1 = 2360; //fix rhs1, align to res 0 + break; + case 3: + handle->video_res_supported.ulcur_res = 3; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_4k30fps; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; + } + vts_30fps_HDR_DOL = (2275+Preview_CROP_START_Y_DOL); + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 30; + Preview_line_period_HDR_DOL = 14652; + params->vwinpos_nor[0].reg = 0x30E1; + params->vwinpos_nor[0].data = 0; + params->vwinpos_nor[1].reg = 0x30E0; + params->vwinpos_nor[1].data = 0; + params->vwinpos_inv[0].reg = 0x30E1; + params->vwinpos_inv[0].data = 0; + params->vwinpos_inv[1].reg = 0x30E0; + params->vwinpos_inv[1].data = 0; + params->vts_to_rhs1 = 2275; + break; + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + short sen_data = 0; + + SensorReg_Read(0x301a, &sen_data);//always success now + + SENSOR_DMSG("mirror:%x\r\n", sen_data & 0x01); + switch(sen_data & 0x01) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x01: + *orit = CUS_ORIT_M0F1; + break; + default: + *orit = CUS_ORIT_M0F0; + break; + } + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx274_params *params = (imx274_params *)handle->private_data; + int table_length = ARRAY_SIZE(mirr_flip_table); + int seg_length=table_length/4; + int i,j; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + switch(orit) + { + case CUS_ORIT_M0F0: + for(i=0,j=0;icur_orien = CUS_ORIT_M0F0; + } + SensorRegArrayW((I2C_ARRAY*)params->vwinpos_nor, ARRAY_SIZE(params->vwinpos_nor)); + break; + + case CUS_ORIT_M1F0: + for(i=seg_length,j=0;icur_orien = CUS_ORIT_M1F0; + } + SensorRegArrayW((I2C_ARRAY*)params->vwinpos_nor, ARRAY_SIZE(params->vwinpos_nor)); + break; + + case CUS_ORIT_M0F1: + for(i=seg_length*2,j=0;icur_orien = CUS_ORIT_M0F1; + } + SensorRegArrayW((I2C_ARRAY*)params->vwinpos_inv, ARRAY_SIZE(params->vwinpos_inv)); + break; + + case CUS_ORIT_M1F1: + for(i=seg_length*3,j=0;icur_orien = CUS_ORIT_M1F1; + } + SensorRegArrayW((I2C_ARRAY*)params->vwinpos_inv, ARRAY_SIZE(params->vwinpos_inv)); + break; + + default : + for(i=0,j=0;icur_orien = CUS_ORIT_M0F0; + } + SensorRegArrayW((I2C_ARRAY*)params->vwinpos_nor, ARRAY_SIZE(params->vwinpos_nor)); + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000))/fps; + + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + params->dirty = true; //reg need to update = true; + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF(ms_cus_sensor *handle, u32 fps) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*(max_fps*1000))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + pCus_SetAEUSecsHDR_DOL_SEF(handle, params->expo.expo_sef_us); + params->dirty = true; //reg need to update = true; + return SUCCESS; +} + + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx274_params *params = (imx274_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty) + { + SensorReg_Write(0x302d,1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + SensorReg_Write(0x302d,0); + params->dirty = false; + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //ISensorIfAPI2 *sensor_if1 = handle->sensor_if_api2; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty) + { + SensorReg_Write(0x302d, 1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_shr_dol2_reg, ARRAY_SIZE(expo_shr_dol2_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_shr_dol1_reg, ARRAY_SIZE(expo_shr_dol1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_rhs1_reg, ARRAY_SIZE(expo_rhs1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorReg_Write(0x302d, 0); + params->dirty = false; + } + break; + default : + break; + } + + return SUCCESS; +} + +static int pCus_GetAEUSecs_hdr_dol_lef(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + // imx274_params *params = (imx274_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0, shr_dol2 = 0; + imx274_params *params = (imx274_params *)handle->private_data; + + // us = 1000000/30; + //lines = us/Preview_line_period_HDR_DOL; + lines = (1000 * us) / Preview_line_period_HDR_DOL; + if (lines > params->expo.vts - 4) { + vts = lines + 4; + } + else{ + vts = params->expo.vts; + } + + // lines=us/Preview_line_period_HDR_DOL; + SENSOR_DMSG("[%s] us %ld, lines %ld, vts %ld\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + + shr_dol2 = vts - lines; + + params->tExpo_shr_dol2_reg[0].data = (shr_dol2 >> 8) & 0x00ff; + params->tExpo_shr_dol2_reg[1].data = (shr_dol2 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x000f; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + //SensorReg_Write(0x3001,1); + //SensorRegArrayW((I2C_ARRAY*)expo_SHS2_reg, ARRAY_SIZE(expo_SHS2_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + //SENSOR_EMSG("[LEF, us:%d, lines:%d, ", us, lines); + //SENSOR_EMSG("vts:%d, shr_dol2:%d]\n", vts, shr_dol2); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_hdr_dol_lef(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0; + u32 rhs1 = 0, shr_dol1 = 0, shr_dol2 = 0; + u32 max_rhs1 = 0; + imx274_params *params = (imx274_params *)handle->private_data; + + params->expo.expo_sef_us = us; + + // us = 1000000/30; + //lines = us/Preview_line_period_HDR_DOL; + lines = (1000 * us) / Preview_line_period_HDR_DOL; + vts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + shr_dol2 = ((params->tExpo_shr_dol2_reg[0].data << 8) | (params->tExpo_shr_dol2_reg[1].data << 0)); + + max_rhs1 = params->vts_to_rhs1 - 2198 - Preview_CROP_START_Y_DOL; + + //rhs1 = ((params->tExpo_rhs1_reg[0].data << 8) | (params->tExpo_rhs1_reg[1].data << 0)); + rhs1 = max_rhs1; + + if((rhs1 - 6) < lines){ + shr_dol1 = 6; + } + else if((rhs1 <= max_rhs1) && (rhs1 <= shr_dol2 - 6)){ + shr_dol1 = rhs1 - lines; + if((shr_dol1 < 6) || (shr_dol1 > (rhs1 - 2))){ //Check boundary + //shs1 = 0; + //UartSendTrace("\n\n[SEF NG1]\n"); + } + } + else{ + //UartSendTrace("\n\n[SEF NG2]\n"); + } + + //SENSOR_EMSG("[SEF, us:%d, lines:%d, ", us, lines); + //SENSOR_EMSG("vts:%d, shr_dol2:%d, ", vts, shr_dol2); + //SENSOR_EMSG("rhs1:%d, shr_dol1:%d]\n", rhs1, shr_dol1); + + params->tExpo_shr_dol1_reg[0].data = (shr_dol1 >> 8) & 0x00ff; + params->tExpo_shr_dol1_reg[1].data = (shr_dol1 >> 0) & 0x00ff; + + params->tExpo_rhs1_reg[0].data = (rhs1 >> 8) & 0x00ff; + params->tExpo_rhs1_reg[1].data = (rhs1 >> 0) & 0x00ff; + + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF_Binning(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0; + u32 rhs1 = 0, shr_dol1 = 0, shr_dol2 = 0; + u32 max_rhs1 = 0; + imx274_params *params = (imx274_params *)handle->private_data; + + // us = 1000000/30; + //lines = us/Preview_line_period_HDR_DOL; + lines = (1000 * us) / Preview_line_period_HDR_DOL; + vts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + shr_dol2 = ((params->tExpo_shr_dol2_reg[0].data << 8) | (params->tExpo_shr_dol2_reg[1].data << 0)); + + max_rhs1 = params->vts_to_rhs1 - 2198 - Preview_CROP_START_Y_DOL; + + //rhs1 = ((params->tExpo_rhs1_reg[0].data << 8) | (params->tExpo_rhs1_reg[1].data << 0)); + rhs1 = max_rhs1; + + if((rhs1 - 4) < lines){ + shr_dol1 = 4; + } + else if((rhs1 <= max_rhs1) && (rhs1 <= shr_dol2 - 4)){ + shr_dol1 = rhs1 - lines; + if((shr_dol1 < 4) || (shr_dol1 > (rhs1 - 2))){ //Check boundary + //shs1 = 0; + //UartSendTrace("\n\n[SEF NG1]\n"); + } + } + else{ + //UartSendTrace("\n\n[SEF NG2]\n"); + } + + //SENSOR_EMSG("[SEF, us:%d, lines:%d, ", us, lines); + //SENSOR_EMSG("vts:%d, shr_dol2:%d, ", vts, shr_dol2); + //SENSOR_EMSG("rhs1:%d, shr_dol1:%d]\n", rhs1, shr_dol1); + + params->tExpo_shr_dol1_reg[0].data = (shr_dol1 >> 8) & 0x00ff; + params->tExpo_shr_dol1_reg[1].data = (shr_dol1 >> 0) & 0x00ff; + + params->tExpo_rhs1_reg[0].data = (rhs1 >> 8) & 0x00ff; + params->tExpo_rhs1_reg[1].data = (rhs1 >> 0) & 0x00ff; + + return SUCCESS; +} + + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 lines = 0; + //int rc = SensorRegArrayR((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + lines |= (u32)(params->tExpo_reg[0].data&0xff)<<8; + lines |= (u32)(params->tExpo_reg[1].data&0xff)<<0; + // lines >>= 4; + // *us = (lines+dummy) * params->expo.us_per_line; + //*us = lines;//(lines*Preview_line_period); + *us = lines*Preview_line_period/1000; + SENSOR_DMSG("[%s] sensor expo lines/us %ld,%ld us\n", __FUNCTION__, lines, *us); + //return rc; + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0; + imx274_params *params = (imx274_params *)handle->private_data; + + params->expo.expo_lef_us = us; + lines=(1000*us)/Preview_line_period; + + if (lines >params->expo.vts-12) { + vts = lines +12; + } + else + vts=params->expo.vts; + +#if 0 + // lines=us/Preview_line_period; + SENSOR_DMSG("[%s] us %ld, lines %ld, vts %ld\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); +#endif + lines=vts-lines; + + params->tExpo_reg[0].data =(u16)((lines>>8) & 0x00ff); + params->tExpo_reg[1].data =(u16)((lines>>0) & 0x00ff); + + params->tVts_reg[0].data =(u16)((vts >> 16) & 0x000f); + params->tVts_reg[1].data = (u16)((vts >> 8) & 0x00ff); + params->tVts_reg[2].data = (u16)((vts >> 0) & 0x00ff); + + //SensorReg_Write(0x302d,1); + //SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = true; + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + imx274_params *params = (imx274_params *)handle->private_data; + //u16 temp_gain; + //double temp_gain_double; + + *gain=params->expo.final_gain; + SENSOR_DMSG("[%s] get gain/regL/regH (1024=1X)= %d/0x%x/0x%x\n", __FUNCTION__, *gain, params->tGain_reg[0].data, params->tGain_reg[1].data); + + return SUCCESS; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u16 gain16; + //double gain_double; + + params->expo.final_gain = gain; + if(gain=SENSOR_MAX_GAIN) + gain=SENSOR_MAX_GAIN; + + gain16=(u16)(2048-((2048*1024)/gain)); + //gain16=(u16)(gain_double*10); + + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + + SENSOR_DMSG("[%s] set gain/reg0/reg1=%d/0x%x/0x%x\n", __FUNCTION__, gain, params->tGain_reg[0].data, params->tGain_reg[1].data); + return SUCCESS; + +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + //extern DBG_ITEM Dbg_Items[DBG_TAG_MAX]; + imx274_params *params = (imx274_params *)handle->private_data; + u32 i; + //double gain_double; + CUS_GAIN_GAP_ARRAY* Sensor_Gain_Linearity; + u16 gain16; + + params->expo.final_gain = gain; + if(gain=SENSOR_MAX_GAIN) + gain=SENSOR_MAX_GAIN; + + //gain_double=(double)gain; + Sensor_Gain_Linearity = gain_gap_compensate; + + for(i = 0; i < sizeof(gain_gap_compensate)/sizeof(CUS_GAIN_GAP_ARRAY); i++){ + //LOGD("GAP:%x %x\r\n",Sensor_Gain_Linearity[i].gain, Sensor_Gain_Linearity[i].offset); + + if (Sensor_Gain_Linearity[i].gain == 0) + break; + if((gain>Sensor_Gain_Linearity[i].gain) && (gain < (Sensor_Gain_Linearity[i].gain + Sensor_Gain_Linearity[i].offset))){ + gain=Sensor_Gain_Linearity[i].gain; + break; + } + } +#if 0 + gain16=(u16)(2048-((2048*1024)/gain)); + //gain16=(u16)(gain_double*10); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB +#else + + if(gain<=23040){ + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x00; + } else if((gain>23040)&&(gain<=46080)){ + gain=gain>>1; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x01; + } else if((gain>46080)&&(gain<=92160)){ + gain=gain>>2; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x02; + } else if ((gain>92160)&&(gain<=184320)){//if((gain>22.5*1024*4)&&(gain<=22.5*1024*8)){ + gain=gain>>3; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x03; + } else if ((gain>184320)&&(gain<=368640)){//if((gain>22.5*1024*8)&&(gain<=22.5*1024*16)){ + gain=gain>>4; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x04; + } else if ((gain>368640)&&(gain<=737280)){//if((gain>22.5*1024*16)&&(gain<=22.5*1024*32)){ + gain=gain>>5; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x05; + } else {//if((gain>22.5*1024*32)&&(gain<=22.5*1024*64)){ + gain=gain>>6; + gain16=(u16)(2048-((2048*1024)/gain)); + params->tGain_reg[0].data=(gain16>>8)&0x07;//MSB + params->tGain_reg[1].data=gain16&0xff;//LSB + params->tGain_reg[2].data=0x06; + } + params->dirty = true; +#endif + + SENSOR_DMSG("[%s] set gain/reg0/reg1=%d/0x%x/0x%x\n", __FUNCTION__, gain, params->tGain_reg[0].data, params->tGain_reg[1].data); + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/30; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min =handle->sat_mingain; + *max = SENSOR_MAX_GAIN; + return SUCCESS; +} + +static int pCus_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period*4; + info->step = Preview_line_period; + return SUCCESS; +} + +static int pCus_poweron_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} +static int pCus_GetSensorID_hdr_dol_lef(ms_cus_sensor *handle, u32 *id) +{ + *id = 0; + return SUCCESS; +} +static int pCus_init_hdr_dol_lef(ms_cus_sensor *handle) +{ + return SUCCESS; +} +#if 0 +static int pCus_GetVideoRes_hdr_dol_lef( ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res ) +{ + *res = &handle->video_res_supported.res[res_idx]; + return SUCCESS; +} + +static int pCus_SetVideoRes_hdr_dol_lef( ms_cus_sensor *handle, u32 res ) +{ + handle->video_res_supported.ulcur_res = 0; //TBD + return SUCCESS; +} +#endif +static int pCus_GetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + *orit = CUS_ORIT_M0F0; + return SUCCESS; +} + +static int pCus_SetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + return SUCCESS; +} + +static int pCus_GetFPS_hdr_dol_lef(ms_cus_sensor *handle) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_hdr_dol_lef(ms_cus_sensor *handle, u32 fps) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*(max_fps*1000))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_lef_us); + params->dirty = true; //reg need to update = true; + return SUCCESS; +} +static int pCus_GetShutterInfo_hdr_dol_lef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL; + return SUCCESS; +} +static int pCus_GetShutterInfo_hdr_dol_sef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + imx274_params *params = (imx274_params *)handle->private_data; + u32 max_rhs1 = params->vts_to_rhs1 - 2198 - Preview_CROP_START_Y_DOL; + + info->max = Preview_line_period_HDR_DOL * max_rhs1; + info->min = (Preview_line_period_HDR_DOL * 2); + info->step = Preview_line_period_HDR_DOL; + return SUCCESS; +} +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + u32 i, j; + + for(i=0,j=0;i< num ;i++,j+=2){ + gain_gap_compensate[i].gain=pArray[i].gain; + gain_gap_compensate[i].offset=pArray[i].offset; + } + + SENSOR_DMSG("[%s]%d, %d, %d, %d\n", __FUNCTION__, num, pArray[0].gain, pArray[1].gain, pArray[num-1].offset); + + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx274_params *params; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx274_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + memcpy(params->tExpo_shr_dol2_reg, expo_shr_dol2_reg, sizeof(expo_shr_dol2_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX274_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + //handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 3864; + handle->video_res_supported.res[0].nOutputHeight= 2202; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = Preview_WIDTH; + handle->video_res_supported.res[1].height = Preview_HEIGHT; + handle->video_res_supported.res[1].max_fps= 20; + handle->video_res_supported.res[1].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[1].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[1].nOutputWidth= 3864; + handle->video_res_supported.res[1].nOutputHeight= 2202; + sprintf(handle->video_res_supported.res[1].strResDesc, "3840x2160@20fps"); + + handle->video_res_supported.num_res = 3; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[2].width = 2592; + handle->video_res_supported.res[2].height = 1944; + handle->video_res_supported.res[2].max_fps= 30; + handle->video_res_supported.res[2].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[2].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[2].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[2].nOutputWidth= 2592; + handle->video_res_supported.res[2].nOutputHeight= 1944; + sprintf(handle->video_res_supported.res[2].strResDesc, "2592x1944@30fps"); + + handle->video_res_supported.num_res = 4; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[3].width = 2944; + handle->video_res_supported.res[3].height = 1656; + handle->video_res_supported.res[3].max_fps= 30; + handle->video_res_supported.res[3].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[3].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[3].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[3].nOutputWidth= 2944; + handle->video_res_supported.res[3].nOutputHeight= 1656; + sprintf(handle->video_res_supported.res[3].strResDesc, "2944x1656@30fps"); + + handle->video_res_supported.num_res = 5; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[4].width = 2560; + handle->video_res_supported.res[4].height = 1440; + handle->video_res_supported.res[4].max_fps= 30; + handle->video_res_supported.res[4].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[4].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[4].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[4].nOutputWidth= 2560; + handle->video_res_supported.res[4].nOutputHeight= 1440; + sprintf(handle->video_res_supported.res[4].strResDesc, "2560x1440@30fps"); + + handle->video_res_supported.num_res = 6; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[5].width = 1920; + handle->video_res_supported.res[5].height = 1080; + handle->video_res_supported.res[5].max_fps= 60; + handle->video_res_supported.res[5].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[5].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[5].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[5].nOutputWidth= 1920; + handle->video_res_supported.res[5].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[5].strResDesc, "1920x1080@60fps"); + + handle->video_res_supported.num_res = 7; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[6].width = Preview_WIDTH; + handle->video_res_supported.res[6].height = Preview_HEIGHT; + handle->video_res_supported.res[6].max_fps= 30; + handle->video_res_supported.res[6].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[6].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[6].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[6].nOutputWidth= 3864; + handle->video_res_supported.res[6].nOutputHeight= 2202; + sprintf(handle->video_res_supported.res[6].strResDesc, "3840x2160@30fps"); + + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 1;//0;//1; + handle->ae_shutter_delay = 2;//1;//2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain = SENSOR_MIN_GAIN; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K15fps; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron; + handle->pCus_sensor_poweroff = pCus_poweroff; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = imx274_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration + // handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = pCus_GetShutterInfo; + + params->dirty = false; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx274_params *params = NULL; + + cus_camsensor_init_handle_linear(drv_handle); + params = (imx274_params *)handle->private_data; + + sprintf(handle->model_id,"IMX274_MIPI_HDR_SEF"); + + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[0].nOutputWidth= 0xF18; + handle->video_res_supported.res[0].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps_HDR"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = 1920; + handle->video_res_supported.res[1].height = 1080; + handle->video_res_supported.res[1].max_fps= 30; + handle->video_res_supported.res[1].min_fps= 3; + handle->video_res_supported.res[1].crop_start_x= 0; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[1].nOutputWidth= 0x78C; + handle->video_res_supported.res[1].nOutputHeight= 0x44E; + sprintf(handle->video_res_supported.res[1].strResDesc, "1920x1080@30fps_HDR"); + + handle->video_res_supported.num_res = 3; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[2].width = Preview_WIDTH; + handle->video_res_supported.res[2].height = Preview_HEIGHT; + handle->video_res_supported.res[2].max_fps= 20; + handle->video_res_supported.res[2].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[2].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[2].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[2].nOutputWidth= 0xF18; + handle->video_res_supported.res[2].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[2].strResDesc, "3840x2160@20fps_HDR"); + + handle->video_res_supported.num_res = 4; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[3].width = Preview_WIDTH; + handle->video_res_supported.res[3].height = Preview_HEIGHT; + handle->video_res_supported.res[3].max_fps= 30; + handle->video_res_supported.res[3].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[3].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[3].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[3].nOutputWidth= 0xF18; + handle->video_res_supported.res[3].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[3].strResDesc, "3840x2160@30fps_HDR"); + + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + +#if (SENSOR_MIPI_LANE_NUM == 2) +#endif +#if (SENSOR_MIPI_LANE_NUM == 4) + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_4k15fps; +#endif + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF; //TBD + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF; //TBD + + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_GetShutterInfo = pCus_GetShutterInfo_hdr_dol_sef; + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + + handle->data_prec = SENSOR_DATAPREC_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx274_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx274_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + memcpy(params->tExpo_shr_dol2_reg, expo_shr_dol2_reg, sizeof(expo_shr_dol2_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX274_MIPI_HDR_LEF"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_HDR_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[0].nOutputWidth= 0xF18; + handle->video_res_supported.res[0].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps_HDR"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = 1920; + handle->video_res_supported.res[1].height = 1080; + handle->video_res_supported.res[1].max_fps= 30; + handle->video_res_supported.res[1].min_fps= 3; + handle->video_res_supported.res[1].crop_start_x= 0; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[1].nOutputWidth= 0x78C; + handle->video_res_supported.res[1].nOutputHeight= 0x44E; + sprintf(handle->video_res_supported.res[1].strResDesc, "1920x1080@30fps_HDR"); + + handle->video_res_supported.num_res = 3; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[2].width = Preview_WIDTH; + handle->video_res_supported.res[2].height = Preview_HEIGHT; + handle->video_res_supported.res[2].max_fps= 20; + handle->video_res_supported.res[2].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[2].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[2].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[2].nOutputWidth= 0xF18; + handle->video_res_supported.res[2].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[2].strResDesc, "3840x2160@20fps_HDR"); + + handle->video_res_supported.num_res = 4; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[3].width = Preview_WIDTH; + handle->video_res_supported.res[3].height = Preview_HEIGHT; + handle->video_res_supported.res[3].max_fps= 30; + handle->video_res_supported.res[3].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[3].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[3].crop_start_y= Preview_CROP_START_Y_DOL; + handle->video_res_supported.res[3].nOutputWidth= 0xF18; + handle->video_res_supported.res[3].nOutputHeight= 0x886; + sprintf(handle->video_res_supported.res[3].strResDesc, "3840x2160@30fps_HDR"); + + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 1;//0;//1; + handle->ae_shutter_delay = 2;//1;//2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + ///calibration + handle->sat_mingain = SENSOR_MIN_GAIN; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_hdr_dol_lef; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_hdr_dol_lef; + handle->pCus_sensor_poweroff = pCus_poweroff_hdr_dol_lef; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_hdr_dol_lef; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->pCus_sensor_GetOrien = pCus_GetOrien_hdr_dol_lef; + handle->pCus_sensor_SetOrien = pCus_SetOrien_hdr_dol_lef; + handle->pCus_sensor_GetFPS = pCus_GetFPS_hdr_dol_lef; + handle->pCus_sensor_SetFPS = pCus_SetFPS_hdr_dol_lef; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + //handle->pCus_sensor_SetPatternMode = pCus_SetPatternMode_hdr_dol_lef; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_hdr_dol_lef; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_hdr_dol_lef; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain_hdr_dol_lef; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + //handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_hdr_dol_lef; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_hdr_dol_lef; + handle->pCus_sensor_setCaliData_gain_linearity= pCus_setCaliData_gain_linearity_hdr_dol_lef; + handle->pCus_sensor_GetShutterInfo = pCus_GetShutterInfo_hdr_dol_lef; +#if 0//defined(__MV5_FPGA__) + handle->pCus_sensor_I2CWrite = pCus_I2CWrite_hdr_dol_lef; //Andy Liu + handle->pCus_sensor_I2CRead = pCus_I2CRead_hdr_dol_lef; //Andy Liu +#endif + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + params->dirty = false; + + return SUCCESS; +} + +int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( IMX274_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef, + cus_camsensor_init_handle_hdr_dol_lef, + imx274_params + ); + + diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx335_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx335_mipi.c new file mode 100644 index 00000000..5e5b5847 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx335_mipi.c @@ -0,0 +1,3458 @@ +/* SigmaStar trade secret */ +/* Copyright (c) [2019~2020] SigmaStar Technology. +All rights reserved. + +Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +SigmaStar and be kept in strict confidence +(SigmaStar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of SigmaStar Confidential +Information is unlawful and strictly prohibited. SigmaStar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX335_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +//#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +//#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +#define ENABLE 1 +#define DISABLE 0 +#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define DEBUG_INFO 0 + +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +//#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// // +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +//////////////////////////////////// +// Sensor-If Info // +//////////////////////////////////// +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (lane_num) //IMX335 Linear mode supports MIPI 2/4 Lane +#define SENSOR_MIPI_LANE_NUM_DOL (4) //(hdr_lane_num)//IMX335 DOL mode supports MIPI 4 Lane +//#define SENSOR_MIPI_HDR_MODE (0) //0: Non-HDR mode. 1:Sony DOL mode + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC (Non-used) +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //0h: CUS_BAYER_RG, 1h: CUS_BAYER_GR, 2h: CUS_BAYER_BG, 3h: CUS_BAYER_GB +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, + +//////////////////////////////////// +// MCLK Info // +//////////////////////////////////// +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CUS_CMU_CLK_24MHZ //CUS_CMU_CLK_37P125MHZ//CUS_CMU_CLK_27MHZ +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_27MHZ + +//////////////////////////////////// +// I2C Info // +//////////////////////////////////// +#define SENSOR_I2C_ADDR 0x34 //I2C slave address +#define SENSOR_I2C_SPEED 300000 //200000 //300000 //240000 //I2C speed, 60000~320000 +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +//////////////////////////////////// +// Sensor Signal // +//////////////////////////////////// +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + // VSYNC/HSYNC POL can be found in data sheet timing diagram, + // Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +//////////////////////////////////// +// Sensor ID // +//////////////////////////////////// +//define SENSOR_ID + +#undef SENSOR_NAME +#define SENSOR_NAME IMX335 + +//////////////////////////////////// +// Image Info // +//////////////////////////////////// +static struct { // LINEAR + // Modify it based on number of support resolution + enum {LINEAR_RES_1 = 0, LINEAR_RES_2, LINEAR_RES_END}mode; + // Sensor Output Image info + struct _senout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _sensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _senstr{ + const char* strResDesc; + }senstr; +}imx335_mipi_linear[] = { + {LINEAR_RES_1, {2592, 1944, 3, 25}, {0, 0, 2592, 1944}, {"2592x1944@25fps"}}, + {LINEAR_RES_2, {2592, 1944, 3, 30}, {0, 0, 2592, 1944}, {"2592x1944@30fps"}}, // Modify it +}; + +static struct { // HDR + // Modify it based on number of support resolution + enum {HDR_RES_1 = 0, HDR_RES_2, HDR_RES_3, HDR_RES_END}mode; + // Sensor Output Image info + struct _hsenout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _hsensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _hsenstr{ + const char* strResDesc; + }senstr; +}imx335_mipi_hdr[] = { + {HDR_RES_1, {2592, 1944, 3, 25}, {4, 0, 2592, 1944}, {"2592x1944@25fps_HDR"}}, // Modify it + {HDR_RES_2, {2592, 1944, 3, 20}, {4, 0, 2592, 1944}, {"2592x1944@20fps_HDR"}}, // Modify it + {HDR_RES_3, {2592, 1944, 3, 30}, {4, 0, 2592, 1944}, {"2592x1944@30fps_HDR"}}, // Modify it +}; + +#define IMX335_HDR_BRL 2228 + +u32 Preview_line_period; +u32 vts_30fps; +u32 Preview_MAX_FPS; +u32 Preview_line_period_HDR_DOL; +u32 vts_30fps_HDR_DOL; + +//////////////////////////////////// +// AE Info // +//////////////////////////////////// +#define SENSOR_MAX_GAIN (1412 * 1024) // max sensor again, a-gain * conversion-gain*d-gain +#define SENSOR_MIN_GAIN (1 * 1024) +#define SENSOR_GAIN_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT (2) +#define SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL (1) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL (2) + +//////////////////////////////////// +// Mirror-Flip Info // +//////////////////////////////////// +#define REG_MIRROR 0x304E +#define REG_FLIP 0x304F +#define SENSOR_NOR 0x0 +#define MIRROR_EN 0x1 << (0) +#define FLIP_EN 0x1 << (0) + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +//static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lines; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + u32 max_rhs1; + int sen_init; + int still_min_fps; + int video_min_fps; + bool dirty; + bool orien_dirty; + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tGain_reg[2]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tExpo_shr_dol1_reg[3]; + I2C_ARRAY tExpo_rhs1_reg[3]; + I2C_ARRAY tGain_hdr_dol_lef_reg[2]; + I2C_ARRAY tGain_hdr_dol_sef_reg[2]; +} imx335_params; + +// set sensor ID address and data, +const static I2C_ARRAY Sensor_id_table[] = +{ + {0x3003, 0x00}, // {address of ID, ID }, + {0x3033, 0x00} +}; + +const static I2C_ARRAY Sensor_init_table_2lane_5m25fps[] = +{ + /*"IMX335LQN All-pixel scan CSI-2_2lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 25fps"*/ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, //BCWAIT_TIME + {0x300D,0x2E}, //CPWAIT_TIME + {0x3030,0x56}, //VMAX //101Dh: 4125 //1518h: 5400 + {0x3031,0x13}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x3050,0x00}, //ADBIT + + {0x305a,0x00}, // bit0-3(16-18) + {0x3059,0x0E}, // bit0-7(8-15) + {0x3058,0x80}, // bit0-7 + + {0x314C,0xB0}, //INCKSEL1 + {0x315A,0x02}, //INCKSEL2 + {0x3168,0x8F}, //INCKSEL3 + {0x316A,0x7E}, //INCKSEL4 + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, //XH&VSOUTSEL + {0x31A1,0x00}, //XVS/XHS pin setting + {0x31A4,0x00}, //PULSE1_UP + {0x31A5,0x00}, //PULSE1_UP + {0x31A6,0x00}, //PULSE1_UP + {0x31A8,0x00}, //PULSE1EN/PULSE1_POL + {0x31AC,0x00}, //PULSE1_DN + {0x31AD,0x00}, //PULSE1_DN + {0x31AE,0x00}, //PULSE1_DN + {0x31D4,0x00}, //XVSLNG + {0x31D5,0x00}, //XHSLNG + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x341D,0x01}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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,0x01}, //LANEMODE 0x03:4Lane 0x01:2Lane + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_2lane_5m30fps[] = +{ + /*"IMX335LQN All-pixel scan CSI-2_2lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 30fps"*/ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, //BCWAIT_TIME + {0x300D,0x2E}, //CPWAIT_TIME + {0x3030,0x1D}, //VMAX //1194 :4500 //101D: 4125 + {0x3031,0x10}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + {0x3050,0x00}, //ADBIT + + {0x305a,0x00}, // bit0-3(16-18) + {0x3059,0x0E}, // bit0-7(8-15) + {0x3058,0x80}, // bit0-7 + + {0x314C,0xB0}, //INCKSEL1 + {0x315A,0x02}, //INCKSEL2 + {0x3168,0x8F}, //INCKSEL3 + {0x316A,0x7E}, //INCKSEL4 + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, //XH&VSOUTSEL + {0x31A1,0x00}, //XVS/XHS pin setting + {0x31A4,0x00}, //PULSE1_UP + {0x31A5,0x00}, //PULSE1_UP + {0x31A6,0x00}, //PULSE1_UP + {0x31A8,0x00}, //PULSE1EN/PULSE1_POL + {0x31AC,0x00}, //PULSE1_DN + {0x31AD,0x00}, //PULSE1_DN + {0x31AE,0x00}, //PULSE1_DN + {0x31D4,0x00}, //XVSLNG + {0x31D5,0x00}, //XHSLNG + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x341D,0x01}, //ADBIT1 10Bit:0x01FF 12Bit:0x0047 + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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,0x01}, //LANEMODE 0x03:4Lane 0x01:2Lane + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_4lane_5m25fps[] = +{ +/* "IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x56}, //VMAX //101Dh: 4125 //1518h: 5400 + {0x3031,0x13}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + + {0x305a,0x00}, // bit0-3(16-18) + {0x3059,0x0E}, // bit0-7(8-15) + {0x3058,0x80}, // bit0-7 + + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xFF}, //0x47--12-bit 0xff--10bit + {0x341d,0x01}, //0x00--12-bit 0x01--10bit + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_4lane_5m30fps[] = +{ +/* "IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode 30fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x1D}, //VMAX //1194 :4500 //101D: 4125 + {0x3031,0x10}, //VMAX + {0x3032,0x00}, //VMAX + {0x3034,0x58}, //HMAX //2D0h: 720 //226h: 550 + {0x3035,0x02}, //HMAX + + {0x305a,0x00}, // bit0-3(16-18) + {0x3059,0x0E}, // bit0-7(8-15) + {0x3058,0x80}, // bit0-7 + + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, //MDBIT 0:10Bit 1:12Bit + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x00}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xFF}, //0x47--12-bit 0xff--10bit + {0x341d,0x01}, //0x00--12-bit 0x01--10bit + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375D,0x00}, + {0x375E,0x00}, + {0x375F,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + {0x3000,0x00}, + {0x3002,0x00}, +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m25fps[] = +{ +#if 1 +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x9A}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x88}, + {0x3059,0x1D}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + {0x3000,0x00}, + {0x3002,0x00}, +#else //Ori_24Mhz + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + + {0x3030,0x9A}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x88}, + {0x3059,0x1d}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x00}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m20fps[] = +{ +#if 1 +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 25fps" */ + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0xC0}, //VMAX 1518: 5400 //4500 1194 //4250 109A + {0x3031,0x14}, + {0x3032,0x00}, + {0x3034,0x5D}, //HMAX 113: 275 14A //15Dh 349 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x88}, + {0x3059,0x1D}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + {0x3000,0x00}, + {0x3002,0x00}, +#else //Ori_24Mhz + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + {0x3030,0xc0}, //14c0:5312 1A5Eh : 6750 // 16A8h : 5800 + {0x3031,0x14}, + {0x3032,0x00}, + {0x3033,0x00}, + {0x3034,0x5d}, //15d:349 113h : 275 // 140h : 320 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x14}, + {0x3059,0x28}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x00}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +const static I2C_ARRAY Sensor_init_table_HDR_DOL_4lane5m30fps[] = +{ +/*"IMX335LQN All-pixel scan CSI-2_4lane 1188Mbps AD:10bit Output:10bit 27MHz Master Mode DOL HDR 2frameLI 30fps"*/ +#if 1 + {0x3002,0x01}, //Master mode stop + {0xffff,0x14}, //delay + {0x3000,0x01}, //standby + {0xffff,0x14}, //delay + {0x300C,0x42}, + {0x300D,0x2E}, + {0x3030,0x9a}, //4250 109a//4096 1000h + {0x3031,0x10}, + {0x3032,0x00}, + {0x3034,0x21}, //HMAX 121: 121h 300 : 12Ch + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304A,0x04}, + {0x304B,0x03}, + {0x304C,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, //Y_OUT_SIZE[7:0] + {0x3057,0x08}, //Y_OUT_SIZE[12:8] + {0x3058,0x1C}, + {0x3059,0x22}, + {0x305A,0x00}, + {0x305C,0x12}, + {0x305D,0x00}, + {0x305E,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306A,0x00}, + {0x314C,0xB0}, + {0x315A,0x02}, + {0x3168,0x8F}, + {0x316A,0x7E}, + {0x319D,0x00}, + {0x319F,0x00}, //0x2 + {0x31A0,0x2A}, + {0x31A1,0x00}, + {0x31A4,0x00}, + {0x31A5,0x00}, + {0x31A6,0x00}, + {0x31A8,0x00}, + {0x31AC,0x00}, + {0x31AD,0x00}, + {0x31AE,0x00}, + {0x31D4,0x00}, + {0x31D5,0x00}, + {0x31D7,0x01}, + {0x31E4,0x01}, + {0x31F3,0x01}, + {0x3288,0x21}, + {0x328A,0x02}, + {0x3300,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341C,0xFF},//0x47--12-bit 0xff--10bit + {0x341D,0x01},// + {0x3648,0x01}, + {0x364A,0x04}, + {0x364C,0x04}, + {0x3678,0x01}, + {0x367C,0x31}, + {0x367E,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371C,0x3D}, + {0x371D,0x3F}, + {0x372C,0x00}, + {0x372D,0x00}, + {0x372E,0x46}, + {0x372F,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xFE}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1B}, + {0x3769,0x1B}, + {0x376A,0x1B}, + {0x376B,0x1B}, + {0x376C,0x1A}, + {0x376D,0x17}, + {0x376E,0x0F}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377A,0x89}, + {0x377B,0x00}, + {0x377C,0x08}, + {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}, + {0x3000,0x00}, + {0x3002,0x00}, +#else + {0x3000,0x01}, + {0x3001,0x00}, + {0x3002,0x01}, + {0x3003,0x00}, + + {0x300c,0x3b}, + {0x300d,0x2a}, + {0x3018,0x00}, + {0x302c,0x30}, + {0x302d,0x00}, + {0x302e,0x38}, + {0x302f,0x0a}, + + {0x3030,0x9a}, //VMAX 119a:4506, 109ah:4250 + {0x3031,0x10}, + {0x3032,0x00}, + {0x3033,0x00}, + {0x3034,0x23}, //HMAX 113h:275, 123:291 + {0x3035,0x01}, + {0x3048,0x01}, + {0x3049,0x01}, + {0x304a,0x04}, + {0x304b,0x03}, + {0x304c,0x00}, + {0x304e,0x00}, + {0x304f,0x00}, + {0x3050,0x00}, + {0x3056,0x07}, + {0x3057,0x08}, + {0x3058,0x9c}, + {0x3059,0x18}, + {0x305a,0x00}, + {0x305c,0x12}, + {0x305d,0x00}, + {0x305e,0x00}, + {0x3060,0xe8}, + {0x3061,0x00}, + {0x3062,0x00}, + {0x3064,0x09}, + {0x3065,0x00}, + {0x3066,0x00}, + {0x3068,0x22}, + {0x3069,0x01}, + {0x306a,0x00}, + {0x306c,0x68}, + {0x306d,0x06}, + {0x306e,0x00}, + {0x3072,0x28}, + {0x3073,0x00}, + {0x3074,0xb0}, + {0x3075,0x00}, + {0x3076,0x58}, + {0x3077,0x0f}, + + {0x3078,0x01}, + {0x3079,0x02}, + {0x307a,0xff}, + {0x307b,0x02}, + {0x307c,0x00}, + {0x307d,0x00}, + {0x307e,0x00}, + {0x307f,0x00}, + {0x3080,0x01}, + {0x3081,0x02}, + {0x3082,0xff}, + {0x3083,0x02}, + {0x3084,0x00}, + {0x3085,0x00}, + {0x3086,0x00}, + {0x3087,0x00}, + + {0x30a4,0x33}, + {0x30a8,0x10}, + {0x30a9,0x04}, + {0x30ac,0x00}, + {0x30ad,0x00}, + {0x30b0,0x10}, + {0x30b1,0x08}, + {0x30b4,0x00}, + {0x30b5,0x00}, + {0x30b6,0x00}, + {0x30b7,0x00}, + + {0x30c6,0x00}, + {0x30c7,0x00}, + {0x30ce,0x00}, + {0x30cf,0x00}, + {0x30d8,0x4c}, + {0x30d9,0x10}, + {0x30e8,0x00}, + {0x30e9,0x00}, + {0x30ea,0x00}, + {0x30eb,0x00}, + {0x30ec,0x00}, + {0x30ed,0x00}, + {0x30ee,0x00}, + {0x30ef,0x00}, + {0x3112,0x08}, + {0x3113,0x00}, + {0x3116,0x08}, + {0x3117,0x00}, + {0x314c,0xc6}, + {0x314d,0x00}, + {0x315a,0x02}, + {0x3167,0x01}, + {0x3168,0xa0}, + {0x316a,0x7e}, + {0x3199,0x00}, + {0x319d,0x00}, + {0x319e,0x01}, + {0x319f,0x02}, + {0x31a0,0x2a}, + {0x31a1,0x00}, + {0x31a4,0x00}, + {0x31a5,0x00}, + {0x31a6,0x00}, + {0x31a8,0x00}, + {0x31ac,0x00}, + {0x31ad,0x00}, + {0x31ae,0x00}, + {0x31d4,0x00}, + {0x31d5,0x00}, + {0x31d7,0x01}, + {0x31e4,0x01}, + {0x31e8,0x00}, + {0x31f3,0x01}, + {0x3200,0x01}, + {0x3288,0x21}, + {0x328a,0x02}, + {0x3300,0x00}, + {0x3302,0x32}, + {0x3303,0x00}, + {0x3414,0x05}, + {0x3416,0x18}, + {0x341c,0xff},//0x47--12-bit 0xff--10bit + {0x341d,0x01},// + {0x3648,0x01}, + {0x364a,0x04}, + {0x364c,0x04}, + {0x3678,0x01}, + {0x367c,0x31}, + {0x367e,0x31}, + {0x3706,0x10}, + {0x3708,0x03}, + {0x3714,0x02}, + {0x3715,0x02}, + {0x3716,0x01}, + {0x3717,0x03}, + {0x371c,0x3d}, + {0x371d,0x3f}, + {0x372c,0x00}, + {0x372d,0x00}, + {0x372e,0x46}, + {0x372f,0x00}, + {0x3730,0x89}, + {0x3731,0x00}, + {0x3732,0x08}, + {0x3733,0x01}, + {0x3734,0xfe}, + {0x3735,0x05}, + {0x3740,0x02}, + {0x375d,0x00}, + {0x375e,0x00}, + {0x375f,0x11}, + {0x3760,0x01}, + {0x3768,0x1b}, + {0x3769,0x1b}, + {0x376a,0x1b}, + {0x376b,0x1b}, + {0x376c,0x1a}, + {0x376d,0x17}, + {0x376e,0x0f}, + {0x3776,0x00}, + {0x3777,0x00}, + {0x3778,0x46}, + {0x3779,0x00}, + {0x377a,0x89}, + {0x377b,0x00}, + {0x377c,0x08}, + {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}, + {0x37b0,0x36}, + {0x3a01,0x03}, + {0x3a04,0x90}, + {0x3a05,0x12}, + {0x3a18,0x8f}, + {0x3a19,0x00}, + {0x3a1a,0x4f}, + {0x3a1b,0x00}, + {0x3a1c,0x47}, + {0x3a1d,0x00}, + {0x3a1e,0x37}, + {0x3a1f,0x01}, + {0x3a20,0x4f}, + {0x3a21,0x00}, + {0x3a22,0x87}, + {0x3a23,0x00}, + {0x3a24,0x4f}, + {0x3a25,0x00}, + {0x3a26,0x7f}, + {0x3a27,0x00}, + {0x3a28,0x3f}, + {0x3a29,0x00}, + + {0x3000,0x00}, + {0x3002,0x00}, +#endif +}; + +static I2C_ARRAY PatternTbl[] = { + {0x308c,0x20}, //colorbar pattern , bit 0 to enable +}; + +const static I2C_ARRAY gain_HDR_DOL_LEF_reg[] = +{ + {0x30E8, 0x00},// bit0-7 low + {0x30E9, 0x00},// bit0-2(8-10) +}; + +const static I2C_ARRAY gain_HDR_DOL_SEF1_reg[] = +{ + {0x30EA, 0x00},// bit0-7 low + {0x30EB, 0x00},// bit0-2(8-10) +}; + +const static I2C_ARRAY expo_shr_dol1_reg[] = +{ //SEL + {0x305e, 0x00}, // bit0-3(16-18) + {0x305d, 0x00}, // bit0-7(8-15) + {0x305c, 0x12}, // bit0-7 +}; + +const I2C_ARRAY expo_rhs1_reg[] = +{ //SEL + {0x306a, 0x00}, // bit0-3(16-18) + {0x3069, 0x00}, // bit0-7(8-15) + {0x3068, 0xCE}, // bit0-7 +}; + +const static I2C_ARRAY mirr_flip_table[] = +{ + {0x304e, 0x00}, //M0F0 + {0x304f, 0x00}, //M0F0 + {0x3081, 0x02}, + {0x3083, 0x02}, + {0x30b6, 0x00}, + {0x30b7, 0x00}, + {0x3016, 0x08}, + + {0x304e, 0x01}, //M1F0 + {0x304f, 0x00}, //M1F0 + {0x3081, 0x02}, + {0x3083, 0x02}, + {0x30b6, 0x00}, + {0x30b7, 0x00}, + {0x3016, 0x08}, + + {0x304e, 0x00}, //M0F1 + {0x304f, 0x01}, //M0F1 + {0x3081, 0xfe}, + {0x3083, 0xfe}, + {0x30b6, 0xfa}, + {0x30b7, 0x01}, + {0x3016, 0x02}, + + {0x304e, 0x01}, //M1F1 + {0x304f, 0x01}, //M1F1 + {0x3081, 0xfe}, + {0x3083, 0xfe}, + {0x30b6, 0xfa}, + {0x30b7, 0x01}, + {0x3016, 0x02}, +}; + +const static I2C_ARRAY gain_reg[] = { + {0x30E8, 0x00},// bit0-7 low + {0x30E9, 0x00},// bit0-2(8-10) +}; + +const static I2C_ARRAY expo_reg[] = { + {0x305a, 0x00}, // bit0-3(16-18) + {0x3059, 0x00}, // bit0-7(8-15) + {0x3058, 0x09}, // bit0-7 +}; + +const static I2C_ARRAY vts_reg[] = { + {0x3032, 0x00}, // bit0-3(16-18) + {0x3031, 0x11}, // bit0-7(8-15) + {0x3030, 0x94}, // bit0-7 +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@@ // +// @@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + +/////////// function definition /////////////////// +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent ////////////// +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +/*******I5/I6 Support MCLK List******* + * CUS_CMU_CLK_27MHZ, + * CUS_CMU_CLK_21P6MHZ, + * CUS_CMU_CLK_12MHZ, + * CUS_CMU_CLK_5P4MHZ, + * CUS_CMU_CLK_36MHZ, + * CUS_CMU_CLK_54MHZ, + * CUS_CMU_CLK_43P2MHZ, + * CUS_CMU_CLK_61P7MHZ, + * CUS_CMU_CLK_72MHZ, + * CUS_CMU_CLK_48MHZ, + * CUS_CMU_CLK_24MHZ, + * CUS_CMU_CLK_37P125MHZ, + ******End of Support MCLK List*******/ + #if 0 +static CUS_MCLK_FREQ UseParaMclk(const char *mclk) +{ + if (strcmp(mclk, "27M") == 0) { + return CUS_CMU_CLK_27MHZ; + } else if (strcmp(mclk, "12M") == 0) { + return CUS_CMU_CLK_12MHZ; + } else if (strcmp(mclk, "36M") == 0) { + return CUS_CMU_CLK_36MHZ; + } else if (strcmp(mclk, "48M") == 0) { + return CUS_CMU_CLK_48MHZ; + } else if (strcmp(mclk, "54M") == 0) { + return CUS_CMU_CLK_54MHZ; + } else if (strcmp(mclk, "24M") == 0) { + return CUS_CMU_CLK_24MHZ; + } else if (strcmp(mclk, "37.125M") == 0) { + return CUS_CMU_CLK_37P125MHZ; + } + return Preview_MCLK_SPEED; +} +#endif + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //Sensor power on sequence + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + sensor_if->Reset(idx, handle->reset_POLARITY); + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + //Sensor board PWDN Enable, 1.8V & 2.9V need 30ms then Pull High + SENSOR_MSLEEP(31); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_UDELAY(1); + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_UDELAY(30); //modify: clear_OFF->commucation_start>=20us + SENSOR_DMSG("Sensor Power On finished\n"); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + handle->orient = SENSOR_ORIT; + + return SUCCESS; +} + +/////////////////// Check Sensor Product ID ///////////////////////// +#if 0 +static int pCus_CheckSensorProductID(ms_cus_sensor *handle) +{ + u16 sen_id_msb, sen_id_lsb, sen_data; + + /* Read Product ID */ + SensorReg_Read(0x3f12, &sen_id_lsb); + SensorReg_Read(0x3f13, &sen_id_msb);//CHIP_ID_r3F13 + sen_data = ((sen_id_lsb & 0x0F) << 8) | (sen_id_lsb & 0xF0) | (sen_id_msb & 0x0F); +#if 0 + if (sen_data != CHIP_ID) { + printk("[***ERROR***]Check Product ID Fail: 0x%x\n", sen_data); + return FAIL; + } +#endif + return SUCCESS; +} +#endif +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if(/* SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == */SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_MSLEEP(1); + } + + //convert sensor id to u32 format + for(i=0;i=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi2lane_5m30fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_2lane_5m30fps);i++) + { + if(Sensor_init_table_2lane_5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_2lane_5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_2lane_5m30fps[i].reg,Sensor_init_table_2lane_5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane_5m30fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5m30fps);i++) + { + if(Sensor_init_table_4lane_5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5m30fps[i].reg,Sensor_init_table_4lane_5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane_5m25fps_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5m25fps);i++) + { + if(Sensor_init_table_4lane_5m25fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5m25fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5m25fps[i].reg,Sensor_init_table_4lane_5m25fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m25fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m25fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m25fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m25fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m25fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m20fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m20fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m20fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m20fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m20fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_init_mipi4lane5m30fps_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + SENSOR_DMSG("\n[%s]", __FUNCTION__); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane5m30fps);i++) + { + if(Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane5m30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane5m30fps[i].reg,Sensor_init_table_HDR_DOL_4lane5m30fps[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + return FAIL; + } + //usleep(10*1000); + } + } + } + return SUCCESS; +} + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + if(lane_num == 2){ + handle->pCus_sensor_init = pCus_init_mipi2lane_5m25fps_linear; + } + else if (lane_num == 4){ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m25fps_linear; + } + else{ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m25fps_linear; + } + vts_30fps = 4950; + Preview_MAX_FPS = 25; + Preview_line_period = 8080; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + if(lane_num == 2){ + handle->pCus_sensor_init = pCus_init_mipi2lane_5m30fps_linear; + } + else if (lane_num == 4){ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + } + else{ + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + } + vts_30fps = 4125; + Preview_MAX_FPS = 30; + Preview_line_period = 8080; + break; + default: + break; + } + params->expo.vts = vts_30fps; + params->expo.fps = Preview_MAX_FPS; + + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL_LEF(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + handle->video_res_supported.ulcur_res = res_idx; + + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL(ms_cus_sensor *handle, u32 res_idx) +{ + imx335_params *params = (imx335_params *)handle->private_data; + //ISensorIfAPI *sensor_if = &handle->sensor_if_api; + u32 num_res = handle->video_res_supported.num_res; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane5m25fps_HDR_DOL; + vts_30fps_HDR_DOL = 4250; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 25; + params->expo.fps=Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 9411; //8889 + params->max_rhs1 = 290; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_mipi4lane5m20fps_HDR_DOL; + vts_30fps_HDR_DOL = 5312; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 20; + params->expo.fps=Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 9411; + params->max_rhs1 = 290; + break; + case 2: + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_mipi4lane5m30fps_HDR_DOL; + vts_30fps_HDR_DOL = 4250; + params->expo.vts = vts_30fps_HDR_DOL; + Preview_MAX_FPS = 30; + params->expo.fps= Preview_MAX_FPS; + Preview_line_period_HDR_DOL = 7843; + params->max_rhs1 = 290; + break; + default: + break; + } + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + short Horiz_Inv = 0; + short Verti_Inv = 0; + short Orien_Mode = 0; + SensorReg_Read(0x304e, &Horiz_Inv); + SensorReg_Read(0x304f, &Verti_Inv); + Horiz_Inv &= 0x01; + Verti_Inv &= 0X01; + Orien_Mode = Horiz_Inv |(Verti_Inv << 2); + switch(Orien_Mode) + { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x01: + *orit = CUS_ORIT_M1F0; + break; + case 0x02: + *orit = CUS_ORIT_M0F1; + break; + case 0x03: + *orit = CUS_ORIT_M1F1; + break; + } + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int DoOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + int table_length = ARRAY_SIZE(mirr_flip_table); + int seg_length = table_length/4; + int i,j; + + switch(orit) + { + case CUS_ORIT_M0F0: + handle->orient = CUS_ORIT_M0F0; + for(i = 0, j = 0; i < seg_length; i++, j++){ + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + } + break; + case CUS_ORIT_M1F0: + for(i = seg_length, j = 0; i < seg_length*2; i++, j++){ + handle->orient = CUS_ORIT_M1F0; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + } + break; + case CUS_ORIT_M0F1: + for(i = seg_length * 2, j = 0; i < seg_length*3; i++, j++){ + handle->orient = CUS_ORIT_M0F1; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + } + break; + case CUS_ORIT_M1F1: + for(i = seg_length * 3, j = 0; i < seg_length*4; i++, j++){ + handle->orient = CUS_ORIT_M1F1; + SensorReg_Write(mirr_flip_table[i].reg,mirr_flip_table[i].data); + } + break; + default : + handle->orient = CUS_ORIT_M0F0; + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0; + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if((fps>=(min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps*(max_fps*1000) + (fps>>1))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=25; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts -2){ + vts = params->expo.expo_lines + 8; + }else{ + vts = params->expo.vts; + } + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF1(ms_cus_sensor *handle, u32 fps) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps_HDR_DOL*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts = (vts_30fps_HDR_DOL*(max_fps*1000) + (fps>>1))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + params->dirty = true; //reg need to update = true; + pCus_SetAEUSecsHDR_DOL_SEF1(handle, params->expo.expo_sef_us); + + return SUCCESS; +} + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + params->dirty = false; + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF1(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //imx335_params *params = (imx335_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + u32 lines = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + lines |= (u32)(params->tExpo_reg[0].data&0xff)<<16; + lines |= (u32)(params->tExpo_reg[1].data&0xff)<<8; + lines |= (u32)(params->tExpo_reg[2].data&0xff)<<0; + + *us = (lines*Preview_line_period)/1000; + SENSOR_DMSG("[%s] sensor expo lines/us %u,%u us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 lines = 0, vts = 0,activeline = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + params->expo.expo_lef_us = us; + + lines = (1000 * us) / Preview_line_period; + if(lines < 9) lines = 9; + params->expo.expo_lines = lines; + + if (lines >params->expo.vts-1) + vts = lines +1; + else + vts = params->expo.vts; + + SENSOR_DMSG("[%s] us %u, lines %u, vts %u\n", __FUNCTION__, + us, + lines, + params->expo.vts + ); + + activeline = vts - lines; + if(activeline < 9) activeline = 9; + + params->tExpo_reg[0].data = (activeline>>16) & 0x000f; + params->tExpo_reg[1].data = (activeline>>8) & 0x00ff; + params->tExpo_reg[2].data = (activeline>>0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x000f; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF1(ms_cus_sensor *handle, u32 us) +{ + u32 qua_lines = 0, lines = 0, long_lines = 0,vts = 0, fsc = 0; + u32 rhs1 = 0, shs1 = 0, shs0 = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + params->expo.expo_sef_us = us; + qua_lines = (1000 * us) / Preview_line_period_HDR_DOL /4; + vts = params->expo.vts; + shs0 = (params->tExpo_reg[0].data << 16) | (params->tExpo_reg[1].data << 8) | (params->tExpo_reg[2].data << 0); + fsc = vts * 2; + long_lines = fsc - shs0; + params->expo.expo_lines = long_lines; + + //params->max_rhs1 = 290; + rhs1 = params->max_rhs1;//(params->tExpo_rhs1_reg[0].data << 16) | (params->tExpo_rhs1_reg[1].data << 8) | (params->tExpo_rhs1_reg[2].data << 0); + + if(qua_lines <= 1) + qua_lines = 1; + if((4*qua_lines) > (rhs1- 18)) + qua_lines = (rhs1 - 18)/4; + + lines = 4*qua_lines; + if((rhs1 - 18) <= lines){ + shs1 = 18; + } + else if((rhs1 <= params->max_rhs1) && (rhs1 <= shs0 - 18)){ + shs1 = rhs1 - lines; + if((shs1 < 18) || (shs1 > (rhs1 - 4))){ //Check boundary + //shs1 = 0; + //UartSendTrace("[SEF1 NG1]"); + } + } + else{ + //UartSendTrace("[SEF1 NG2]"); + } + + params->tExpo_shr_dol1_reg[0].data = (shs1 >> 16) & 0x000f; + params->tExpo_shr_dol1_reg[1].data = (shs1 >> 8) & 0x00ff; + params->tExpo_shr_dol1_reg[2].data = (shs1 >> 0) & 0x00ff; + params->tExpo_rhs1_reg[0].data = (rhs1 >> 16) & 0x000f; + params->tExpo_rhs1_reg[1].data = (rhs1 >> 8) & 0x00ff; + params->tExpo_rhs1_reg[2].data = (rhs1 >> 0) & 0x00ff; + + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + unsigned short temp_gain; + // *gain=params->expo.final_gain; + temp_gain=gain_reg[0].data; + + *gain=(u32)(10^((temp_gain*3)/200))*1024; + if (gain_reg[1].data & 0x10) + *gain = (*gain) * 2; + + SENSOR_DMSG("[%s] get gain/reg (1024=1X)= %u/0x%x\n", __FUNCTION__, *gain,gain_reg[0].data); + return SUCCESS; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + //double gain_double; + u64 gain_double; + params->expo.final_gain = gain; + + if(gain<1024) + gain=1024; + else if(gain>=3980*1024) + gain=3980*1024; + + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3); + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u64 gain_double; + + params->expo.final_gain = gain; + if(gain < SENSOR_MIN_GAIN) + gain = SENSOR_MIN_GAIN; + else if(gain >= SENSOR_MAX_GAIN) + gain = SENSOR_MAX_GAIN; + + gain_double = 20*(intlog10(gain)-intlog10(1024)); + params->tGain_reg[0].data=(u16)(((gain_double*10)>> 24)/3) & 0x00ff; + params->tGain_reg[1].data=(u16)((((gain_double*10)>> 24)/3) >> 8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data); + params->dirty = true; + return SUCCESS; +} + +static void pCus_SetAEGainHDR_DOL_Calculate(u32 gain, u16 *gain_reg) +{ + //double gain_double; + u64 gain_double; + + if(gain < SENSOR_MIN_GAIN){ + gain = SENSOR_MIN_GAIN; + } + else if(gain >= SENSOR_MAX_GAIN){ + gain = SENSOR_MAX_GAIN; + } + gain_double = 20*(intlog10(gain)-intlog10(1024)); + *gain_reg=(u16)(((gain_double*10)>> 24)/3) & 0x07ff; +} + +static int pCus_SetAEGainHDR_DOL_SEF1(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_sef_reg[0].data = gain_reg & 0x00ff; + params->tGain_hdr_dol_sef_reg[1].data = (gain_reg>>8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_sef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx335_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = SENSOR_MIN_GAIN;//handle->sat_mingain; + *max = SENSOR_MAX_GAIN;//3980*1024; + return SUCCESS; +} + +static int IMX335_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx335_mipi_linear[0].senout.min_fps; + info->min = (Preview_line_period * 9); + info->step = Preview_line_period; + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +static int IMX335_GetShutterInfoHDR_DOL_SEF1(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + imx335_params *params = (imx335_params *)handle->private_data; + info->max = Preview_line_period_HDR_DOL * params->max_rhs1; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL * 4; + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx335_params *)handle->private_data; + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + //memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + //memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + //memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + //memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D8; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x34; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //300000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = LINEAR_RES_END; + for (res = 0; res < LINEAR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_linear[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_linear[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_linear[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_linear[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_linear[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_linear[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_linear[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_linear[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_linear[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_5m30fps_linear; + handle->pCus_sensor_poweron = pCus_poweron; + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_GetFPS = pCus_GetFPS; + handle->pCus_sensor_SetFPS = pCus_SetFPS; + handle->pCus_sensor_SetPatternMode = imx335_SetPatternMode; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + handle->sat_mingain = SENSOR_MIN_GAIN; //calibration + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfo; + + params->expo.vts = vts_30fps; + params->expo.expo_lines = 5000; + params->dirty = false; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef1(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params = NULL; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx335_params *)handle->private_data; + memcpy(params->tExpo_rhs1_reg, expo_rhs1_reg, sizeof(expo_rhs1_reg)); + memcpy(params->tExpo_shr_dol1_reg, expo_shr_dol1_reg, sizeof(expo_shr_dol1_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF1_reg, sizeof(gain_HDR_DOL_SEF1_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI_HDR_SEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC_DOL; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM_DOL; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane5m25fps_HDR_DOL; + handle->pCus_sensor_poweron = pCus_poweron; // Need to check + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; // Need to check + handle->pCus_sensor_SetOrien = pCus_SetOrien; // Need to check + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF1; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF1; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; //g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF1; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF1; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF1; + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfoHDR_DOL_SEF1; + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.expo_lines = 4250; + return SUCCESS; +} + +//lef functions +static int pCus_init_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static int pCus_poweron_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_GetSensorID_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *id) +{ + *id = 0; + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_LEF(ms_cus_sensor *handle, u32 fps) +{ + u32 vts = 0; + imx335_params *params = (imx335_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps_HDR_DOL*(max_fps*1000))/fps; + }else{ + //params->expo.vts=vts_30fps; + //params->expo.fps=30; + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > 2 * params->expo.vts - params->max_rhs1 -18){ + vts = (params->expo.expo_lines + params->max_rhs1 + 18) / 2; + }else{ + vts = params->expo.vts; + } + + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_lef_us); + + return SUCCESS; +} + +static int imx335_SetPatternMode_hdr_dol_lef(ms_cus_sensor *handle,u32 mode) +{ + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx335_params *params = (imx335_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) + { + SensorReg_Write(0x3001,1); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_shr_dol1_reg, ARRAY_SIZE(expo_shr_dol1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tExpo_rhs1_reg, ARRAY_SIZE(expo_rhs1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_lef_reg, ARRAY_SIZE(gain_HDR_DOL_LEF_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_sef_reg, ARRAY_SIZE(gain_HDR_DOL_SEF1_reg)); + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 qua_lines = 0,lines = 0, half_vts = 0, vts = 0, shr_dol0 = 0, fsc = 0; + imx335_params *params = (imx335_params *)handle->private_data; + + qua_lines = (1000 * us) / Preview_line_period_HDR_DOL / 4; + // lines=us/Preview_line_period_HDR_DOL; + params->expo.expo_lef_us = us; + + if (4 * qua_lines > 2 * params->expo.vts - params->max_rhs1 - 18) { // shs2 > max_rhs1 +2 + half_vts = (4 * qua_lines + params->max_rhs1 + 19) / 4; + } + else{ + half_vts = params->expo.vts / 2; + } + + SENSOR_DMSG("[%s] us %u, qua_lines %u, vts %u\n", __FUNCTION__, + us, + qua_lines, + params->expo.vts + ); + + //exposure limit lines = fsc - (shs2 + 1) = fsc - 1 - ( rhs1 + 2 ~ fsc - 2) = 1 ~ fsc - 104 (rhs1 fix to 101) + vts = half_vts * 2; + fsc = half_vts * 4; + if(qua_lines < 1) // shs2 < fsc - 2 + qua_lines = 1; + if(4 * qua_lines > fsc - params->max_rhs1 - 18) + qua_lines = (fsc - params->max_rhs1 - 18) / 4; + + lines = 4*qua_lines; + params->expo.expo_lines = lines; + + shr_dol0 = fsc - lines; +#if 0 + printk("[%s] us %u, qua_lines %u, vts %u shr_dol0 %u\n", __FUNCTION__, + us, + qua_lines, + params->expo.vts, + shr_dol0 + ); +#endif + params->tExpo_reg[0].data = (shr_dol0 >> 16) & 0x000f; + params->tExpo_reg[1].data = (shr_dol0 >> 8) & 0x00ff; + params->tExpo_reg[2].data = (shr_dol0 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x000f; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_LEF(ms_cus_sensor *handle, u32 gain) +{ + imx335_params *params = (imx335_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_lef_reg[0].data = gain_reg & 0x00ff; + params->tGain_hdr_dol_lef_reg[1].data = (gain_reg>>8) & 0x0007; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_lef_reg[0].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = handle->sat_mingain; + *max = SENSOR_MAX_GAIN; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx335_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} + +static int IMX335_GetShutterInfo_hdr_dol_lef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx335_mipi_linear[0].senout.min_fps; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL * 4; + return SUCCESS; +} + +static int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx335_params *params; + s32 res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx335_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX335_MIPI_HDR_LEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL;//UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + //sensor_if->MCLK(0,1,handle->mclk); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM_DOL; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_SONY_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx335_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx335_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx335_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx335_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx335_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx335_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx335_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx335_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx335_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_HDR_DOL_LEF; + handle->pCus_sensor_poweron = pCus_poweron_HDR_DOL_LEF; + handle->pCus_sensor_poweroff = pCus_poweroff_HDR_DOL_LEF; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_HDR_DOL_LEF; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL_LEF; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; //pCus_GetOrien_HDR_DOL_LEF + handle->pCus_sensor_SetOrien = pCus_SetOrien; //pCus_SetOrien_HDR_DOL_LEF + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_LEF; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_LEF; + + handle->pCus_sensor_SetPatternMode = imx335_SetPatternMode_hdr_dol_lef; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_HDR_DOL_LEF; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_HDR_DOL_LEF; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_HDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_HDR_DOL_LEF; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_hdr_dol_lef; + handle->pCus_sensor_setCaliData_gain_linearity = pCus_setCaliData_gain_linearity_hdr_dol_lef; + handle->pCus_sensor_GetShutterInfo = IMX335_GetShutterInfo_hdr_dol_lef; + + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.expo_lines = 673; + params->expo.fps = 25; + params->dirty = false; + + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX(IMX335_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef1, + cus_camsensor_init_handle_hdr_dol_lef, + imx335_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx347_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx347_mipi.c new file mode 100644 index 00000000..25eb1639 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx347_mipi.c @@ -0,0 +1,2199 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include +#include //TODO: move this header to drv_sensor_common.h +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX347_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +//#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +//#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +#define ENABLE 1 +#define DISABLE 0 +#undef SENSOR_DBG +#define SENSOR_DBG 1 + +#define DEBUG_INFO 0 + +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +//#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// // +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +//////////////////////////////////// +// Sensor-If Info // +//////////////////////////////////// +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (4) +#define SENSOR_MIPI_LANE_NUM_DOL (4) +//#define SENSOR_MIPI_HDR_MODE (0) //0: Non-HDR mode. 1:Sony DOL mode + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC (Non-used) +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_12 +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_12 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_RG //0h: CUS_BAYER_RG, 1h: CUS_BAYER_GR, 2h: CUS_BAYER_BG, 3h: CUS_BAYER_GB +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_RG +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, + +//////////////////////////////////// +// MCLK Info // +//////////////////////////////////// +#define Preview_MCLK_SPEED CUS_CMU_CLK_24MHZ //CUS_CMU_CLK_24MHZ //CUS_CMU_CLK_37P125MHZ//CUS_CMU_CLK_27MHZ +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_27MHZ + +//////////////////////////////////// +// I2C Info // +//////////////////////////////////// +#define SENSOR_I2C_ADDR 0x6e //0x34 //I2C slave address +#define SENSOR_I2C_SPEED 300000 //200000 //300000 //240000 //I2C speed, 60000~320000 +//#define SENSOR_I2C_CHANNEL 1 //I2C Channel +//#define SENSOR_I2C_PAD_MODE 2 //Pad/Mode Number +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +//////////////////////////////////// +// Sensor Signal // +//////////////////////////////////// +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + // VSYNC/HSYNC POL can be found in data sheet timing diagram, + // Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +//////////////////////////////////// +// Sensor ID // +//////////////////////////////////// +//define SENSOR_ID + +#undef SENSOR_NAME +#define SENSOR_NAME IMX347 + +#define CHIP_ID_r3F12 0x3F12 +#define CHIP_ID_r3F13 0x3F13 +#define CHIP_ID 0x0415 +int HDR_Ratio = 16; + +//////////////////////////////////// +// Image Info // +//////////////////////////////////// +static struct { // LINEAR + // Modify it based on number of support resolution + enum {LINEAR_RES_1 = 0, LINEAR_RES_2, LINEAR_RES_3, LINEAR_RES_END}mode; + // Sensor Output Image info + struct _senout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _sensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _senstr{ + const char* strResDesc; + }senstr; +}imx347_mipi_linear[] = { + {LINEAR_RES_1, {2712, 1536, 3, 30}, {12, 8, 2688, 1520}, {"2688x1520@30fps"}}, + {LINEAR_RES_2, {2712, 1536, 3, 30}, {152, 48, 2560, 1440}, {"2560x1440@30fps"}}, // Modify it + {LINEAR_RES_3, {2712, 1536, 3, 30}, {396, 228, 1920, 1080}, {"1920x1080@30fps"}}, // Modify it +}; + +static struct { // HDR + // Modify it based on number of support resolution + enum {HDR_RES_1 = 0, HDR_RES_2, HDR_RES_3, HDR_RES_END}mode; + // Sensor Output Image info + struct _hsenout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _hsensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _hsenstr{ + const char* strResDesc; + }senstr; +}imx347_mipi_hdr[] = { + {HDR_RES_1, {2712, 1536, 3, 30}, {12, 8, 2688, 1520}, {"2688x1520@30fps_HDR"}}, // Modify it + {HDR_RES_2, {2712, 1536, 3, 30}, {152, 48, 2560, 1440}, {"2560x1440@30fps_HDR"}}, // Modify it + {HDR_RES_3, {2712, 1536, 3, 30}, {396, 228, 1920, 1080}, {"1920x1080@30fps_HDR"}}, // Modify it +}; + +#define IMX347_HDR_BRL 1650 + +u32 vts_30fps = 2666; +u32 vts_30fps_HDR_DOL_4lane = 1650; +u32 Preview_line_period = 12503; +u32 Preview_line_period_HDR_DOL_4LANE = 20202; + +//////////////////////////////////// +// AE Info // +//////////////////////////////////// +#define SENSOR_MAX_GAIN (3981 * 1024) // max sensor again, a-gain * conversion-gain*d-gain +#define SENSOR_MIN_GAIN (1 * 1024) +#define SENSOR_GAIN_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL (2) + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lines; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + u32 min_shr1; + u32 min_rhs1; + u32 min_shr0; + u32 max_shr0; + u32 fsc; + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tVts_reg_hdr[3]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tSHR0_reg[3]; + I2C_ARRAY tSHR1_reg[3]; + I2C_ARRAY tRHS1_reg[3]; + I2C_ARRAY tGain_reg[2]; + I2C_ARRAY tGain_hdr_dol_lef_reg[2]; + I2C_ARRAY tGain_hdr_dol_sef_reg[2]; + bool dirty; + bool orien_dirty; +} imx347_params; + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us); +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ // +// @@ // +// @@ // +// @@@@@ // +// // +// Start Step 2 -- set Sensor initial and // +// adjust parameter // +// Fill these register table with resolution settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// +const static I2C_ARRAY Sensor_init_table_4lane_linear[] = +{ +/* +IMX347LQR All-pixel scan AD:12bit Output:12bit CSI-2_4lane 720Mbps INCK_24MHz Master Mode LCG Mode 50fps Integration Time 10ms Gain:6dB +Tool ver : Ver2.0 +*/ + {0x3000, 0x01},//Standby + {0x3002, 0x01},//Master mode stopx + {0x300C, 0x3B},// BCWAIT_TIME[7:0] + {0x300D, 0x2A},// CPWAIT_TIME[7:0] + {0x3030, 0x40},// VMAX[19:0] + + {0x3056, 0x00},//y_out_size lsb 0x02 + {0x3057, 0x06},//y_out_size msb 0x06 + + {0x3058, 0x20},// SHR0[19:0] + {0x3059, 0x03},// + {0x30BE, 0x5E},// - + {0x30C6, 0x00},// BLACK_OFSET_ADR[12:0] + {0x30CE, 0x00},// UNRD_LINE_MAX[12:0] + {0x30D8, 0x4F},// UNREAD_ED_ADR[12:0] + {0x30D9, 0x64},// + {0x30E8, 0x14},// GAIN[10:0] + {0x3110, 0x02},// - + {0x314C, 0xF0},// INCKSEL1[8:0] + {0x315A, 0x06},// INCKSEL2[1:0] + {0x3168, 0x82},// INCKSEL3[7:0] + {0x316A, 0x7E},// INCKSEL4[1:0] + {0x319E, 0x02},// SYS_MODE[1:0] + {0x31A1, 0x00},// XVS_DRV[1:0] + {0x3202, 0x02},// - + {0x3288, 0x22},// - + {0x328A, 0x02},// - + {0x328C, 0xA2},// - + {0x328E, 0x22},// - + {0x3415, 0x27},// - + {0x3418, 0x27},// - + {0x3428, 0xFE},// - + {0x349E, 0x6A},// - + {0x34A2, 0x9A},// - + {0x34A4, 0x8A},// - + {0x34A6, 0x8E},// - + {0x34AA, 0xD8},// - + {0x3648, 0x01},// - + {0x3678, 0x01},// - + {0x367C, 0x69},// - + {0x367E, 0x69},// - + {0x3680, 0x69},// - + {0x3682, 0x69},// - + {0x371D, 0x05},// - + {0x375D, 0x11},// - + {0x375E, 0x43},// - + {0x375F, 0x76},// - + {0x3760, 0x07},// - + {0x3768, 0x1B},// - + {0x3769, 0x1B},// - + {0x376A, 0x1A},// - + {0x376B, 0x19},// - + {0x376C, 0x17},// - + {0x376D, 0x0F},// - + {0x376E, 0x0B},// - + {0x376F, 0x0B},// - + {0x3770, 0x0B},// - + {0x3776, 0x89},// - + {0x3777, 0x00},// - + {0x3778, 0xCA},// - + {0x3779, 0x00},// - + {0x377A, 0x45},// - + {0x377B, 0x01},// - + {0x377C, 0x56},// - + {0x377D, 0x02},// - + {0x377E, 0xFE},// - + {0x377F, 0x03},// - + {0x3780, 0xFE},// - + {0x3781, 0x05},// - + {0x3782, 0xFE},// - + {0x3783, 0x06},// - + {0x3784, 0x7F},// - + {0x3788, 0x1F},// - + {0x378A, 0xCA},// - + {0x378B, 0x00},// - + {0x378C, 0x45},// - + {0x378D, 0x01},// - + {0x378E, 0x56},// - + {0x378F, 0x02},// - + {0x3790, 0xFE},// - + {0x3791, 0x03},// - + {0x3792, 0xFE},// - + {0x3793, 0x05},// - + {0x3794, 0xFE},// - + {0x3795, 0x06},// - + {0x3796, 0x7F},// - + {0x3798, 0xBF},// - + {0x3A18, 0x6F},// TCLKPOST[9:0] + {0x3A1A, 0x2F},// TCLKPREPARE[9:0] + {0x3A1C, 0x2F},// TCLKTRAIL[9:0] + {0x3A1E, 0xBF},// TCLKZERO[9:0] + {0x3A1F, 0x00},// + {0x3A20, 0x2F},// THSPREPARE[9:0] + {0x3A22, 0x57},// THSZERO[9:0] + {0x3A24, 0x2F},// THSTRAIL[9:0] + {0x3A26, 0x4F},// THSEXIT[9:0] + {0x3A28, 0x27},// TLPX[9:0] + {0x3000, 0x00},// STANDBY Release + {0x3002, 0x00},// MASTER MODE Start +}; + +const static I2C_ARRAY Sensor_init_table_4lane_HDR_DOL[] = +{ + /* + IMX347LQR All-pixel scan + CSI-2_4lane + 27MHz + AD:12bit Output:12bit + 1188Mbps + Master Mode LCG Mode DOL HDR 2frame VC + 30fps + Integration Time LEF:32ms SEF:0.202ms + Tool ver : Ver2.0 + */ + {0x3000, 0x01},//Standby + {0x3002, 0x01},//Master mode stopx + {0x300C, 0x42},// BCWAIT_TIME[7:0] + {0x300D, 0x2E},// CPWAIT_TIME[7:0] + {0x3048, 0x01},// WDMODE[0] + {0x3049, 0x01},// WDSEL[1:0] + {0x304A, 0x04},// WD_SET1[2:0] + {0x304B, 0x04},// WD_SET2[3:0] + {0x304C, 0x13},// OPB_SIZE_V[5:0] + + {0x3056, 0x00},//y_out_size lsb 0x02 + {0x3057, 0x06},//y_out_size msb 0x06 + + {0x3058, 0x84},// SHR0[19:0] + {0x3068, 0x1D},// RHS1[19:0] + {0x30BE, 0x5E}, + {0x3110, 0x02}, + {0x314C, 0xB0},// INCKSEL1[8:0] + {0x315A, 0x02},// INCKSEL2[1:0] + {0x3168, 0x8F},// INCKSEL3[7:0] + {0x316A, 0x7E},// INCKSEL4[1:0] + {0x31A1, 0x00},// XVS_DRV[1:0] + {0x31D7, 0x01},// XVSMSKCNT_INT[1:0] + {0x3202, 0x02}, + {0x3288, 0x22}, + {0x328A, 0x02}, + {0x328C, 0xA2}, + {0x328E, 0x22}, + {0x3415, 0x27}, + {0x3418, 0x27}, + {0x3428, 0xFE}, + {0x349E, 0x6A}, + {0x34A2, 0x9A}, + {0x34A4, 0x8A}, + {0x34A6, 0x8E}, + {0x34AA, 0xD8}, + {0x3648, 0x01}, + {0x3678, 0x01}, + {0x367C, 0x69}, + {0x367E, 0x69}, + {0x3680, 0x69}, + {0x3682, 0x69}, + {0x371D, 0x05}, + {0x375D, 0x11}, + {0x375E, 0x43}, + {0x375F, 0x76}, + {0x3760, 0x07}, + {0x3768, 0x1B}, + {0x3769, 0x1B}, + {0x376A, 0x1A}, + {0x376B, 0x19}, + {0x376C, 0x17}, + {0x376D, 0x0F}, + {0x376E, 0x0B}, + {0x376F, 0x0B}, + {0x3770, 0x0B}, + {0x3776, 0x89}, + {0x3777, 0x00}, + {0x3778, 0xCA}, + {0x3779, 0x00}, + {0x377A, 0x45}, + {0x377B, 0x01}, + {0x377C, 0x56}, + {0x377D, 0x02}, + {0x377E, 0xFE}, + {0x377F, 0x03}, + {0x3780, 0xFE}, + {0x3781, 0x05}, + {0x3782, 0xFE}, + {0x3783, 0x06}, + {0x3784, 0x7F}, + {0x3788, 0x1F}, + {0x378A, 0xCA}, + {0x378B, 0x00}, + {0x378C, 0x45}, + {0x378D, 0x01}, + {0x378E, 0x56}, + {0x378F, 0x02}, + {0x3790, 0xFE}, + {0x3791, 0x03}, + {0x3792, 0xFE}, + {0x3793, 0x05}, + {0x3794, 0xFE}, + {0x3795, 0x06}, + {0x3796, 0x7F}, + {0x3798, 0xBF}, + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_id_table[] = { + {0x3F12, 0x14}, // {address of ID, ID }, + {0x3F13, 0x75}, // {address of ID, ID }, +}; + +static I2C_ARRAY PatternTbl[] = { + {0x0000,0x00}, // colorbar pattern , bit 0 to enable +}; + +const static I2C_ARRAY expo_reg[] = { // SHS0 (For Linear) + {0x305a, 0x00}, + {0x3059, 0x00}, + {0x3058, 0x08}, +}; + +const static I2C_ARRAY expo_SHR0_reg[] = { // SHS0 (For LEF) + {0x305a, 0x00}, + {0x3059, 0x00}, + {0x3058, 0x84}, +}; + +const static I2C_ARRAY expo_SHR1_reg[] = { // SHS1 (For SEF) + //decreasing exposure ratio version. + {0x305e, 0x00}, + {0x305d, 0x00}, + {0x305c, 0x09}, +}; + +const static I2C_ARRAY vts_reg[] = { //VMAX + {0x3032, 0x00}, //bit0-3-->MSB + {0x3031, 0x06}, + {0x3030, 0x72}, +}; + +const static I2C_ARRAY vts_reg_hdr[] = { + {0x3032, 0x00}, //bit0-3-->MSB + {0x3031, 0x06}, + {0x3030, 0x72}, +}; + +const I2C_ARRAY expo_RHS1_reg[] = { + //decreasing exposure ratio version. + {0x306a, 0x00}, + {0x3069, 0x00}, + {0x3068, 0x1d}, +}; + +const static I2C_ARRAY gain_reg[] = { + {0x30e8, 0x2A},//low bit + {0x30e9, 0x00},//hcg mode,bit 4 +}; + +const static I2C_ARRAY gain_HDR_DOL_LEF_reg[] = { + {0x30e8, 0x2A}, + {0x30e9, 0x00}, +}; + +const static I2C_ARRAY gain_HDR_DOL_SEF_reg[] = { + {0x30ea, 0x20}, + {0x30eb, 0x00}, +}; + +const static I2C_ARRAY mirr_flip_table[] = +{ + {0x304e, 0x00},//M0F0 + {0x304f, 0x00}, + {0x304e, 0x01},//M1F0 + {0x304f, 0x00}, + {0x304e, 0x00},//M0F1 + {0x304f, 0x01}, + {0x304e, 0x01},//M1F1 + {0x304f, 0x01}, +}; + +//static int g_sensor_ae_min_gain = 1024; +static CUS_GAIN_GAP_ARRAY gain_gap_compensate[16] = { //compensate gain gap + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@@ // +// @@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////////////// I2C function definition /////////////////// +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent /////////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +/*******I5/I6 Support MCLK List******* + * CUS_CMU_CLK_27MHZ, + * CUS_CMU_CLK_21P6MHZ, + * CUS_CMU_CLK_12MHZ, + * CUS_CMU_CLK_5P4MHZ, + * CUS_CMU_CLK_36MHZ, + * CUS_CMU_CLK_54MHZ, + * CUS_CMU_CLK_43P2MHZ, + * CUS_CMU_CLK_61P7MHZ, + * CUS_CMU_CLK_72MHZ, + * CUS_CMU_CLK_48MHZ, + * CUS_CMU_CLK_24MHZ, + * CUS_CMU_CLK_37P125MHZ, + ******End of Support MCLK List*******/ + #if 0 +static CUS_MCLK_FREQ UseParaMclk(const char *mclk) +{ + if (strcmp(mclk, "27M") == 0) { + return CUS_CMU_CLK_27MHZ; + } else if (strcmp(mclk, "12M") == 0) { + return CUS_CMU_CLK_12MHZ; + } else if (strcmp(mclk, "36M") == 0) { + return CUS_CMU_CLK_36MHZ; + } else if (strcmp(mclk, "48M") == 0) { + return CUS_CMU_CLK_48MHZ; + } else if (strcmp(mclk, "54M") == 0) { + return CUS_CMU_CLK_54MHZ; + } else if (strcmp(mclk, "24M") == 0) { + return CUS_CMU_CLK_24MHZ; + } else if (strcmp(mclk, "37.125M") == 0) { + return CUS_CMU_CLK_37P125MHZ; + } + return Preview_MCLK_SPEED; +} +#endif + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + //Sensor power on sequence + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); // Powerdn Pull Low + sensor_if->Reset(idx, handle->reset_POLARITY); // Rst Pull Low + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, ENABLE); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + //Sensor board PWDN Enable, 1.8V & 2.9V need 30ms then Pull High + SENSOR_MSLEEP(31); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_MSLEEP(2); + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_MSLEEP(2); + SENSOR_DMSG("Sensor Power On finished\n"); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); // Powerdn Pull Low + sensor_if->Reset(idx, handle->reset_POLARITY); // Rst Pull Low + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + + handle->orient = SENSOR_ORIT; + + return SUCCESS; +} + +/////////////////// Check Sensor Product ID ///////////////////////// +/* static int pCus_CheckSensorProductID(ms_cus_sensor *handle) +{ + u16 sen_id_msb, sen_id_lsb; + + //Read Product ID + SensorReg_Read(0x3f12, (void*)&sen_id_lsb); + SensorReg_Read(0x3f13, (void*)&sen_id_msb);//CHIP_ID_r3F13 +#if 0 + if (sen_data != CHIP_ID) { + printk("[***ERROR***]Check Product ID Fail: 0x%x\n", sen_data); + return FAIL; + } +#endif + return SUCCESS; +} */ +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) + table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>3) + return FAIL; + + if(SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_MSLEEP(1); + } + + //convert sensor id to u32 format + for(i=0;iprivate_data; + int i,cnt=0; + //s16 sen_data; + +/* if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } */ + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_linear);i++) + { + if(Sensor_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_linear[i].reg); + //printk("IMX347 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + //imx347_params *params = (imx347_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + +/* if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } */ + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_HDR_DOL[i].reg,Sensor_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_HDR_DOL[i].reg, Sensor_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_init_table_4lane_linear[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX347 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_HDR_DOL[i].reg, Sensor_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + + SENSOR_DMSG("Sensor IMX347 HDR MODE Initial Finished\n"); + return SUCCESS; +} + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + vts_30fps = 2666; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 12503; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + vts_30fps = 2666; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 12503; + break; + case 2: + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + vts_30fps = 2666; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 12503; + break; + default: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + vts_30fps = 2666; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 12503; + break; + } + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL_LEF(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case HDR_RES_1: + case HDR_RES_2: + case HDR_RES_3: + handle->data_prec = CUS_DATAPRECISION_12; + break; + default: + break; + } + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL_SEF(ms_cus_sensor *handle, u32 res_idx) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case HDR_RES_1: + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 1650; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 20202; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 101; + break; + case HDR_RES_2: + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 1650; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 20202; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 101; + break; + case HDR_RES_3: + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 1650; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 20202; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 101; + break; + default: + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 1650; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 20202; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 101; + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + + *orit = handle->orient; + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx347_params *params = (imx347_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int DoOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + int table_length = ARRAY_SIZE(mirr_flip_table); + int seg_length=table_length/4; + int i,j; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + switch(orit) + { + case CUS_ORIT_M0F0: + for(i=0,j=0;iorient = CUS_ORIT_M0F0; + } + break; + case CUS_ORIT_M1F0: + for(i=seg_length,j=0;iorient = CUS_ORIT_M1F0; + } + break; + case CUS_ORIT_M0F1: + for(i=seg_length*2,j=0;iorient = CUS_ORIT_M0F1; + } + break; + case CUS_ORIT_M1F1: + for(i=seg_length*3,j=0;iorient = CUS_ORIT_M1F1; + } + break; + default : + for(i=0,j=0;iorient = CUS_ORIT_M0F0; + } + break; + } + + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + //u32 vts = 0, cur_vts_30fps = 0; + imx347_params *params = (imx347_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + if(fps>=min_fps && fps <= max_fps) + { + params->expo.vts= (vts_30fps*(max_fps*1000) + fps * 500)/(fps * 1000); + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)) + { + params->expo.vts= (vts_30fps*(max_fps*1000) + (fps>>1))/fps; + }else + { + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + //pr_info("[%s] leslie_vts : %u\n\n", __FUNCTION__,params->expo.vts); + if(params->expo.expo_lines > params->expo.vts - 4){ + //vts = params->expo.expo_lines + 4; +#if 0 //Update FPS Status + if(fps>=3 && fps <= 30) + fps = (vts_30fps*30000)/(params->expo.vts * 1000 - 500); + else if(fps>=3000 && fps <= 30000) + fps = (vts_30fps*30000)/(params->expo.vts - (500 / 1000)); +#endif + }else{ + //vts = params->expo.vts; + } + + params->expo.fps = fps; + params->dirty = true; + + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF(ms_cus_sensor *handle) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF(ms_cus_sensor *handle, u32 fps) +{ + u32 cur_vts_30fps = 0; + imx347_params *params = (imx347_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + + cur_vts_30fps=vts_30fps_HDR_DOL_4lane; + if(fps>=min_fps && fps <= max_fps) + { + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)) + { + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + (fps >> 1))/fps; + }else + { + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts - 4){ + //vts = params->expo.expo_lines + 4; +#if 0 //Update FPS Status + if(fps>=3 && fps <= 30) + fps = (vts_30fps*30000)/(params->expo.vts * 1000 - 500); + else if(fps>=3000 && fps <= 30000) + fps = (vts_30fps*30000)/(params->expo.vts - (500 / 1000)); +#endif + }else{ + //vts = params->expo.vts; + } + + params->expo.fps = fps; + //params->expo.vts = vts; + params->dirty = true; + + pCus_SetAEUSecsHDR_DOL_SEF(handle, params->expo.expo_sef_us); + return SUCCESS; +} + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx347_params *params = (imx347_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); // Global hold on + if(params->dirty) { + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); // Global hold off + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //imx347_params *params = (imx347_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: +#if 0 + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + + if(params->dirty) { + //SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } +#endif + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + u32 lines = 0; + imx347_params *params = (imx347_params *)handle->private_data; + + lines |= (u32)(params->tExpo_reg[0].data & 0x03) << 16; + lines |= (u32)(params->tExpo_reg[1].data & 0xff) << 8; + lines |= (u32)(params->tExpo_reg[2].data & 0xff) << 0; + + *us = (lines * Preview_line_period) / 1000; + + SENSOR_DMSG("[%s] sensor expo lines/us %u,%u us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 expo_lines = 0, vts = 0, SHR0 = 0; + imx347_params *params = (imx347_params *)handle->private_data; + + params->expo.expo_lef_us = us; + expo_lines = (1000*us)/Preview_line_period; + + if (expo_lines > params->expo.vts) { + vts = expo_lines + 8; + } + else + vts = params->expo.vts; + SHR0 = vts - expo_lines; + + if (SHR0 <= 12 ) // 8+4 + SHR0 = 8; + else + SHR0 -= 4; + + params->expo.expo_lines = expo_lines; + //params->expo.vts = vts; + + SENSOR_DMSG("[%s] us %u, SHR0 %u, vts %u\n", __FUNCTION__, + us, \ + SHR0, \ + vts + ); + //pr_info("[%s] leslie_shutter,expo_lines,params_expo_lines : %d,%d,%d\n\n", __FUNCTION__,us,expo_lines,params->expo.expo_lines); + //pr_info("[%s] leslie_shutter_vts : %u,%u\n\n", __FUNCTION__,params->expo.vts,vts); + params->tExpo_reg[0].data = (SHR0>>16) & 0x0003; + params->tExpo_reg[1].data = (SHR0>>8) & 0x00ff; + params->tExpo_reg[2].data = (SHR0>>0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us) +{ + u32 expo_line_sef = 0; + u32 cur_line_period = Preview_line_period_HDR_DOL_4LANE; + imx347_params *params = (imx347_params *)handle->private_data; + + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + expo_line_sef = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + params->expo.expo_sef_us = us; + //params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + + params->min_shr1 = params->min_rhs1 - expo_line_sef; + if((expo_line_sef > params->min_rhs1) || ((params->min_shr1) < 9)) + params->min_shr1 = 9; + params->min_shr1 = ((params->min_shr1 >> 1) << 1) + 1; + + SENSOR_DMSG("[%s] us %u, expo_line_sef %u rhs %u shr1 %u\n", __FUNCTION__, + us, \ + expo_line_sef, \ + params->min_rhs1, \ + params->min_shr1 + ); + + params->tRHS1_reg[0].data = (params->min_rhs1 >>16) & 0x03; + params->tRHS1_reg[1].data = (params->min_rhs1 >>8) & 0xff; + params->tRHS1_reg[2].data = (params->min_rhs1 >>0) & 0xff; + + params->tSHR1_reg[0].data = (params->min_shr1 >> 16) & 0x0003; + params->tSHR1_reg[1].data = (params->min_shr1 >> 8) & 0x00ff; + params->tSHR1_reg[2].data = (params->min_shr1 >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + imx347_params *params = (imx347_params *)handle->private_data; +#if 0 + u16 temp_gain; + + temp_gain=gain_reg[0].data; + *gain=(u32)(10^((temp_gain*3)/200))*1024; + if (gain_reg[1].data & 0x10) + *gain = (*gain) * 2; +#endif + *gain = params->expo.final_gain; + SENSOR_DMSG("[%s] get gain %u\n", __FUNCTION__, *gain); + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 i; + CUS_GAIN_GAP_ARRAY* Sensor_Gain_Linearity; + u64 gain_double; + + params->expo.final_gain = gain; + if(gain < SENSOR_MIN_GAIN) + gain = SENSOR_MIN_GAIN; + else if(gain >= SENSOR_MAX_GAIN) + gain = SENSOR_MAX_GAIN; + + Sensor_Gain_Linearity = gain_gap_compensate; + + for(i = 0; i < sizeof(gain_gap_compensate)/sizeof(CUS_GAIN_GAP_ARRAY); i++){ + if (Sensor_Gain_Linearity[i].gain == 0) + break; + if((gain>Sensor_Gain_Linearity[i].gain) && (gain < (Sensor_Gain_Linearity[i].gain + Sensor_Gain_Linearity[i].offset))){ + gain=Sensor_Gain_Linearity[i].gain; + break; + } + } + gain_double = 20 * (intlog10(gain) - intlog10(1024)); + gain_double = (u16)((gain_double * 10) >> 24) / 3; + + params->tGain_reg[0].data = gain_double & 0xff; + params->tGain_reg[1].data = (gain_double >> 8) & 0xff; + +#if DEBUG_INFO + SENSOR_DMSG("[%s]gain %u gain_double %llu\n",__FUNCTION__, gain, gain_double); +#endif + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x 0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data, gain,params->tGain_reg[1].dat); + params->dirty = true; + return SUCCESS; +} + +static void pCus_SetAEGainHDR_DOL_Calculate(u32 gain, u16 *gain_reg) +{ + //double gain_double; + u64 gain_double; + + if(gain < SENSOR_MIN_GAIN){ + gain = SENSOR_MIN_GAIN; + } + else if(gain >= SENSOR_MAX_GAIN){ + gain = SENSOR_MAX_GAIN; + } + gain_double = 20 * (intlog10(gain) - intlog10(1024)); + *gain_reg =(u16)((gain_double * 10) >> 24) / 3; +} + +static int pCus_SetAEGainHDR_DOL_SEF1(ms_cus_sensor *handle, u32 gain) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_sef_reg[0].data = gain_reg & 0xff; + params->tGain_hdr_dol_sef_reg[1].data = (gain_reg >> 8) & 0xff; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x 0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_sef_reg[0].data, params->tGain_hdr_dol_sef_reg[1].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx347_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = SENSOR_MIN_GAIN;//handle->sat_mingain; + *max = SENSOR_MAX_GAIN;//10^(72db/20)*1024; + return SUCCESS; +} + +static int IMX347_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx347_mipi_linear[0].senout.min_fps;// + info->min = (Preview_line_period * 1); + info->step = Preview_line_period; + return SUCCESS; +} + +static int IMX347_GetShutterInfo_HDR_DOL_SEF(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + imx347_params *params = (imx347_params *)handle->private_data; + info->max = Preview_line_period_HDR_DOL_4LANE * params->min_rhs1; + info->min = (Preview_line_period_HDR_DOL_4LANE * 2); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx347_params *params; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx347_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX347_MIPI"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D8; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x34; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //300000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk =Preview_MCLK_SPEED; + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = LINEAR_RES_END; + for (res = 0; res < LINEAR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx347_mipi_linear[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx347_mipi_linear[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx347_mipi_linear[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx347_mipi_linear[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx347_mipi_linear[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx347_mipi_linear[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx347_mipi_linear[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx347_mipi_linear[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx347_mipi_linear[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + //handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + //handle->pCus_sensor_powerupseq = pCus_powerupseq; + handle->pCus_sensor_poweron = pCus_poweron; + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_GetFPS = pCus_GetFPS; + handle->pCus_sensor_SetFPS = pCus_SetFPS; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = imx347_SetPatternMode; //NONE + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + handle->sat_mingain = SENSOR_MIN_GAIN;//g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + //handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + //handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = IMX347_GetShutterInfo; + + params->expo.vts = vts_30fps; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx347_params *params = NULL; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx347_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg_hdr, sizeof(vts_reg_hdr)); + memcpy(params->tRHS1_reg, expo_RHS1_reg, sizeof(expo_RHS1_reg)); + memcpy(params->tSHR1_reg, expo_SHR1_reg, sizeof(expo_SHR1_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF_reg, sizeof(gain_HDR_DOL_SEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX347_MIPI_HDR_SEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC_DOL; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_lane_num = 4; // hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; // SONY IMX347 as VC mode + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = HDR_RES_END; + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx347_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx347_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx347_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx347_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx347_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx347_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx347_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx347_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx347_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + handle->pCus_sensor_poweron = pCus_poweron; // Need to check + handle->pCus_sensor_poweroff = pCus_poweroff; // Need to check + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; // Need to check + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; // Need to check + handle->pCus_sensor_SetOrien = pCus_SetOrien; // Need to check + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF; // Need to check + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF; // Need to check + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; //g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF1; // Need to check + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + handle->pCus_sensor_GetShutterInfo = IMX347_GetShutterInfo_HDR_DOL_SEF; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + + return SUCCESS; +} + +//lef functions +static int pCus_init_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static int pCus_poweron_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_GetSensorID_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *id) +{ + return SUCCESS; +} + +static int pCus_GetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + return SUCCESS; +} + +static int pCus_SetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx347_params *params = (imx347_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_LEF(ms_cus_sensor *handle, u32 fps) +{ + u32 cur_vts_30fps = 0;//vts = 0, + imx347_params *params = (imx347_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + // cur_vts_30fps = imx347_mipi_hdr[0].senout.height; + cur_vts_30fps=vts_30fps_HDR_DOL_4lane; + if(fps>=min_fps && fps <= max_fps) + { + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)) + { + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + (fps >> 1))/fps; + }else { + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts - 4) { + //vts = params->expo.expo_lines + 4; + }else { + //vts = params->expo.vts; + } + + params->dirty = true; + params->expo.fps = fps; + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_sef_us); + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx347_params *params = (imx347_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + + break; + case CUS_FRAME_ACTIVE: + + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + if(params->dirty) { + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg_hdr)); + SensorRegArrayW((I2C_ARRAY*)params->tSHR0_reg, ARRAY_SIZE(expo_SHR0_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tSHR1_reg, ARRAY_SIZE(expo_SHR1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tRHS1_reg, ARRAY_SIZE(expo_RHS1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_lef_reg, ARRAY_SIZE(gain_HDR_DOL_LEF_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_sef_reg, ARRAY_SIZE(gain_HDR_DOL_SEF_reg)); + params->dirty = false; + } + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 expo_lines_lef = 0, vts = 0, fsc = 0; + u32 cur_line_period = Preview_line_period_HDR_DOL_4LANE; + imx347_params *params = (imx347_params *)handle->private_data; + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + expo_lines_lef = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + + params->expo.expo_lef_us = us; + fsc = params->expo.vts * 2; + params->fsc = ((fsc >> 2) << 2)+ 4; // 4n + + //params->max_shr0 = fsc - expo_lines_lef - 8; + params->max_shr0 = (fsc - 8) - expo_lines_lef; + if(params->max_shr0 < (params->min_rhs1+9)) + params->max_shr0 = params->min_rhs1+9; + params->max_shr0 = ((params->max_shr0 >> 1) << 1) + 2; //2n + + if (expo_lines_lef > (fsc - params->min_rhs1 - 9)) { + vts = (expo_lines_lef + params->min_rhs1 + 9) / 2; + } + else{ + vts = params->expo.vts; + } + params->expo.expo_lines = expo_lines_lef; + //params->expo.vts = vts; + + SENSOR_DMSG("[%s] us %u, expo_lines_lef %u, vts %u, SHR0 %u \n", __FUNCTION__, + us, \ + expo_lines_lef, \ + vts, \ + params->max_shr0 + ); + params->tSHR0_reg[0].data = (params->max_shr0 >> 16) & 0x0003; + params->tSHR0_reg[1].data = (params->max_shr0 >> 8) & 0x00ff; + params->tSHR0_reg[2].data = (params->max_shr0 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_LEF(ms_cus_sensor *handle, u32 gain) +{ + imx347_params *params = (imx347_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_lef_reg[0].data = gain_reg & 0xff; + params->tGain_hdr_dol_lef_reg[1].data = (gain_reg >> 8) & 0xff; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_lef_reg[0].data, params->tGain_hdr_dol_lef_reg[1].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = handle->sat_mingain; + *max = SENSOR_MAX_GAIN; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx347_mipi_hdr[0].senout.min_fps; + return SUCCESS; +} + +#if 0 +//static int pCus_GetDGainRemainder(ms_cus_sensor *handle, u32 *dgain_remainder) +//{ +// *dgain_remainder = handle->dgain_remainder; + +// return SUCCESS; +//} + +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} +#endif + +static int IMX347_GetShutterInfo_HDR_DOL_LEF(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx347_mipi_hdr[0].senout.min_fps; + info->min = (Preview_line_period_HDR_DOL_4LANE * 2); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} + +static int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx347_params *params; + s32 res; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx347_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg_hdr, sizeof(vts_reg_hdr)); + memcpy(params->tSHR0_reg, expo_SHR0_reg, sizeof(expo_SHR0_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX347_MIPI_HDR_LEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk =Preview_MCLK_SPEED_HDR_DOL; + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE; //CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = 4;//hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = HDR_RES_END; + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx347_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx347_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx347_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx347_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx347_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx347_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx347_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx347_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx347_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + //handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_HDR_DOL_LEF; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_HDR_DOL_LEF; + handle->pCus_sensor_poweroff = pCus_poweroff_HDR_DOL_LEF; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_HDR_DOL_LEF; + //handle->pCus_sensor_GetVideoResNum = NULL; + //handle->pCus_sensor_GetVideoRes = NULL; + //handle->pCus_sensor_GetCurVideoRes = NULL; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL_LEF; // Need to check + + + handle->pCus_sensor_GetOrien = pCus_GetOrien_HDR_DOL_LEF; + handle->pCus_sensor_SetOrien = pCus_SetOrien_HDR_DOL_LEF; + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_LEF; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_LEF; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + //handle->pCus_sensor_SetPatternMode = imx347_SetPatternMode_hdr_dol_lef; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_HDR_DOL_LEF; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_HDR_DOL_LEF; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_LEF; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_HDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_HDR_DOL_LEF; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + handle->pCus_sensor_GetShutterInfo = IMX347_GetShutterInfo_HDR_DOL_LEF; + + params->expo.vts = vts_30fps_HDR_DOL_4lane; + + params->dirty = false; + + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX(IMX347_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef, + cus_camsensor_init_handle_hdr_dol_lef, + imx347_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx415_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx415_mipi.c new file mode 100644 index 00000000..e4e46c0b --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_imx415_mipi.c @@ -0,0 +1,5391 @@ +/* Copyright (c) 2018-2019 Sigmastar Technology Corp. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained +herein regardless in any format shall remain the sole proprietary of +Sigmastar Technology Corp. and be kept in strict confidence +(Sigmastar Confidential Information) by the recipient. +Any unauthorized act including without limitation unauthorized disclosure, +copying, use, reproduction, sale, distribution, modification, disassembling, +reverse engineering and compiling of the contents of Sigmastar Confidential +Information is unlawful and strictly prohibited. Sigmastar hereby reserves the +rights to any and all damages, losses, costs and expenses resulting therefrom. +*/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include +#include //TODO: move this header to drv_sensor_common.h +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(IMX415_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +//#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +//#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +#define ENABLE 1 +#define DISABLE 0 +#undef SENSOR_DBG +#define SENSOR_DBG 0 + +#define DEBUG_INFO 0 + +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) LOGD(args) +//#define SENSOR_DMSG(args...) LOGE(args) +//#define SENSOR_DMSG(args...) printf(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// // +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +//////////////////////////////////// +// Sensor-If Info // +//////////////////////////////////// +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (4) +#define SENSOR_MIPI_LANE_NUM_DOL (4) +//#define SENSOR_MIPI_HDR_MODE (0) //0: Non-HDR mode. 1:Sony DOL mode + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC (Non-used) +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 +#define SENSOR_DATAPREC_DOL CUS_DATAPRECISION_12 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9098 //CFG +#define SENSOR_BAYERID CUS_BAYER_GB //0h: CUS_BAYER_RG, 1h: CUS_BAYER_GR, 2h: CUS_BAYER_BG, 3h: CUS_BAYER_GB +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_GB +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +//#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +//////////////////////////////////// +// MCLK Info // +//////////////////////////////////// +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CUS_CMU_CLK_24MHZ //CUS_CMU_CLK_37P125MHZ//CUS_CMU_CLK_27MHZ +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_27MHZ + +//////////////////////////////////// +// I2C Info // +//////////////////////////////////// +#define SENSOR_I2C_ADDR 0x34 //I2C slave address +#define SENSOR_I2C_SPEED 300000 //200000 //300000 //240000 //I2C speed, 60000~320000 +//#define SENSOR_I2C_CHANNEL 1 //I2C Channel +//#define SENSOR_I2C_PAD_MODE 2 //Pad/Mode Number +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +//////////////////////////////////// +// Sensor Signal // +//////////////////////////////////// +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + // VSYNC/HSYNC POL can be found in data sheet timing diagram, + // Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_NEG // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +//////////////////////////////////// +// Sensor ID // +//////////////////////////////////// +//define SENSOR_ID + +#undef SENSOR_NAME +#define SENSOR_NAME IMX415 + +#define CHIP_ID_r3F12 0x3F12 +#define CHIP_ID_r3F13 0x3F13 +#define CHIP_ID 0x0415 + +//////////////////////////////////// +// Image Info // +//////////////////////////////////// +static struct { // LINEAR + // Modify it based on number of support resolution + enum {LINEAR_RES_1 = 0, LINEAR_RES_2, LINEAR_RES_3, LINEAR_RES_4, LINEAR_RES_5, LINEAR_RES_6, LINEAR_RES_7, LINEAR_RES_8, LINEAR_RES_END}mode; + // Sensor Output Image info + struct _senout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _sensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _senstr{ + const char* strResDesc; + }senstr; +}imx415_mipi_linear[] = { + {LINEAR_RES_1, {3860, 2250, 3, 20}, {12, 16, 3840, 2160}, {"3840x2160@20fps"}}, + {LINEAR_RES_2, {3096, 2190, 3, 30}, {0, 0, 3072, 2048}, {"3072x2048@30fps"}}, // Modify it + {LINEAR_RES_3, {3096, 1758, 3, 30}, {0, 0, 3072, 1728}, {"3072x1728@30fps"}}, // Modify it + {LINEAR_RES_4, {2616, 1974, 3, 30}, {0, 0, 2592, 1944}, {"2592x1944@30fps"}}, // Modify it + {LINEAR_RES_5, {2976, 1686, 3, 30}, {0, 0, 2944, 1656}, {"2944x1656@30fps"}}, // Modify it + {LINEAR_RES_6, {2592, 1470, 3, 30}, {0, 0, 2560, 1440}, {"2560x1440@30fps"}}, // Modify it + {LINEAR_RES_7, {1920, 1080, 3, 60}, {0, 0, 1920, 1080}, {"1920x1080@60fps"}}, // Modify it + {LINEAR_RES_8, {1280, 720, 3, 120}, {0, 0, 1280, 720}, {"1280x720@120fps"}}, // Modify it +}; + +static struct { // HDR + // Modify it based on number of support resolution + enum {HDR_RES_1 = 0, HDR_RES_2, HDR_RES_3, HDR_RES_4, HDR_RES_5, HDR_RES_6, HDR_RES_7, HDR_RES_END}mode; + // Sensor Output Image info + struct _hsenout{ + s32 width, height, min_fps, max_fps; + }senout; + // VIF Get Image Info + struct _hsensif{ + s32 crop_start_X, crop_start_y, preview_w, preview_h; + }senif; + // Show resolution string + struct _hsenstr{ + const char* strResDesc; + }senstr; +}imx415_mipi_hdr[] = { + {HDR_RES_1, {3864, 2192, 3, 15}, {0, 0, 3840, 2160}, {"3840x2160@15fps_HDR"}}, // Modify it + {HDR_RES_2, {3864, 2192, 3, 20}, {0, 0, 3840, 2160}, {"3840x2160@20fps_HDR"}}, // Modify it + {HDR_RES_3, {3864, 2192, 3, 30}, {0, 0, 3840, 2160}, {"3840x2160@30fps_HDR"}}, // Modify it + {HDR_RES_4, {2592, 1944, 3, 30}, {0, 0, 2592, 1944}, {"2592x1944@30fps_HDR"}}, // Modify it + {HDR_RES_5, {2976, 1688, 3, 30}, {0, 0, 2944, 1656}, {"2944x1656@30fps_HDR"}}, // Modify it + {HDR_RES_6, {2688, 1520, 3, 30}, {0, 0, 2688, 1520}, {"2688x1520@30fps_HDR"}}, // Modify it + {HDR_RES_7, {1920, 1080, 3, 30}, {0, 0, 1920, 1080}, {"1920x1080@30fps_HDR"}}, // Modify it +}; + +#define IMX415_HDR_BRL 2228 + +u32 vts_30fps = 2250; +u32 vts_30fps_HDR_DOL_4lane = 2250; +u32 Preview_line_period = 17778; +u32 Preview_line_period_HDR_DOL_4LANE = 29630; + +//////////////////////////////////// +// AE Info // +//////////////////////////////////// +#define SENSOR_MAX_GAIN (3981 * 1024) // max sensor again, a-gain * conversion-gain*d-gain +#define SENSOR_MIN_GAIN (1 * 1024) +#define SENSOR_GAIN_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT (2) +#define SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL (2) + +//////////////////////////////////// +// Mirror-Flip Info // +//////////////////////////////////// +#define MIRROR_FLIP 0x3030 +#define SENSOR_NOR 0x0 +#define SENSOR_MIRROR_EN 0x1 << (0) +#define SENSOR_FLIP_EN 0x1 << (1) +#define SENSOR_MIRROR_FLIP_EN 0x3 + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + bool bVideoMode; + u16 res_idx; + CUS_CAMSENSOR_ORIT orit; + } res; + struct { + float sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 fps; + u32 preview_fps; + u32 expo_lines; + u32 expo_lef_us; + u32 expo_sef_us; + } expo; + + u32 min_shr1; + u32 min_rhs1; + u32 min_shr0; + u32 max_shr0; + u32 fsc; + I2C_ARRAY tVts_reg[3]; + I2C_ARRAY tVts_reg_hdr[3]; + I2C_ARRAY tExpo_reg[3]; + I2C_ARRAY tSHR0_reg[3]; + I2C_ARRAY tSHR1_reg[3]; + I2C_ARRAY tRHS1_reg[3]; + I2C_ARRAY tGain_reg[2]; + I2C_ARRAY tGain_hdr_dol_lef_reg[2]; + I2C_ARRAY tGain_hdr_dol_sef_reg[2]; + bool dirty; + bool orien_dirty; +} imx415_params; + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us); +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us); +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ // +// @@ // +// @@ // +// @@@@@ // +// // +// Start Step 2 -- set Sensor initial and // +// adjust parameter // +// Fill these register table with resolution settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// +const static I2C_ARRAY Sensor_init_table_4lane_linear[] = +{ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x7F}, //BCwait time + {0x3009, 0x00}, + {0x300A, 0x5B}, + {0x300B, 0xA0}, + //{0x3023, 0x0}, + {0x3024, 0xCA}, //VMAX LSB + {0x3025, 0x08}, //VMAX MSB 8CAh: 2250 + {0x3026, 0x00}, //VMAX MSB [0:3] + {0x3028, 0x4C}, //HMAX LSB + {0x3029, 0x04}, //HMAX MSB 44Ch: 1100 + {0x3031, 0x00}, //ADBIT 0h: AD 10bit; 1h: AD 12bit + {0x3032, 0x00}, //MDBIT 0h: 10bit; 1h: 12bit + {0x3033, 0x05}, //SYS MODE 05h: 891Mbps + {0x3050, 0x08}, //SHR0 Shutter Setting + {0x3051, 0x00}, + {0x3052, 0x00}, + {0x30C0, 0x2A}, //XVSOUTSEL + {0x30C1, 0x00}, + {0x30CC, 0x00}, + {0x30CD, 0x00}, + {0x30CF, 0x00}, //DOL setting + {0x3116, 0x24}, //INCKSEL2 + {0x311E, 0x24}, //INCKSEL5 + {0x32D4, 0x21}, + {0x32EC, 0xA1}, + {0x3452, 0x7F}, + {0x3453, 0x03}, + {0x358A, 0x04}, + {0x35A1, 0x02}, + {0x36BC, 0x0C}, + {0x36CC, 0x53}, + {0x36CD, 0x00}, + {0x36CE, 0x3C}, + {0x36D0, 0x8C}, + {0x36D1, 0x00}, + {0x36D2, 0x71}, + {0x36D4, 0x3C}, + {0x36D6, 0x53}, + {0x36D7, 0x00}, + {0x36D8, 0x71}, + {0x36DA, 0x8C}, + {0x36DB, 0x00}, + {0x37D1, 0x00}, //ADBIT1 + {0x3724, 0x02}, + {0x3726, 0x02}, + {0x3732, 0x02}, + {0x3734, 0x03}, + {0x3736, 0x03}, + {0x3742, 0x03}, + {0x3862, 0xE0}, + {0x38CC, 0x30}, + {0x38CD, 0x2F}, + {0x395C, 0x0C}, + {0x3A42, 0xD1}, + {0x3A4C, 0x77}, + {0x3AE0, 0x02}, + {0x3AEC, 0x0C}, + {0x3B00, 0x2E}, + {0x3B06, 0x29}, + {0x3B98, 0x25}, + {0x3B99, 0x21}, + {0x3B9B, 0x13}, + {0x3B9C, 0x13}, + {0x3B9D, 0x13}, + {0x3B9E, 0x13}, + {0x3BA1, 0x00}, + {0x3BA2, 0x06}, + {0x3BA3, 0x0B}, + {0x3BA4, 0x10}, + {0x3BA5, 0x14}, + {0x3BA6, 0x18}, + {0x3BA7, 0x1A}, + {0x3BA8, 0x1A}, + {0x3BA9, 0x1A}, + {0x3BAC, 0xED}, + {0x3BAD, 0x01}, + {0x3BAE, 0xF6}, + {0x3BAF, 0x02}, + {0x3BB0, 0xA2}, + {0x3BB1, 0x03}, + {0x3BB2, 0xE0}, + {0x3BB3, 0x03}, + {0x3BB4, 0xE0}, + {0x3BB5, 0x03}, + {0x3BB6, 0xE0}, + {0x3BB7, 0x03}, + {0x3BB8, 0xE0}, + {0x3BBA, 0xE0}, + {0x3BBC, 0xDA}, + {0x3BBE, 0x88}, + {0x3BC0, 0x44}, + {0x3BC2, 0x7B}, + {0x3BC4, 0xA2}, + {0x3BC8, 0xBD}, + {0x3BCA, 0xBD}, + {0x4004, 0x48}, //TXCLKSEC_FREQ LSB + {0x4005, 0x09}, //TXCLKSEC_FREQ MSB + {0x400C, 0x00}, + {0x4018, 0x7F}, //TCLKPOST MIPI global setting + {0x401A, 0x37}, //TCLKPREPARE MIPI global setting + {0x401C, 0x37}, //TCLKTRAIL MIPI global setting + {0x401E, 0xF7}, //TCLKZERO MIPI global setting + {0x401F, 0x00}, //TCLKZERO + {0x4020, 0x3F}, //THSPREPARE + {0x4022, 0x6F}, //THSZERO + {0x4024, 0x3F}, //THSTRAIL + {0x4026, 0x5F}, //THSEXT + {0x4028, 0x2F}, //TLPX + {0x4074, 0x01}, + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//8M20 594Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_8m_20fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR All-pixel scan CSI-2_4lane 27MHz AD:10bit Output:10bit 594Mbps Master Mode 19.996fps Integration Time 49.86ms + Tool ver : Ver6.0 hts:1320 vts:2813 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008,0x5D}, // BCWAIT_TIME[9:0] + {0x300A,0x42}, // CPWAIT_TIME[9:0] + {0x3024,0xFD}, // VMAX[19:0] + {0x3025,0x0A}, // + {0x3028,0x28}, // HMAX[15:0] + {0x3029,0x05}, // + {0x3031,0x00}, // ADBIT[1:0] + {0x3032,0x00}, // MDBIT + {0x3033,0x07}, // SYS_MODE[3:0] + {0x3050,0x08}, // SHR0[19:0] + {0x30C1,0x00}, // XVS_DRV[1:0] + {0x3116,0x23}, // INCKSEL2[7:0] + {0x3118,0x84}, // INCKSEL3[10:0] + {0x311A,0xE7}, // INCKSEL4[10:0] + {0x311E,0x23}, // INCKSEL5[7:0] + {0x32D4,0x21}, // - + {0x32EC,0xA1}, // - + {0x3452,0x7F}, // - + {0x3453,0x03}, // - + {0x358A,0x04}, // - + {0x35A1,0x02}, // - + {0x36BC,0x0C}, // - + {0x36CC,0x53}, // - + {0x36CD,0x00}, // - + {0x36CE,0x3C}, // - + {0x36D0,0x8C}, // - + {0x36D1,0x00}, // - + {0x36D2,0x71}, // - + {0x36D4,0x3C}, // - + {0x36D6,0x53}, // - + {0x36D7,0x00}, // - + {0x36D8,0x71}, // - + {0x36DA,0x8C}, // - + {0x36DB,0x00}, // - + {0x3701,0x00}, // ADBIT1[7:0] + {0x3724,0x02}, // - + {0x3726,0x02}, // - + {0x3732,0x02}, // - + {0x3734,0x03}, // - + {0x3736,0x03}, // - + {0x3742,0x03}, // - + {0x3862,0xE0}, // - + {0x38CC,0x30}, // - + {0x38CD,0x2F}, // - + {0x395C,0x0C}, // - + {0x3A42,0xD1}, // - + {0x3A4C,0x77}, // - + {0x3AE0,0x02}, // - + {0x3AEC,0x0C}, // - + {0x3B00,0x2E}, // - + {0x3B06,0x29}, // - + {0x3B98,0x25}, // - + {0x3B99,0x21}, // - + {0x3B9B,0x13}, // - + {0x3B9C,0x13}, // - + {0x3B9D,0x13}, // - + {0x3B9E,0x13}, // - + {0x3BA1,0x00}, // - + {0x3BA2,0x06}, // - + {0x3BA3,0x0B}, // - + {0x3BA4,0x10}, // - + {0x3BA5,0x14}, // - + {0x3BA6,0x18}, // - + {0x3BA7,0x1A}, // - + {0x3BA8,0x1A}, // - + {0x3BA9,0x1A}, // - + {0x3BAC,0xED}, // - + {0x3BAD,0x01}, // - + {0x3BAE,0xF6}, // - + {0x3BAF,0x02}, // - + {0x3BB0,0xA2}, // - + {0x3BB1,0x03}, // - + {0x3BB2,0xE0}, // - + {0x3BB3,0x03}, // - + {0x3BB4,0xE0}, // - + {0x3BB5,0x03}, // - + {0x3BB6,0xE0}, // - + {0x3BB7,0x03}, // - + {0x3BB8,0xE0}, // - + {0x3BBA,0xE0}, // - + {0x3BBC,0xDA}, // - + {0x3BBE,0x88}, // - + {0x3BC0,0x44}, // - + {0x3BC2,0x7B}, // - + {0x3BC4,0xA2}, // - + {0x3BC8,0xBD}, // - + {0x3BCA,0xBD}, // - + {0x4004,0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005,0x06}, // + {0x400C,0x00}, // INCKSEL6 + {0x4018,0x67}, // TCLKPOST[15:0] + {0x401A,0x27}, // TCLKPREPARE[15:0] + {0x401C,0x27}, // TCLKTRAIL[15:0] + {0x401E,0xB7}, // TCLKZERO[15:0] + {0x401F,0x00}, // + {0x4020,0x2F}, // THSPREPARE[15:0] + {0x4022,0x4F}, // THSZERO[15:0] + {0x4024,0x2F}, // THSTRAIL[15:0] + {0x4026,0x47}, // THSEXIT[15:0] + {0x4028,0x27}, // TLPX[15:0] + {0x4074,0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//3096x2190 891Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_6m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 3096x2190 CSI-2_4lane 27MHz AD:10bit Output:10bit 891Mbps Master Mode 30fps Integration Time 33.217ms + Tool ver : Ver6.0 vts:2250 hts:1100 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0x80}, // PIX_HST[12:0] + {0x3041, 0x01}, // + {0x3043, 0x0C}, // + {0x3044, 0x00}, // PIX_VST[12:0]//02 + {0x3045, 0x00}, // + {0x3046, 0x1C}, // PIX_VWIDTH[12:0] + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//3096x1758@30fps +const static I2C_ARRAY Sensor_5p3m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 3096x1758 CSI-2_4lane 27MHz AD:10bit Output:10bit 891Mbps Master Mode 30fps Integration Time 33.217ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0x80}, // PIX_HST[12:0] + {0x3041, 0x01}, // + {0x3043, 0x0C}, // + {0x3044, 0xB0}, // PIX_VST[12:0] //01b2 + {0x3045, 0x01}, // + {0x3046, 0xBC}, // PIX_VWIDTH[12:0] + {0x3047, 0x0D}, // + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; + +#if 0 +//5M25 594Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_5m_25fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 2592x1944 CSI-2_4lane 27MHz AD:10bit Output:10bit 594Mbps Master Mode 25fps Integration Time 39.86ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x28}, // HMAX[15:0] + {0x3029, 0x05}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x07}, // SYS_MODE[3:0] + {0x3040, 0x7C}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x20}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xF8}, // PIX_VST[12:0] //DA + {0x3045, 0x00}, // + {0x3046, 0x30}, // PIX_VWIDTH[12:0] + {0x3047, 0x0F}, // + {0x3050, 0x08}, // SHR0[19:0] + {0x30C0, 0x2A}, // XVSOUTSEL[1:0] XHSOUTSEL[3:2] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CC, 0x00}, + {0x30CD, 0x00}, + {0x30CF, 0x00}, + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0x84}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x67}, // TCLKPOST[15:0] + {0x401A, 0x27}, // TCLKPREPARE[15:0] + {0x401C, 0x27}, // TCLKTRAIL[15:0] + {0x401E, 0xB7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x2F}, // THSPREPARE[15:0] + {0x4022, 0x4F}, // THSZERO[15:0] + {0x4024, 0x2F}, // THSTRAIL[15:0] + {0x4026, 0x47}, // THSEXIT[15:0] + {0x4028, 0x27}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +#endif +//5M30 891Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_5m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 2616x1974 CSI-2_4lane 27MHz AD:10bit Output:10bit 891Mbps Master Mode 30fps Integration Time 33.217ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3024, 0x60}, //VMAX LSB + {0x3025, 0x08}, //VMAX MSB 8CAh: 2250 + {0x3026, 0x00}, //VMAX MSB [0:3] + {0x3028, 0x82}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0x70}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x38}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xD8}, // PIX_VST[12:0] //DA + {0x3045, 0x00}, // + {0x3046, 0x6C}, // PIX_VWIDTH[12:0] + {0x3047, 0x0F}, // + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//4p8M30 891Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_4p8m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 2976x1686 CSI-2_4lane 27MHz AD:10bit Output:10bit 891Mbps Master Mode 30fps Integration Time 33.217ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0xBC}, // PIX_HST[12:0] + {0x3041, 0x01}, // + {0x3042, 0xA0}, // PIX_HWIDTH[12:0] + {0x3043, 0x0B}, // + {0x3044, 0xF8}, // PIX_VST[12:0] //FA + {0x3045, 0x01}, // + {0x3046, 0x2C}, // PIX_VWIDTH[12:0] + {0x3047, 0x0D}, // + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//2592x1470@30fps +const static I2C_ARRAY Sensor_3p6m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQR Window cropping 2592x1470 CSI-2_4lane 27MHz AD:10bit Output:10bit 891Mbps Master Mode 30fps Integration Time 33.217ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3032, 0x00}, // MDBIT + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0x7C}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x20}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xD0}, // PIX_VST[12:0] //D2 + {0x3045, 0x02}, // + {0x3046, 0x7C}, // PIX_VWIDTH[12:0] + {0x3047, 0x0B}, // + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; +//8M30 891Mbps, 10bits, Mclk 27M +const static I2C_ARRAY Sensor_8m_30fps_init_table_4lane_linear[] = +{ + /* + IMX415-AAQRAll-pixel scan + CSI-2_4lane + 27MHz + AD:10bit + Output:10bit + 891Mbps + Master Mode 30fps + Integration Time33.217ms + */ + + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008,0x5D}, // BCWAIT_TIME[9:0] + {0x300A,0x42}, // CPWAIT_TIME[9:0] + {0x3024,0xCA}, // VMAX[19:0] + {0x3025,0x08}, // + {0x3028,0x4C}, // HMAX[15:0] + {0x3029,0x04}, // + {0x3031,0x00}, // ADBIT[1:0] + {0x3032,0x00}, // MDBIT + {0x3033,0x05}, // SYS_MODE[3:0] + {0x3050,0x08}, // SHR0[19:0] + {0x30C1,0x00}, // XVS_DRV[1:0] + {0x3116,0x23}, // INCKSEL2[7:0] + {0x3118,0xC6}, // INCKSEL3[10:0] + {0x311A,0xE7}, // INCKSEL4[10:0] + {0x311E,0x23}, // INCKSEL5[7:0] + {0x32D4,0x21}, // - + {0x32EC,0xA1}, // - + {0x3452,0x7F}, // - + {0x3453,0x03}, // - + {0x358A,0x04}, // - + {0x35A1,0x02}, // - + {0x36BC,0x0C}, // - + {0x36CC,0x53}, // - + {0x36CD,0x00}, // - + {0x36CE,0x3C}, // - + {0x36D0,0x8C}, // - + {0x36D1,0x00}, // - + {0x36D2,0x71}, // - + {0x36D4,0x3C}, // - + {0x36D6,0x53}, // - + {0x36D7,0x00}, // - + {0x36D8,0x71}, // - + {0x36DA,0x8C}, // - + {0x36DB,0x00}, // - + {0x3701,0x00}, // ADBIT1[7:0] + {0x3724,0x02}, // - + {0x3726,0x02}, // - + {0x3732,0x02}, // - + {0x3734,0x03}, // - + {0x3736,0x03}, // - + {0x3742,0x03}, // - + {0x3862,0xE0}, // - + {0x38CC,0x30}, // - + {0x38CD,0x2F}, // - + {0x395C,0x0C}, // - + + {0x3A42,0xD1}, // - + {0x3A4C,0x77}, // - + {0x3AE0,0x02}, // - + {0x3AEC,0x0C}, // - + {0x3B00,0x2E}, // - + {0x3B06,0x29}, // - + {0x3B98,0x25}, // - + {0x3B99,0x21}, // - + {0x3B9B,0x13}, // - + {0x3B9C,0x13}, // - + {0x3B9D,0x13}, // - + {0x3B9E,0x13}, // - + {0x3BA1,0x00}, // - + {0x3BA2,0x06}, // - + {0x3BA3,0x0B}, // - + {0x3BA4,0x10}, // - + {0x3BA5,0x14}, // - + {0x3BA6,0x18}, // - + {0x3BA7,0x1A}, // - + {0x3BA8,0x1A}, // - + {0x3BA9,0x1A}, // - + {0x3BAC,0xED}, // - + {0x3BAD,0x01}, // - + {0x3BAE,0xF6}, // - + {0x3BAF,0x02}, // - + {0x3BB0,0xA2}, // - + {0x3BB1,0x03}, // - + {0x3BB2,0xE0}, // - + {0x3BB3,0x03}, // - + {0x3BB4,0xE0}, // - + {0x3BB5,0x03}, // - + {0x3BB6,0xE0}, // - + {0x3BB7,0x03}, // - + {0x3BB8,0xE0}, // - + {0x3BBA,0xE0}, // - + {0x3BBC,0xDA}, // - + {0x3BBE,0x88}, // - + {0x3BC0,0x44}, // - + {0x3BC2,0x7B}, // - + {0x3BC4,0xA2}, // - + {0x3BC8,0xBD}, // - + {0x3BCA,0xBD}, // - + {0x4004,0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005,0x06}, // + {0x400C,0x00}, // INCKSEL6 + {0x4018,0x7F}, // TCLKPOST[15:0] + {0x401A,0x37}, // TCLKPREPARE[15:0] + {0x401C,0x37}, // TCLKTRAIL[15:0] + {0x401E,0xF7}, // TCLKZERO[15:0] + {0x401F,0x00}, // + {0x4020,0x3F}, // THSPREPARE[15:0] + {0x4022,0x6F}, // THSZERO[15:0] + {0x4024,0x3F}, // THSTRAIL[15:0] + {0x4026,0x5F}, // THSEXIT[15:0] + {0x4028,0x2F}, // TLPX[15:0] + {0x4074,0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; + +//1920x1080@60fps +const static I2C_ARRAY Sensor_2m_60fps_init_table_4lane_linear[] = +{ +/* +IMX415-AAQR 2/2-line binning CSI-2_4lane 27MHz AD:10bit Output:12bit 891Mbps Master Mode 59.998fps Integration Time 16.61ms +Tool ver : Ver6.0 +*/ + {0x3000, 0x01}, //Standby + //{0xffff, 0x24}, //delay (ms) + {0x3002, 0x01}, //Master mode stop + //{0xffff, 0x10}, //delay (ms) + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x3020, 0x01}, // HADD + {0x3021, 0x01}, // VADD + {0x3022, 0x01}, // ADDMODE[1:0] + {0x3024, 0xF8}, // VMAX[19:0] + {0x3028, 0x1B}, // HMAX[15:0] + {0x3031, 0x00}, // ADBIT[1:0] + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3050, 0x08}, // SHR0[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30D9, 0x02}, // DIG_CLP_VSTART[4:0] + {0x30DA, 0x01}, // DIG_CLP_VNUM[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x24}, + {0x3002, 0x00}, //Master mode start + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating +}; + +// 1280x720@120fps +const static I2C_ARRAY Sensor_1m_120fps_init_table_4lane_linear[] = +{ +/* +IMX415-AAQR 2/2-line binning & Window cropping 2568x1440 CSI-2_4lane 24MHz AD:10bit Output:12bit 1440Mbps Master Mode 119.988fps Integration Time 8ms Gain:6dB +Ver8.0 +*/ + {0x3000, 0x01}, // Standby + {0x3002, 0x01}, // Master mode stop + {0x3008, 0x54}, // BCWAIT_TIME[9:0] + {0x300A, 0x3B}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3020, 0x01}, // HADD + {0x3021, 0x01}, // VADD + {0x3022, 0x01}, // ADDMODE[1:0] + {0x3024, 0x6C}, // VMAX[19:0] + {0x3025, 0x06}, // + {0x3028, 0x6D}, // HMAX[15:0] + {0x3029, 0x01}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3040, 0x88}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x08}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xF0}, // PIX_VST[12:0] + {0x3045, 0x02}, // + {0x3046, 0x40}, // PIX_VWIDTH[12:0] + {0x3047, 0x0B}, // + {0x3050, 0x42}, // SHR0[19:0] + {0x3090, 0x14}, // GAIN_PCG_0[8:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30D9, 0x02}, // DIG_CLP_VSTART[4:0] + {0x30DA, 0x01}, // DIG_CLP_VNUM[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xB4}, // INCKSEL3[10:0] + {0x311A, 0xFC}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x344C, 0x2B}, // - + {0x344D, 0x01}, // - + {0x344E, 0xED}, // - + {0x344F, 0x01}, // - + {0x3450, 0xF6}, // - + {0x3451, 0x02}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x35EC, 0x27}, // - + {0x35EE, 0x8D}, // - + {0x35F0, 0x8D}, // - + {0x35F2, 0x29}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3720, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x39A4, 0x07}, // - + {0x39A8, 0x32}, // - + {0x39AA, 0x32}, // - + {0x39AC, 0x32}, // - + {0x39AE, 0x32}, // - + {0x39B0, 0x32}, // - + {0x39B2, 0x2F}, // - + {0x39B4, 0x2D}, // - + {0x39B6, 0x28}, // - + {0x39B8, 0x30}, // - + {0x39BA, 0x30}, // - + {0x39BC, 0x30}, // - + {0x39BE, 0x30}, // - + {0x39C0, 0x30}, // - + {0x39C2, 0x2E}, // - + {0x39C4, 0x2B}, // - + {0x39C6, 0x25}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0x00}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0x9F}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x57}, // TCLKTRAIL[15:0] + {0x401E, 0x87}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xA7}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x97}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, // Operating + {0xffff, 0x10}, + {0x3002, 0x00}, // Master mode start + {0x3260, 0x00}, // Gain_Pgc_Fidmd +}; + +#if 0 +// 1280x720@135fps +const static I2C_ARRAY Sensor_1m_135fps_init_table_4lane_linear[] = +{ +/* +IMX415-AAQR 2/2-line binning & Window cropping 2568x1440 CSI-2_4lane 37.125Mhz AD:10bit Output:12bit 1485Mbps Master Mode 134.987fps Integration Time 0.999ms Gain:6dB +Ver8.0 +*/ + {0x3000, 0x01}, // Standby + {0x3002, 0x01}, // Master mode stop + {0x3008, 0x7F}, // BCWAIT_TIME[9:0] + {0x300A, 0x5B}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3020, 0x01}, // HADD + {0x3021, 0x01}, // VADD + {0x3022, 0x01}, // ADDMODE[1:0] + {0x3024, 0xE3}, // VMAX[19:0] + {0x3025, 0x05}, // + {0x3028, 0x6D}, // HMAX[15:0] + {0x3029, 0x01}, // + {0x3031, 0x00}, // ADBIT[1:0] + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3040, 0x88}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x08}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xF0}, // PIX_VST[12:0] + {0x3045, 0x02}, // + {0x3046, 0x40}, // PIX_VWIDTH[12:0] + {0x3047, 0x0B}, // + {0x3050, 0x18}, // SHR0[19:0] + {0x3051, 0x05}, // + {0x3090, 0x14}, // GAIN_PCG_0[8:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30D9, 0x02}, // DIG_CLP_VSTART[4:0] + {0x30DA, 0x01}, // DIG_CLP_VNUM[1:0] + {0x3116, 0x24}, // INCKSEL2[7:0] + {0x3118, 0xA0}, // INCKSEL3[10:0] + {0x311E, 0x24}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x344C, 0x2B}, // - + {0x344D, 0x01}, // - + {0x344E, 0xED}, // - + {0x344F, 0x01}, // - + {0x3450, 0xF6}, // - + {0x3451, 0x02}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x35EC, 0x27}, // - + {0x35EE, 0x8D}, // - + {0x35F0, 0x8D}, // - + {0x35F2, 0x29}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // ADBIT1[7:0] + {0x3720, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x39A4, 0x07}, // - + {0x39A8, 0x32}, // - + {0x39AA, 0x32}, // - + {0x39AC, 0x32}, // - + {0x39AE, 0x32}, // - + {0x39B0, 0x32}, // - + {0x39B2, 0x2F}, // - + {0x39B4, 0x2D}, // - + {0x39B6, 0x28}, // - + {0x39B8, 0x30}, // - + {0x39BA, 0x30}, // - + {0x39BC, 0x30}, // - + {0x39BE, 0x30}, // - + {0x39C0, 0x30}, // - + {0x39C2, 0x2E}, // - + {0x39C4, 0x2B}, // - + {0x39C6, 0x25}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0x48}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x09}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, // Operating + {0xffff, 0x10}, + {0x3002, 0x00}, // Master mode start + {0x3260, 0x00}, // Gain_Pgc_Fidmd +}; +#endif + +const static I2C_ARRAY Sensor_init_table_4lane_HDR_DOL[] = +{ + /* + IMX415-AAQR All-pixel scan CSI-2_4lane 27MHz AD:12bit Output:12bit 891Mbps Master Mode DOL HDR 2frame VC 15fps Integration Time LEF:9.988ms SEF:0.121ms + Tool ver : Ver6.0 vts:2250 hts:1100 + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3050, 0xF2}, // SHR0[19:0] + {0x3051, 0x0E}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x11}, // RHS1[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_8m_20fps_init_table_4lane_HDR_DOL[] = +{ + /* + IMX415-AAQRAll-pixel scan + CSI-2_4lane + 27MHz + AD:10bit Output:10bit + 1485Mbps + Master Mode DOL HDR 2frame VC + 20.002fps + Integration Time LEF:1.002ms SEF:0.118ms + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x3024, 0x7A}, // VMAX[15:0] + {0x3025, 0x0D}, // + {0x3028, 0x1A}, // HMAX[15:0] + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3032, 0x00}, // + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3050, 0x6A}, // SHR0[19:0] + {0x3051, 0x1A}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xA5}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_8m_30fps_init_table_4lane_HDR_DOL[] = +{ + /* + IMX415-AAQRAll-pixel scan + CSI-2_4lane + 27MHz + AD:10bit Output:10bit + 1485Mbps + Master Mode DOL HDR 2frame VC + 30.002fps + Integration Time LEF:1.002ms SEF:0.118ms + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x3024, 0xFC}, // VMAX[15:0] + {0x3025, 0x08}, // + {0x3028, 0x1A}, // HMAX[15:0] + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3032, 0x00}, // + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3050, 0x6E}, // SHR0[19:0] + {0x3051, 0x11}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xA5}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_5m_30fps_init_table_4lane_HDR_DOL[] = +{ + /* + IMX415-AAQR + Window cropping2592x1944 + CSI-2_4lane27MHz + AD:10bit Output:10bit + 1485Mbps + Master Mode DOL HDR 2frame VC + 30.002fps + Integration Time LEF:1.002ms SEF:0.118ms + + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // + {0x3024, 0xFC}, // VMAX[15:0] + {0x3025, 0x08}, // + {0x3028, 0x1A}, // HMAX[15:0] + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3032, 0x00}, // + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3040, 0x7C}, // + {0x3041, 0x02}, // + {0x3042, 0x20}, // + {0x3043, 0x0A}, // + {0x3044, 0xF8}, // + {0x3045, 0x00}, // + {0x3046, 0x30}, // + {0x3047, 0x0F}, // + {0x3050, 0x6E}, // SHR0[19:0] + {0x3051, 0x11}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xA5}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +#if 0 +const static I2C_ARRAY Sensor_5m_15fps_init_table_4lane_HDR_DOL[] = +{ + /* + IMX415-AAQR window cropping2616x1974 scan CSI-2_4lane 27MHz AD:12bit Output:12bit 891Mbps Master Mode DOL HDR 2frame VC 15fps Integration Time LEF:9.988ms SEF:0.121ms + Tool ver : Ver6.0 + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // WINMODE[3:0] + {0x3028, 0x4C}, // HMAX[15:0] + {0x3029, 0x04}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3040, 0x70}, // PIX_HST[12:0] + {0x3041, 0x02}, // + {0x3042, 0x38}, // PIX_HWIDTH[12:0] + {0x3043, 0x0A}, // + {0x3044, 0xDA}, // PIX_VST[12:0] + {0x3045, 0x00}, // + {0x3046, 0x6C}, // PIX_VWIDTH[12:0] + {0x3047, 0x0F}, // + {0x3050, 0xF2}, // SHR0[19:0] + {0x3051, 0x0E}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x11}, // RHS1[19:0] + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, // INCKSEL6 + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, // + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // INCKSEL7 [2:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; +#endif + +const static I2C_ARRAY Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[] = +{ + /* + "IMX415-AAQR Window cropping 2976x1686 CSI-2_4lane 27MHz + AD:10bit Output:10bit 1485Mbps + Master Mode DOL HDR 2frame VC 30.002fps + Integration Time LEF:1.002ms SEF:0.118ms" + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // + {0x3024, 0xFC}, // VMAX[15:0] FC + {0x3025, 0x08}, // + {0x3028, 0x1A}, // HMAX[15:0] 1A + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3032, 0x00}, // + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3040, 0xBC}, // + {0x3041, 0x01}, // 01 + {0x3042, 0xA0}, // + {0x3043, 0x0B}, // + {0x3044, 0xF8}, // + {0x3045, 0x01}, // 01 + {0x3046, 0x30}, // + {0x3047, 0x0D}, // + {0x3050, 0x6E}, // SHR0[19:0] + {0x3051, 0x11}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C0, 0x2A}, + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CC, 0x00}, + {0x30CD, 0x00}, + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xA5}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_4m_30fps_init_table_4lane_HDR_DOL[] = +{ + /* + "IMX415-AAQR Window cropping 2688x1520 + CSI-2_4lane 27MHz AD:10bit Output:10bit 1485Mbps + Master Mode DOL HDR 2frame VC + 30.002fps Integration Time LEF:1.002ms SEF:0.118ms" + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + {0x301C, 0x04}, // + {0x3024, 0xFC}, // VMAX[15:0] + {0x3025, 0x08}, // + {0x3028, 0x1A}, // HMAX[15:0] + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3032, 0x00}, // + {0x3033, 0x08}, // SYS_MODE[3:0] + {0x3040, 0x4C}, // + {0x3041, 0x01}, // + {0x3042, 0x80}, // + {0x3043, 0x0A}, // + {0x3044, 0xA0}, // + {0x3045, 0x01}, // + {0x3046, 0xE0}, // + {0x3047, 0x0B}, // + {0x3050, 0x6E}, // SHR0[19:0] + {0x3051, 0x11}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C0, 0x2A}, + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CC, 0x00}, + {0x30CD, 0x00}, + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xA5}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // - + {0x32EC, 0xA1}, // - + {0x3452, 0x7F}, // - + {0x3453, 0x03}, // - + {0x358A, 0x04}, // - + {0x35A1, 0x02}, // - + {0x36BC, 0x0C}, // - + {0x36CC, 0x53}, // - + {0x36CD, 0x00}, // - + {0x36CE, 0x3C}, // - + {0x36D0, 0x8C}, // - + {0x36D1, 0x00}, // - + {0x36D2, 0x71}, // - + {0x36D4, 0x3C}, // - + {0x36D6, 0x53}, // - + {0x36D7, 0x00}, // - + {0x36D8, 0x71}, // - + {0x36DA, 0x8C}, // - + {0x36DB, 0x00}, // - + {0x3701, 0x00}, // - + {0x3724, 0x02}, // - + {0x3726, 0x02}, // - + {0x3732, 0x02}, // - + {0x3734, 0x03}, // - + {0x3736, 0x03}, // - + {0x3742, 0x03}, // - + {0x3862, 0xE0}, // - + {0x38CC, 0x30}, // - + {0x38CD, 0x2F}, // - + {0x395C, 0x0C}, // - + {0x3A42, 0xD1}, // - + {0x3A4C, 0x77}, // - + {0x3AE0, 0x02}, // - + {0x3AEC, 0x0C}, // - + {0x3B00, 0x2E}, // - + {0x3B06, 0x29}, // - + {0x3B98, 0x25}, // - + {0x3B99, 0x21}, // - + {0x3B9B, 0x13}, // - + {0x3B9C, 0x13}, // - + {0x3B9D, 0x13}, // - + {0x3B9E, 0x13}, // - + {0x3BA1, 0x00}, // - + {0x3BA2, 0x06}, // - + {0x3BA3, 0x0B}, // - + {0x3BA4, 0x10}, // - + {0x3BA5, 0x14}, // - + {0x3BA6, 0x18}, // - + {0x3BA7, 0x1A}, // - + {0x3BA8, 0x1A}, // - + {0x3BA9, 0x1A}, // - + {0x3BAC, 0xED}, // - + {0x3BAD, 0x01}, // - + {0x3BAE, 0xF6}, // - + {0x3BAF, 0x02}, // - + {0x3BB0, 0xA2}, // - + {0x3BB1, 0x03}, // - + {0x3BB2, 0xE0}, // - + {0x3BB3, 0x03}, // - + {0x3BB4, 0xE0}, // - + {0x3BB5, 0x03}, // - + {0x3BB6, 0xE0}, // - + {0x3BB7, 0x03}, // - + {0x3BB8, 0xE0}, // - + {0x3BBA, 0xE0}, // - + {0x3BBC, 0xDA}, // - + {0x3BBE, 0x88}, // - + {0x3BC0, 0x44}, // - + {0x3BC2, 0x7B}, // - + {0x3BC4, 0xA2}, // - + {0x3BC8, 0xBD}, // - + {0x3BCA, 0xBD}, // - + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x4018, 0xA7}, // TCLKPOST[15:0] + {0x401A, 0x57}, // TCLKPREPARE[15:0] + {0x401C, 0x5F}, // TCLKTRAIL[15:0] + {0x401E, 0x97}, // TCLKZERO[15:0] + {0x4020, 0x5F}, // THSPREPARE[15:0] + {0x4022, 0xAF}, // THSZERO[15:0] + {0x4024, 0x5F}, // THSTRAIL[15:0] + {0x4026, 0x9F}, // THSEXIT[15:0] + {0x4028, 0x4F}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_2m_30fps_init_table_4lane_HDR_DOL[] = +{ + /* + "IMX415-AAQR 2/2-line binning CSI-2_4lane 27MHz + AD:10bit Output:12bit 891Mbps + Master Mode DOL HDR 2frame VC + 29.999fps Integration Time LEF:1.004ms SEF:0.118ms" + */ + {0x3000, 0x01}, //Standby + {0x3002, 0x01}, //Master mode stop + {0x3008, 0x5D}, // BCWAIT_TIME[9:0] + {0x300A, 0x42}, // CPWAIT_TIME[9:0] + + {0x3020, 0x01}, // 01h: Horizontal 2 binning + {0x3021, 0x01}, // 01h: Vertical 2 binning + {0x3022, 0x01}, // 01h: Horizontal/Vertical 2x2-line binning(RGB only) + {0x3024, 0xF8}, // MAX[15:0] + {0x3025, 0x08}, // + {0x3028, 0x1B}, // HMAX[15:0] + {0x3029, 0x02}, // + {0x302C, 0x01}, // WDMODE[1:0] + {0x302D, 0x01}, // WDSEL[1:0] + {0x3031, 0x00}, // + {0x3033, 0x05}, // SYS_MODE[3:0] + {0x3050, 0x66}, // SHR0[19:0] + {0x3051, 0x11}, // + {0x3054, 0x09}, // SHR1[19:0] + {0x3060, 0x19}, // RHS1[19:0] + {0x30C0, 0x2A}, + {0x30C1, 0x00}, // XVS_DRV[1:0] + {0x30CC, 0x00}, + {0x30CD, 0x00}, + {0x30CF, 0x01}, // XVSMSKCNT_INT[1:0] + {0x30D9, 0x02}, + {0x30DA, 0x01}, + {0x3116, 0x23}, // INCKSEL2[7:0] + {0x3118, 0xC6}, // INCKSEL3[10:0] + {0x311A, 0xE7}, // INCKSEL4[10:0] + {0x311E, 0x23}, // INCKSEL5[7:0] + {0x32D4, 0x21}, // -- + {0x32EC, 0xA1}, // -- + {0x3452, 0x7F}, // -- + {0x3453, 0x03}, // -- + {0x358A, 0x04}, // -- + {0x35A1, 0x02}, // -- + {0x36BC, 0x0C}, // -- + {0x36CC, 0x53}, // -- + {0x36CD, 0x00}, // -- + {0x36CE, 0x3C}, // -- + {0x36D0, 0x8C}, // -- + {0x36D1, 0x00}, // -- + {0x36D2, 0x71}, // -- + {0x36D4, 0x3C}, // -- + {0x36D6, 0x53}, // -- + {0x36D7, 0x00}, // -- + {0x36D8, 0x71}, // -- + {0x36DA, 0x8C}, // -- + {0x36DB, 0x00}, // -- + {0x3701, 0x00}, // -- + {0x3724, 0x02}, // -- + {0x3726, 0x02}, // -- + {0x3732, 0x02}, // -- + {0x3734, 0x03}, // -- + {0x3736, 0x03}, // -- + {0x3742, 0x03}, // -- + {0x3862, 0xE0}, // -- + {0x38CC, 0x30}, // -- + {0x38CD, 0x2F}, // -- + {0x395C, 0x0C}, // -- + {0x3A42, 0xD1}, // -- + {0x3A4C, 0x77}, // -- + {0x3AE0, 0x02}, // -- + {0x3AEC, 0x0C}, // -- + {0x3B00, 0x2E}, // -- + {0x3B06, 0x29}, // -- + {0x3B98, 0x25}, // -- + {0x3B99, 0x21}, // -- + {0x3B9B, 0x13}, // -- + {0x3B9C, 0x13}, // -- + {0x3B9D, 0x13}, // -- + {0x3B9E, 0x13}, // -- + {0x3BA1, 0x00}, // -- + {0x3BA2, 0x06}, // -- + {0x3BA3, 0x0B}, // -- + {0x3BA4, 0x10}, // -- + {0x3BA5, 0x14}, // -- + {0x3BA6, 0x18}, // -- + {0x3BA7, 0x1A}, // -- + {0x3BA8, 0x1A}, // -- + {0x3BA9, 0x1A}, // -- + {0x3BAC, 0xED}, // -- + {0x3BAD, 0x01}, // -- + {0x3BAE, 0xF6}, // -- + {0x3BAF, 0x02}, // -- + {0x3BB0, 0xA2}, // -- + {0x3BB1, 0x03}, // -- + {0x3BB2, 0xE0}, // -- + {0x3BB3, 0x03}, // -- + {0x3BB4, 0xE0}, // -- + {0x3BB5, 0x03}, // -- + {0x3BB6, 0xE0}, // -- + {0x3BB7, 0x03}, // -- + {0x3BB8, 0xE0}, // -- + {0x3BBA, 0xE0}, // -- + {0x3BBC, 0xDA}, // -- + {0x3BBE, 0x88}, // -- + {0x3BC0, 0x44}, // -- + {0x3BC2, 0x7B}, // -- + {0x3BC4, 0xA2}, // -- + {0x3BC8, 0xBD}, // -- + {0x3BCA, 0xBD}, // -- + {0x4004, 0xC0}, // TXCLKESC_FREQ[15:0] + {0x4005, 0x06}, // + {0x400C, 0x00}, + {0x4018, 0x7F}, // TCLKPOST[15:0] + {0x401A, 0x37}, // TCLKPREPARE[15:0] + {0x401C, 0x37}, // TCLKTRAIL[15:0] + {0x401E, 0xF7}, // TCLKZERO[15:0] + {0x401F, 0x00}, + {0x4020, 0x3F}, // THSPREPARE[15:0] + {0x4022, 0x6F}, // THSZERO[15:0] + {0x4024, 0x3F}, // THSTRAIL[15:0] + {0x4026, 0x5F}, // THSEXIT[15:0] + {0x4028, 0x2F}, // TLPX[15:0] + {0x4074, 0x01}, // TLPX[15:0] + {0xffff, 0x10}, + {0x3000, 0x00}, //Operating + {0xffff, 0x10}, + {0x3002, 0x00}, //Master mode start + {0x3260, 0x00}, //Gain_Pgc_Fidmd +}; + +const static I2C_ARRAY Sensor_id_table[] = { + {0x3F12, 0x14}, // {address of ID, ID }, + {0x3F13, 0x75}, // {address of ID, ID }, +}; + +static I2C_ARRAY PatternTbl[] = { + {0x0000,0x00}, // colorbar pattern , bit 0 to enable +}; + +const static I2C_ARRAY expo_reg[] = { // SHS0 (For Linear) + {0x3052, 0x00}, + {0x3051, 0x00}, + {0x3050, 0x08}, +}; + +const static I2C_ARRAY expo_SHR0_reg[] = { // SHS0 (For LEF) + {0x3052, 0x00}, + {0x3051, 0x16}, + {0x3050, 0x22}, +}; + +const static I2C_ARRAY expo_SHR1_reg[] = { // SHS1 (For SEF) + //decreasing exposure ratio version. + {0x3056, 0x00}, + {0x3055, 0x00}, + {0x3054, 0x09}, +}; + +const static I2C_ARRAY vts_reg[] = { //VMAX + {0x3026, 0x00}, //bit0-3-->MSB + {0x3025, 0x08}, + {0x3024, 0xCA}, +}; + +const static I2C_ARRAY vts_reg_hdr[] = { + {0x3026, 0x00}, //bit0-3-->MSB + {0x3025, 0x0B}, + {0x3024, 0x3B}, +}; + +const I2C_ARRAY expo_RHS1_reg[] = { + //decreasing exposure ratio version. + {0x3062, 0x00}, + {0x3061, 0x00}, + {0x3060, 0x11}, +}; + +const static I2C_ARRAY gain_reg[] = { + {0x3090, 0x2A},//low bit + {0x3091, 0x00},//hcg mode,bit 4 +}; + +const static I2C_ARRAY gain_HDR_DOL_LEF_reg[] = { + {0x3090, 0x2A}, + {0x3091, 0x00}, +}; + +const static I2C_ARRAY gain_HDR_DOL_SEF_reg[] = { + {0x3092, 0x20}, + {0x3093, 0x00}, +}; + +//static int g_sensor_ae_min_gain = 1024; +static CUS_GAIN_GAP_ARRAY gain_gap_compensate[16] = { //compensate gain gap + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0}, + {0, 0} +}; + +///////////////////////////////////////////////////////////////// +// @@@@@@@ // +// @@ // +// @@ // +// @@@ // +// @ @@ // +// @@@@ // +// // +// Step 3 -- complete camera features // +// // +// camera set EV, MWB, orientation, contrast, sharpness // +// , saturation, and Denoise can work correctly. // +// // +///////////////////////////////////////////////////////////////// + +#if 0 +static CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////////////// I2C function definition /////////////////// +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent /////////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif + +static int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +/*******I5/I6 Support MCLK List******* + * CUS_CMU_CLK_27MHZ, + * CUS_CMU_CLK_21P6MHZ, + * CUS_CMU_CLK_12MHZ, + * CUS_CMU_CLK_5P4MHZ, + * CUS_CMU_CLK_36MHZ, + * CUS_CMU_CLK_54MHZ, + * CUS_CMU_CLK_43P2MHZ, + * CUS_CMU_CLK_61P7MHZ, + * CUS_CMU_CLK_72MHZ, + * CUS_CMU_CLK_48MHZ, + * CUS_CMU_CLK_24MHZ, + * CUS_CMU_CLK_37P125MHZ, + ******End of Support MCLK List*******/ +#if 0 +static CUS_MCLK_FREQ UseParaMclk(const char *mclk) +{ + if (strcmp(mclk, "27M") == 0) { + return CUS_CMU_CLK_27MHZ; + } else if (strcmp(mclk, "12M") == 0) { + return CUS_CMU_CLK_12MHZ; + } else if (strcmp(mclk, "36M") == 0) { + return CUS_CMU_CLK_36MHZ; + } else if (strcmp(mclk, "48M") == 0) { + return CUS_CMU_CLK_48MHZ; + } else if (strcmp(mclk, "54M") == 0) { + return CUS_CMU_CLK_54MHZ; + } else if (strcmp(mclk, "24M") == 0) { + return CUS_CMU_CLK_24MHZ; + } else if (strcmp(mclk, "37.125M") == 0) { + return CUS_CMU_CLK_37P125MHZ; + } + return Preview_MCLK_SPEED; +} +#endif + +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + //Sensor power on sequence + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); // Powerdn Pull Low + sensor_if->Reset(idx, handle->reset_POLARITY); // Rst Pull Low + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, ENABLE); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 1); + } + + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + //Sensor board PWDN Enable, 1.8V & 2.9V need 30ms then Pull High + SENSOR_MSLEEP(31); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_UDELAY(1); + sensor_if->MCLK(idx, 1, handle->mclk); + SENSOR_DMSG("Sensor Power On finished\n"); + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); // Powerdn Pull Low + sensor_if->Reset(idx, handle->reset_POLARITY); // Rst Pull Low + sensor_if->MCLK(idx, 0, handle->mclk); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_SONY_DOL) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + + handle->orient = SENSOR_ORIT; + + return SUCCESS; +} + +/////////////////// Check Sensor Product ID ///////////////////////// +static int pCus_CheckSensorProductID(ms_cus_sensor *handle) +{ + u16 sen_id_msb, sen_id_lsb; + + /* Read Product ID */ + SensorReg_Read(0x3f12, (void*)&sen_id_lsb); + SensorReg_Read(0x3f13, (void*)&sen_id_msb);//CHIP_ID_r3F13 +#if 0 + if (sen_data != CHIP_ID) { + printk("[***ERROR***]Check Product ID Fail: 0x%x\n", sen_data); + return FAIL; + } +#endif + return SUCCESS; +} +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + for(n=0;n8) + table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>3) + return FAIL; + + if(SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + SENSOR_MSLEEP(1); + } + + //convert sensor id to u32 format + for(i=0;iprivate_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_linear);i++) + { + if(Sensor_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_8m_20fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_8m_20fps_init_table_4lane_linear);i++) + { + if(Sensor_8m_20fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_8m_20fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_8m_20fps_init_table_4lane_linear[i].reg, Sensor_8m_20fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_8m_20fps_init_table_4lane_linear[i].reg, Sensor_8m_20fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_8m_20fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_8m_20fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_8m_20fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_8m_20fps_init_table_4lane_linear[i].reg, Sensor_8m_20fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} +static int pCus_init_6m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_6m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_6m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_6m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_6m_30fps_init_table_4lane_linear[i].reg, Sensor_6m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_6m_30fps_init_table_4lane_linear[i].reg, Sensor_6m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_6m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_6m_30fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_6m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_6m_30fps_init_table_4lane_linear[i].reg, Sensor_6m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_5p3m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_5p3m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_5p3m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_5p3m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_5p3m_30fps_init_table_4lane_linear[i].reg, Sensor_5p3m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_5p3m_30fps_init_table_4lane_linear[i].reg, Sensor_5p3m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_5p3m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_8m20_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_5p3m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_5p3m_30fps_init_table_4lane_linear[i].reg, Sensor_5p3m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +#if 0 +static int pCus_init_5m_25fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_5m_25fps_init_table_4lane_linear);i++) + { + if(Sensor_5m_25fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_5m_25fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_5m_25fps_init_table_4lane_linear[i].reg, Sensor_5m_25fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_5m_25fps_init_table_4lane_linear[i].reg, Sensor_5m_25fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_5m_25fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_5m_25fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_5m_25fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_5m_25fps_init_table_4lane_linear[i].reg, Sensor_5m_25fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} +#endif + +static int pCus_init_5m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_5m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_5m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_5m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_5m_30fps_init_table_4lane_linear[i].reg, Sensor_5m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_5m_30fps_init_table_4lane_linear[i].reg, Sensor_5m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_5m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_5m_30fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_5m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_5m_30fps_init_table_4lane_linear[i].reg, Sensor_5m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + + +static int pCus_init_4p8m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_4p8m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_4p8m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_4p8m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_4p8m_30fps_init_table_4lane_linear[i].reg, Sensor_4p8m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_4p8m_30fps_init_table_4lane_linear[i].reg, Sensor_4p8m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_4p8m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_4p8m_30fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_4p8m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_4p8m_30fps_init_table_4lane_linear[i].reg, Sensor_4p8m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_3p6m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_3p6m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_3p6m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_3p6m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_3p6m_30fps_init_table_4lane_linear[i].reg, Sensor_3p6m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_3p6m_30fps_init_table_4lane_linear[i].reg, Sensor_3p6m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_3p6m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_3p6m_30fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_3p6m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_3p6m_30fps_init_table_4lane_linear[i].reg, Sensor_3p6m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_2m_60fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_2m_60fps_init_table_4lane_linear);i++) + { + if(Sensor_2m_60fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_2m_60fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_2m_60fps_init_table_4lane_linear[i].reg, Sensor_2m_60fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + } + } + + return SUCCESS; +} + +static int pCus_init_1m_120fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_1m_120fps_init_table_4lane_linear);i++) + { + if(Sensor_1m_120fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_1m_120fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_1m_120fps_init_table_4lane_linear[i].reg, Sensor_1m_120fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + } + } + + return SUCCESS; +} + +#if 0 +static int pCus_init_1m_135fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_1m_135fps_init_table_4lane_linear);i++) + { + if(Sensor_1m_135fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_1m_135fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_1m_135fps_init_table_4lane_linear[i].reg, Sensor_1m_135fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + } + } + + return SUCCESS; +} +#endif + +#if 0 +static int pCus_init_8m_30fps_mipi4lane_linear(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle) == FAIL) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_8m_30fps_init_table_4lane_linear);i++) + { + if(Sensor_8m_30fps_init_table_4lane_linear[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_8m_30fps_init_table_4lane_linear[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_8m_30fps_init_table_4lane_linear[i].reg, Sensor_8m_30fps_init_table_4lane_linear[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_8m_30fps_init_table_4lane_linear[i].reg, Sensor_8m_30fps_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_8m_30fps_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_8m_30fps_init_table_4lane_linear[i].data != sen_data) + printk("R/W Differ Reg: 0x%x\n",Sensor_8m_30fps_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_8m_30fps_init_table_4lane_linear[i].reg, Sensor_8m_30fps_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} +#endif + +static int pCus_init_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_HDR_DOL[i].reg,Sensor_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_HDR_DOL[i].reg, Sensor_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_init_table_4lane_linear[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_HDR_DOL[i].reg, Sensor_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + + SENSOR_DMSG("Sensor IMX415 HDR MODE Initial Finished\n"); + return SUCCESS; +} + +static int pCus_init_8m_20fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_8m_20fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg,Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg, Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].reg, Sensor_8m_20fps_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_8m_30fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_8m_30fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg,Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_8m_30fps_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +static int pCus_init_5m_30fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_5m_30fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_5m_30fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_5m_30fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_5m_30fps_init_table_4lane_HDR_DOL[i].reg,Sensor_5m_30fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data); +#if 0 + SensorReg_Read(Sensor_init_table_4lane_linear[i].reg, &sen_data ); + if(Sensor_init_table_4lane_linear[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_init_table_4lane_linear[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data, sen_data); +#endif + } + } + + return SUCCESS; +} + +#if 0 +static int pCus_init_5m_15fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + int i,cnt=0; + //s16 sen_data; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + + for(i=0;i< ARRAY_SIZE(Sensor_5m_15fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_5m_15fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_5m_15fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_5m_15fps_init_table_4lane_HDR_DOL[i].reg,Sensor_5m_15fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_linear[i].reg, Sensor_init_table_4lane_linear[i].data); + } + } + + printk("Sensor IMX415 HDR MODE Initial Finished\n"); + return SUCCESS; +} +#endif + +static int pCus_init_4p8m_30fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + for(i=0;i< ARRAY_SIZE(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg,Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_4p8m_30fps_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_4m_30fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + for(i=0;i< ARRAY_SIZE(Sensor_4m_30fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg,Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_4m_30fps_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_init_2m_30fps_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + int i,cnt=0; + + if (pCus_CheckSensorProductID(handle)) { + return FAIL; + } + for(i=0;i< ARRAY_SIZE(Sensor_2m_30fps_init_table_4lane_HDR_DOL);i++) + { + if(Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].reg,Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].data) != SUCCESS) + { + cnt++; + if(cnt>=10) + { + SENSOR_EMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //SENSOR_UDELAY(1); + } + //printk("\n reg 0x%x, 0x%x",Sensor_init_table_4lane_linear[i].reg, Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].data); +#if 0 + SensorReg_Read(Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].reg, &sen_data ); + if(Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].data != sen_data) + printk("HDR R/W Differ Reg: 0x%x\n",Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].reg); + //printk("IMX415 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].reg, Sensor_2m_30fps_init_table_4lane_HDR_DOL[i].data, sen_data); +#endif + } + } + return SUCCESS; +} + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_8m_20fps_mipi4lane_linear; + vts_30fps = 2813; + params->expo.vts = vts_30fps; + params->expo.fps = 20; + Preview_line_period = 17778; // 49.86ms/2813 = 17725ns + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_6m_30fps_mipi4lane_linear; + vts_30fps = 2250; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815; + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 2: + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_5p3m_30fps_mipi4lane_linear; + vts_30fps = 2250; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815; + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 3: + handle->video_res_supported.ulcur_res = 3; + handle->pCus_sensor_init = pCus_init_5m_30fps_mipi4lane_linear; + vts_30fps = 2144; + params->expo.vts = vts_30fps; + params->expo.fps = 25; + Preview_line_period = 15547; + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 4: + handle->video_res_supported.ulcur_res = 4; + handle->pCus_sensor_init = pCus_init_4p8m_30fps_mipi4lane_linear; + vts_30fps = 2250; + params->expo.vts = vts_30fps; + params->expo.fps = 25; + Preview_line_period = 14815; + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 5: + handle->video_res_supported.ulcur_res = 5; + handle->pCus_sensor_init = pCus_init_3p6m_30fps_mipi4lane_linear; + vts_30fps = 2250; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815; + handle->data_prec = CUS_DATAPRECISION_10; + break; + case 6: + handle->video_res_supported.ulcur_res = 6; + handle->pCus_sensor_init = pCus_init_2m_60fps_mipi4lane_linear; + vts_30fps = 2296; + params->expo.vts = vts_30fps; + params->expo.fps = 60; + Preview_line_period = 7259; + handle->data_prec = CUS_DATAPRECISION_12; + break; + case 7: + handle->video_res_supported.ulcur_res = 7; + handle->pCus_sensor_init = pCus_init_1m_120fps_mipi4lane_linear; + vts_30fps = 1644; + params->expo.vts = vts_30fps; + params->expo.fps = 120; + Preview_line_period = 4866; // 8ms/1644 = 4866ns; + handle->data_prec = CUS_DATAPRECISION_12; + break; +#if 0 + case 8: + handle->video_res_supported.ulcur_res = 8; + handle->pCus_sensor_init = pCus_init_1m_135fps_mipi4lane_linear; + vts_30fps = 1507; + params->expo.vts = vts_30fps; + params->expo.fps = 120; + Preview_line_period = 4645; // 7ms/1507 = 4645ns; + handle->data_prec = CUS_DATAPRECISION_12; + break; +#endif + default: + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_8m_20fps_mipi4lane_linear; + vts_30fps = 2813; + params->expo.vts = vts_30fps; + params->expo.fps = 20; + Preview_line_period = 17725; // 49.86ms/2813 = 17725ns + handle->data_prec = CUS_DATAPRECISION_10; + break; + } + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL_LEF(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case HDR_RES_1: + case HDR_RES_7: + handle->data_prec = CUS_DATAPRECISION_12; + break; + case HDR_RES_2: + case HDR_RES_3: + case HDR_RES_4: + case HDR_RES_5: + case HDR_RES_6: + handle->data_prec = CUS_DATAPRECISION_10; + break; + default: + break; + } + return SUCCESS; +} + +static int pCus_SetVideoRes_HDR_DOL_SEF(ms_cus_sensor *handle, u32 res_idx) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + SENSOR_EMSG("[%s] Please check the number of resolutions supported by the sensor!\n", __FUNCTION__); + return FAIL; + } + + handle->video_res_supported.ulcur_res = res_idx; + + switch (res_idx) { + case HDR_RES_1: + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2250; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 15; + Preview_line_period_HDR_DOL_4LANE = 29630; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + break; + case HDR_RES_2: + handle->pCus_sensor_init = pCus_init_8m_20fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 3450; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 20; + Preview_line_period_HDR_DOL_4LANE = 14493; + handle->data_prec = CUS_DATAPRECISION_10; + params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + break; + case HDR_RES_3: + handle->pCus_sensor_init = pCus_init_8m_30fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2300; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 14493; + handle->data_prec = CUS_DATAPRECISION_10; + params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + break; + case HDR_RES_4: + handle->pCus_sensor_init = pCus_init_5m_30fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2300; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 14493; + handle->data_prec = CUS_DATAPRECISION_10; + params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + break; + case HDR_RES_5: + handle->pCus_sensor_init = pCus_init_4p8m_30fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2300; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 14493; + handle->data_prec = CUS_DATAPRECISION_10; + params->min_rhs1 = 365; // 4n+1 fix to 269, 337 //5ms: 429 + break; + case HDR_RES_6: + handle->pCus_sensor_init = pCus_init_4m_30fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2300; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 14493; + handle->data_prec = CUS_DATAPRECISION_10; + params->min_rhs1 = 365; // 4ms: 343 //5ms: 429 + break; + case HDR_RES_7: + handle->pCus_sensor_init = pCus_init_2m_30fps_mipi4lane_HDR_DOL; + vts_30fps_HDR_DOL_4lane = 2296; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + params->expo.fps = 30; + Preview_line_period_HDR_DOL_4LANE = 14518; + handle->data_prec = CUS_DATAPRECISION_12; + params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + break; + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + s16 sen_data; + + //Read SENSOR MIRROR-FLIP STATUS + SensorReg_Read(MIRROR_FLIP, (void*)&sen_data); + + switch(sen_data & SENSOR_MIRROR_FLIP_EN) + { + case SENSOR_NOR: + *orit = CUS_ORIT_M0F0; + break; + case SENSOR_FLIP_EN: + *orit = CUS_ORIT_M0F1; + break; + case SENSOR_MIRROR_EN: + *orit = CUS_ORIT_M1F0; + break; + case SENSOR_MIRROR_FLIP_EN: + *orit = CUS_ORIT_M1F1; + break; + } + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx415_params *params = (imx415_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int DoOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + s16 sen_data; + //Read SENSOR MIRROR-FLIP STATUS + SensorReg_Read(MIRROR_FLIP, (void*)&sen_data); + sen_data &= ~(SENSOR_MIRROR_FLIP_EN); + + switch(orit) + { + case CUS_ORIT_M0F0: + //sen_data |= SENSOR_NOR; + handle->orient = CUS_ORIT_M0F0; + break; + case CUS_ORIT_M1F0: + sen_data |= SENSOR_MIRROR_EN; + handle->orient = CUS_ORIT_M1F0; + break; + case CUS_ORIT_M0F1: + sen_data |= SENSOR_FLIP_EN; + handle->orient = CUS_ORIT_M0F1; + break; + case CUS_ORIT_M1F1: + sen_data |= SENSOR_MIRROR_FLIP_EN; + handle->orient = CUS_ORIT_M1F1; + break; + default : + handle->orient = CUS_ORIT_M0F0; + break; + } + //Write SENSOR MIRROR-FLIP STATUS + SensorReg_Write(MIRROR_FLIP, sen_data); + + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + //u32 vts = 0, cur_vts_30fps = 0; + imx415_params *params = (imx415_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + //pr_info("[%s] leslie_fps,maxfps,minfps : %d,%d,%d\n\n", __FUNCTION__,fps,max_fps,min_fps); + //cur_vts_30fps = vts_30fps; + //pr_info("[%s] leslie_vts_30fps : %u\n\n", __FUNCTION__,vts_30fps); + if(fps>=min_fps && fps <= max_fps){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps>29?29:fps; //limit fps at 29 fps due to MCLK=36MHz + params->expo.vts= (vts_30fps*29091 + fps * 500)/(fps * 1000); + } + else + params->expo.vts= (vts_30fps*(max_fps*1000) + fps * 500)/(fps * 1000); + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps>29091?29091:fps; //limit fps at 29.091 fps due to MCLK=36MHz + params->expo.vts= (vts_30fps*29091 + (fps>>1))/fps; + } + else + params->expo.vts= (vts_30fps*(max_fps*1000) + (fps>>1))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + //pr_info("[%s] leslie_vts : %u\n\n", __FUNCTION__,params->expo.vts); + if(params->expo.expo_lines > params->expo.vts - 4){ + //vts = params->expo.expo_lines + 4; +#if 0 //Update FPS Status + if(fps>=3 && fps <= 30) + fps = (vts_30fps*30000)/(params->expo.vts * 1000 - 500); + else if(fps>=3000 && fps <= 30000) + fps = (vts_30fps*30000)/(params->expo.vts - (500 / 1000)); +#endif + }else{ + //vts = params->expo.vts; + } + + params->expo.fps = fps; + params->dirty = true; + + pCus_SetAEUSecs(handle, params->expo.expo_lef_us); + + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_SEF(ms_cus_sensor *handle) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF(ms_cus_sensor *handle, u32 fps) +{ + u32 cur_vts_30fps = 0; + imx415_params *params = (imx415_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + //cur_vts_30fps = imx415_mipi_hdr[0].senout.height; + cur_vts_30fps=vts_30fps_HDR_DOL_4lane; + if(fps>=min_fps && fps <= max_fps){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps > 14 ? 14 : fps;//limit fps at 29 fps due to MCLK=36MHz + params->expo.vts= (cur_vts_30fps*14545 + fps * 500 )/ (fps * 1000); + } + else + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps > 14545 ? 14545 : fps;//limit fps at 29.091 fps due to MCLK=36MHz + params->expo.vts= (cur_vts_30fps*14545 + (fps >> 1))/fps; + } + else + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + (fps >> 1))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts - 4){ + //vts = params->expo.expo_lines + 4; +#if 0 //Update FPS Status + if(fps>=3 && fps <= 30) + fps = (vts_30fps*30000)/(params->expo.vts * 1000 - 500); + else if(fps>=3000 && fps <= 30000) + fps = (vts_30fps*30000)/(params->expo.vts - (500 / 1000)); +#endif + }else{ + //vts = params->expo.vts; + } + + params->expo.fps = fps; + //params->expo.vts = vts; + params->dirty = true; + + pCus_SetAEUSecsHDR_DOL_SEF(handle, params->expo.expo_sef_us); + + return SUCCESS; +} + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx415_params *params = (imx415_params *)handle->private_data; + //ISensorIfAPI2 *sensor_if1 = handle->sensor_if_api2; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); // Global hold on + if(params->dirty) { + SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); // Global hold off + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //imx415_params *params = (imx415_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: +#if 0 + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + + if(params->dirty) { + //SensorRegArrayW((I2C_ARRAY*)params->tExpo_reg, ARRAY_SIZE(expo_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tGain_reg, ARRAY_SIZE(gain_reg)); + //SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg)); + params->dirty = false; + } + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } +#endif + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) +{ + u32 lines = 0; + imx415_params *params = (imx415_params *)handle->private_data; + + lines |= (u32)(params->tExpo_reg[0].data & 0x03) << 16; + lines |= (u32)(params->tExpo_reg[1].data & 0xff) << 8; + lines |= (u32)(params->tExpo_reg[2].data & 0xff) << 0; + + *us = (lines * Preview_line_period) / 1000; + + SENSOR_DMSG("[%s] sensor expo lines/us %u,%u us\n", __FUNCTION__, lines, *us); + + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) +{ + u32 expo_lines = 0, vts = 0, SHR0 = 0; + imx415_params *params = (imx415_params *)handle->private_data; + + params->expo.expo_lef_us = us; + expo_lines = (1000*us)/Preview_line_period; + + if (expo_lines > params->expo.vts) { + vts = expo_lines + 8; + } + else + vts = params->expo.vts; + SHR0 = vts - expo_lines; + + if (SHR0 <= 12 ) // 8+4 + SHR0 = 8; + else + SHR0 -= 4; + + params->expo.expo_lines = expo_lines; + //params->expo.vts = vts; + + SENSOR_DMSG("[%s] us %u, SHR0 %u, vts %u\n", __FUNCTION__, + us, \ + SHR0, \ + vts + ); + //pr_info("[%s] leslie_shutter,expo_lines,params_expo_lines : %d,%d,%d\n\n", __FUNCTION__,us,expo_lines,params->expo.expo_lines); + //pr_info("[%s] leslie_shutter_vts : %u,%u\n\n", __FUNCTION__,params->expo.vts,vts); + params->tExpo_reg[0].data = (SHR0>>16) & 0x0003; + params->tExpo_reg[1].data = (SHR0>>8) & 0x00ff; + params->tExpo_reg[2].data = (SHR0>>0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us) +{ + u32 expo_line_sef = 0; + u32 cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + imx415_params *params = (imx415_params *)handle->private_data; + + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //cur_vts_30fps =vts_30fps_HDR_DOL_4lane; + expo_line_sef = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + params->expo.expo_sef_us = us; + //params->min_rhs1 = 437; // 4n+1 fix to 269, 337 //5ms: 429 + + params->min_shr1 = params->min_rhs1 - expo_line_sef; + if((expo_line_sef > params->min_rhs1) || ((params->min_shr1) < 9)) + params->min_shr1 = 9; + params->min_shr1 = ((params->min_shr1 >> 1) << 1) + 1; + + SENSOR_DMSG("[%s] us %u, expo_line_sef %u rhs %u shr1 %u\n", __FUNCTION__, + us, \ + expo_line_sef, \ + params->min_rhs1, \ + params->min_shr1 + ); + + params->tRHS1_reg[0].data = (params->min_rhs1 >>16) & 0x03; + params->tRHS1_reg[1].data = (params->min_rhs1 >>8) & 0xff; + params->tRHS1_reg[2].data = (params->min_rhs1 >>0) & 0xff; + + params->tSHR1_reg[0].data = (params->min_shr1 >> 16) & 0x0003; + params->tSHR1_reg[1].data = (params->min_shr1 >> 8) & 0x00ff; + params->tSHR1_reg[2].data = (params->min_shr1 >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) +{ + imx415_params *params = (imx415_params *)handle->private_data; +#if 0 + u16 temp_gain; + + temp_gain=gain_reg[0].data; + *gain=(u32)(10^((temp_gain*3)/200))*1024; + if (gain_reg[1].data & 0x10) + *gain = (*gain) * 2; +#endif + *gain = params->expo.final_gain; + SENSOR_DMSG("[%s] get gain %u\n", __FUNCTION__, *gain); + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 i; + CUS_GAIN_GAP_ARRAY* Sensor_Gain_Linearity; + u64 gain_double; + + params->expo.final_gain = gain; + if(gain < SENSOR_MIN_GAIN) + gain = SENSOR_MIN_GAIN; + else if(gain >= SENSOR_MAX_GAIN) + gain = SENSOR_MAX_GAIN; + + Sensor_Gain_Linearity = gain_gap_compensate; + + for(i = 0; i < sizeof(gain_gap_compensate)/sizeof(CUS_GAIN_GAP_ARRAY); i++){ + if (Sensor_Gain_Linearity[i].gain == 0) + break; + if((gain>Sensor_Gain_Linearity[i].gain) && (gain < (Sensor_Gain_Linearity[i].gain + Sensor_Gain_Linearity[i].offset))){ + gain=Sensor_Gain_Linearity[i].gain; + break; + } + } + gain_double = 20 * (intlog10(gain) - intlog10(1024)); + gain_double = (u16)((gain_double * 10) >> 24) / 3; + + params->tGain_reg[0].data = gain_double & 0xff; + params->tGain_reg[1].data = (gain_double >> 8) & 0xff; + +#if DEBUG_INFO + SENSOR_DMSG("[%s]gain %u gain_double %llu\n",__FUNCTION__, gain, gain_double); +#endif + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x 0x%x\n", __FUNCTION__, gain,params->tGain_reg[0].data, gain,params->tGain_reg[1].dat); + params->dirty = true; + return SUCCESS; +} + +static void pCus_SetAEGainHDR_DOL_Calculate(u32 gain, u16 *gain_reg) +{ + //double gain_double; + u64 gain_double; + + if(gain < SENSOR_MIN_GAIN){ + gain = SENSOR_MIN_GAIN; + } + else if(gain >= SENSOR_MAX_GAIN){ + gain = SENSOR_MAX_GAIN; + } + gain_double = 20 * (intlog10(gain) - intlog10(1024)); + *gain_reg =(u16)((gain_double * 10) >> 24) / 3; +} + +static int pCus_SetAEGainHDR_DOL_SEF1(ms_cus_sensor *handle, u32 gain) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_sef_reg[0].data = gain_reg & 0xff; + params->tGain_hdr_dol_sef_reg[1].data = (gain_reg >> 8) & 0xff; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x 0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_sef_reg[0].data, params->tGain_hdr_dol_sef_reg[1].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx415_mipi_linear[0].senout.min_fps; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = SENSOR_MIN_GAIN;//handle->sat_mingain; + *max = SENSOR_MAX_GAIN;//10^(72db/20)*1024; + return SUCCESS; +} + +static int IMX415_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx415_mipi_linear[0].senout.min_fps;// + info->min = (Preview_line_period * 1); + info->step = Preview_line_period; + return SUCCESS; +} + +static int IMX415_GetShutterInfo_HDR_DOL_SEF(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + imx415_params *params = (imx415_params *)handle->private_data; + info->max = Preview_line_period_HDR_DOL_4LANE * params->min_rhs1; + info->min = (Preview_line_period_HDR_DOL_4LANE * 5); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx415_params *params; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx415_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg, sizeof(vts_reg)); + memcpy(params->tGain_reg, gain_reg, sizeof(gain_reg)); + memcpy(params->tExpo_reg, expo_reg, sizeof(expo_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX415_MIPI"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D8; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x34; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //300000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + //handle->mclk = UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + handle->mclk = Preview_MCLK_SPEED; + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = LINEAR_RES_END; + for (res = 0; res < LINEAR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx415_mipi_linear[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx415_mipi_linear[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx415_mipi_linear[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx415_mipi_linear[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx415_mipi_linear[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx415_mipi_linear[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx415_mipi_linear[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx415_mipi_linear[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx415_mipi_linear[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + //handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear; + //handle->pCus_sensor_powerupseq = pCus_powerupseq; + handle->pCus_sensor_poweron = pCus_poweron; + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien; + handle->pCus_sensor_GetFPS = pCus_GetFPS; + handle->pCus_sensor_SetFPS = pCus_SetFPS; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = imx415_SetPatternMode; //NONE + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT; + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + handle->sat_mingain = SENSOR_MIN_GAIN;//g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + //sensor calibration + //handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + //handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = IMX415_GetShutterInfo; + + params->expo.vts = vts_30fps; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_sef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx415_params *params = NULL; + int res; + + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //////////////////////////////////// + // private data allocation & init // + //////////////////////////////////// + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + + params = (imx415_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg_hdr, sizeof(vts_reg_hdr)); + memcpy(params->tRHS1_reg, expo_RHS1_reg, sizeof(expo_RHS1_reg)); + memcpy(params->tSHR1_reg, expo_SHR1_reg, sizeof(expo_SHR1_reg)); + memcpy(params->tGain_hdr_dol_sef_reg, gain_HDR_DOL_SEF_reg, sizeof(gain_HDR_DOL_SEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX415_MIPI_HDR_SEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; + //handle->data_fmt = SENSOR_DATAFMT; + handle->sif_bus = SENSOR_IFBUS_TYPE; + handle->data_prec = SENSOR_DATAPREC_DOL; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_lane_num = 4; // hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; // SONY IMX415 as VC mode + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = HDR_RES_END; + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx415_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx415_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx415_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx415_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx415_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx415_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx415_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx415_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx415_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + handle->pCus_sensor_poweron = pCus_poweron; // Need to check + handle->pCus_sensor_poweroff = pCus_poweroff; // Need to check + handle->pCus_sensor_GetSensorID = pCus_GetSensorID; // Need to check + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien; // Need to check + handle->pCus_sensor_SetOrien = pCus_SetOrien; // Need to check + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF; // Need to check + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF; // Need to check + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; //g_sensor_ae_min_gain; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; // Need to check + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF1; // Need to check + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + handle->pCus_sensor_GetShutterInfo = IMX415_GetShutterInfo_HDR_DOL_SEF; + params->expo.vts = vts_30fps_HDR_DOL_4lane; + + return SUCCESS; +} + +//lef functions +static int pCus_init_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +static int pCus_poweron_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_HDR_DOL_LEF(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_GetSensorID_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *id) +{ + return SUCCESS; +} + +static int pCus_GetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + return SUCCESS; +} + +static int pCus_SetOrien_HDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + imx415_params *params = (imx415_params *)handle->private_data; + + handle->orient = orit; + params->orien_dirty = true; + + return SUCCESS; +} + +static int pCus_GetFPS_HDR_DOL_LEF(ms_cus_sensor *handle) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (params->tVts_reg[0].data << 16) | (params->tVts_reg[1].data << 8) | (params->tVts_reg[2].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (cur_vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (cur_vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_LEF(ms_cus_sensor *handle, u32 fps) +{ + u32 cur_vts_30fps = 0;//vts = 0, + imx415_params *params = (imx415_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + // cur_vts_30fps = imx415_mipi_hdr[0].senout.height; + cur_vts_30fps=vts_30fps_HDR_DOL_4lane; + if(fps>=min_fps && fps <= max_fps){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps>14?14:fps;//limit fps at 29 fps due to MCLK=36MHz + params->expo.vts= (cur_vts_30fps*14545 + fps * 500 )/ (fps * 1000); + } + else + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + fps * 500 )/ (fps * 1000); + + }else if(fps>=(min_fps*1000) && fps <= (max_fps*1000)){ + if (CUS_CMU_CLK_36MHZ == handle->mclk) { + fps = fps>14?14:fps;//limit fps at 29.091 fps due to MCLK=36MHz + params->expo.vts= (cur_vts_30fps*14545 + (fps >> 1))/fps; + } + else + params->expo.vts= (cur_vts_30fps*(max_fps*1000) + (fps >> 1))/fps; + + }else { + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.expo_lines > params->expo.vts - 4) { + //vts = params->expo.expo_lines + 4; + }else { + //vts = params->expo.vts; + } + + params->dirty = true; + params->expo.fps = fps; + pCus_SetAEUSecsHDR_DOL_LEF(handle, params->expo.expo_sef_us); + + return SUCCESS; +} + +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + imx415_params *params = (imx415_params *)handle->private_data; + //ISensorIfAPI2 *sensor_if1 = handle->sensor_if_api2; + + switch(status) + { + case CUS_FRAME_INACTIVE: + + break; + case CUS_FRAME_ACTIVE: + + if(params->dirty || params->orien_dirty) { + SensorReg_Write(0x3001,1); + if(params->dirty) { + SensorRegArrayW((I2C_ARRAY*)params->tVts_reg, ARRAY_SIZE(vts_reg_hdr)); + SensorRegArrayW((I2C_ARRAY*)params->tSHR0_reg, ARRAY_SIZE(expo_SHR0_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tSHR1_reg, ARRAY_SIZE(expo_SHR1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tRHS1_reg, ARRAY_SIZE(expo_RHS1_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_lef_reg, ARRAY_SIZE(gain_HDR_DOL_LEF_reg)); + SensorRegArrayW((I2C_ARRAY*)params->tGain_hdr_dol_sef_reg, ARRAY_SIZE(gain_HDR_DOL_SEF_reg)); + params->dirty = false; + } + if(params->orien_dirty) { + DoOrien(handle, handle->orient); + params->orien_dirty = false; + } + SensorReg_Write(0x3001,0); + } + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetAEUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *us) +{ + *us = 0; + return SUCCESS; +} + +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + u32 expo_lines_lef = 0, vts = 0, fsc = 0; + u32 cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //u32 cur_vts_30fps = vts_30fps_HDR_DOL_4lane; + imx415_params *params = (imx415_params *)handle->private_data; + cur_line_period = Preview_line_period_HDR_DOL_4LANE; + //cur_vts_30fps =vts_30fps_HDR_DOL_4lane; + expo_lines_lef = (1000 * us + (cur_line_period >> 1)) / cur_line_period; + + params->expo.expo_lef_us = us; + fsc = params->expo.vts * 2; + params->fsc = ((fsc >> 2) << 2)+ 4; // 4n + + //params->max_shr0 = fsc - expo_lines_lef - 8; + params->max_shr0 = (fsc - 8) - expo_lines_lef; + if(params->max_shr0 < (params->min_rhs1+9)) + params->max_shr0 = params->min_rhs1+9; + params->max_shr0 = ((params->max_shr0 >> 1) << 1) + 2; + + if (expo_lines_lef > (fsc - params->min_rhs1 - 9)) { + vts = (expo_lines_lef + params->min_rhs1 + 9) / 2; + } + else{ + vts = params->expo.vts; + } + params->expo.expo_lines = expo_lines_lef; + //params->expo.vts = vts; + + SENSOR_DMSG("[%s] us %u, expo_lines_lef %u, vts %u, SHR0 %u \n", __FUNCTION__, + us, \ + expo_lines_lef, \ + vts, \ + params->max_shr0 + ); + params->tSHR0_reg[0].data = (params->max_shr0 >> 16) & 0x0003; + params->tSHR0_reg[1].data = (params->max_shr0 >> 8) & 0x00ff; + params->tSHR0_reg[2].data = (params->max_shr0 >> 0) & 0x00ff; + + params->tVts_reg[0].data = (vts >> 16) & 0x0003; + params->tVts_reg[1].data = (vts >> 8) & 0x00ff; + params->tVts_reg[2].data = (vts >> 0) & 0x00ff; + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32* gain) +{ + *gain = 0; + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_LEF(ms_cus_sensor *handle, u32 gain) +{ + imx415_params *params = (imx415_params *)handle->private_data; + u16 gain_reg = 0; + + pCus_SetAEGainHDR_DOL_Calculate(gain, &gain_reg); + params->tGain_hdr_dol_lef_reg[0].data = gain_reg & 0xff; + params->tGain_hdr_dol_lef_reg[1].data = (gain_reg >> 8) & 0xff; + + SENSOR_DMSG("[%s] set gain/reg=%u/0x%x\n", __FUNCTION__, gain, params->tGain_hdr_dol_lef_reg[0].data, params->tGain_hdr_dol_lef_reg[1].data); + + params->dirty = true; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = handle->sat_mingain; + *max = SENSOR_MAX_GAIN; + return SUCCESS; +} + +static int pCus_GetAEMinMaxUSecs_HDR_DOL_LEF(ms_cus_sensor *handle, u32 *min, u32 *max) +{ + *min = 1; + *max = 1000000/imx415_mipi_hdr[0].senout.min_fps; + return SUCCESS; +} + +#if 0 +//static int pCus_GetDGainRemainder(ms_cus_sensor *handle, u32 *dgain_remainder) +//{ +// *dgain_remainder = handle->dgain_remainder; + +// return SUCCESS; +//} + +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} +#endif + +static int IMX415_GetShutterInfo_HDR_DOL_LEF(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/imx415_mipi_hdr[0].senout.min_fps; + info->min = (Preview_line_period_HDR_DOL_4LANE * 5); + info->step = Preview_line_period_HDR_DOL_4LANE; + return SUCCESS; +} + +static int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + imx415_params *params; + s32 res; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (imx415_params *)handle->private_data; + memcpy(params->tVts_reg, vts_reg_hdr, sizeof(vts_reg_hdr)); + memcpy(params->tSHR0_reg, expo_SHR0_reg, sizeof(expo_SHR0_reg)); + memcpy(params->tGain_hdr_dol_lef_reg, gain_HDR_DOL_LEF_reg, sizeof(gain_HDR_DOL_LEF_reg)); + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"IMX415_MIPI_HDR_LEF"); + + //////////////////////////////////// + // i2c config // + //////////////////////////////////// + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + //////////////////////////////////// + // mclk // + //////////////////////////////////// + //handle->mclk = UseParaMclk(SENSOR_DRV_PARAM_MCLK()); + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE; //CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = 4;//hdr_lane_num; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + //handle->video_res_supported.num_res = HDR_RES_END; + for (res = 0; res < HDR_RES_END; res++) { + handle->video_res_supported.num_res = res+1; + handle->video_res_supported.res[res].width = imx415_mipi_hdr[res].senif.preview_w; + handle->video_res_supported.res[res].height = imx415_mipi_hdr[res].senif.preview_h; + handle->video_res_supported.res[res].max_fps = imx415_mipi_hdr[res].senout.max_fps; + handle->video_res_supported.res[res].min_fps = imx415_mipi_hdr[res].senout.min_fps; + handle->video_res_supported.res[res].crop_start_x = imx415_mipi_hdr[res].senif.crop_start_X; + handle->video_res_supported.res[res].crop_start_y = imx415_mipi_hdr[res].senif.crop_start_y; + handle->video_res_supported.res[res].nOutputWidth = imx415_mipi_hdr[res].senout.width; + handle->video_res_supported.res[res].nOutputHeight = imx415_mipi_hdr[res].senout.height; + sprintf(handle->video_res_supported.res[res].strResDesc, imx415_mipi_hdr[res].senstr.strResDesc); + } + + //////////////////////////////////// + // Sensor polarity // + //////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + //handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + //handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + //handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////// + // Sensor Status Control and Get Info // + //////////////////////////////////////// + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_HDR_DOL_LEF; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_HDR_DOL_LEF; + handle->pCus_sensor_poweroff = pCus_poweroff_HDR_DOL_LEF; + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_HDR_DOL_LEF; + //handle->pCus_sensor_GetVideoResNum = NULL; + //handle->pCus_sensor_GetVideoRes = NULL; + //handle->pCus_sensor_GetCurVideoRes = NULL; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL_LEF; // Need to check + + + handle->pCus_sensor_GetOrien = pCus_GetOrien_HDR_DOL_LEF; + handle->pCus_sensor_SetOrien = pCus_SetOrien_HDR_DOL_LEF; + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_LEF; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_LEF; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + //handle->pCus_sensor_SetPatternMode = imx415_SetPatternMode_hdr_dol_lef; + + //////////////////////////////////// + // AE parameters // + //////////////////////////////////// + handle->ae_gain_delay = SENSOR_GAIN_DELAY_FRAME_COUNT; + handle->ae_shutter_delay = SENSOR_SHUTTER_DELAY_FRAME_COUNT_HDR_DOL; + handle->ae_gain_ctrl_num = 2; + handle->ae_shutter_ctrl_num = 2; + handle->sat_mingain = SENSOR_MIN_GAIN; + //handle->dgain_remainder = 0; + + //////////////////////////////////// + // AE Control and Get Info // + //////////////////////////////////// + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs_HDR_DOL_LEF; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain_HDR_DOL_LEF; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_LEF; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain_HDR_DOL_LEF; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_HDR_DOL_LEF; + //handle->pCus_sensor_GetDGainRemainder = pCus_GetDGainRemainder; + + handle->pCus_sensor_GetShutterInfo = IMX415_GetShutterInfo_HDR_DOL_LEF; + + params->expo.vts = vts_30fps_HDR_DOL_4lane; + + params->dirty = false; + + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX(IMX415_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef, + cus_camsensor_init_handle_hdr_dol_lef, + imx415_params + ); diff --git a/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_sc8235_mipi.c b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_sc8235_mipi.c new file mode 100644 index 00000000..21905cb1 --- /dev/null +++ b/general/package/sigmastar-osdrv-sensor/src/infinity6e/sensor/sensor_sc8235_mipi.c @@ -0,0 +1,5134 @@ +/* SigmaStar trade secret */ +/* Copyright (c) [2019~2020] SigmaStar Technology. + All rights reserved. + + Unless otherwise stipulated in writing, any and all information contained + herein regardless in any format shall remain the sole proprietary of + SigmaStar and be kept in strict confidence + (SigmaStar Confidential Information) by the recipient. + Any unauthorized act including without limitation unauthorized disclosure, + copying, use, reproduction, sale, distribution, modification, disassembling, + reverse engineering and compiling of the contents of SigmaStar Confidential + Information is unlawful and strictly prohibited. SigmaStar hereby reserves the + rights to any and all damages, losses, costs and expenses resulting therefrom. + */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +SENSOR_DRV_ENTRY_IMPL_BEGIN_EX(SC8238_HDR); + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE CAM_OS_ARRAY_SIZE +#endif + +#define SENSOR_PAD_GROUP_SET CUS_SENSOR_PAD_GROUP_A +#define SENSOR_CHANNEL_NUM (0) +#define SENSOR_CHANNEL_MODE_LINEAR CUS_SENSOR_CHANNEL_MODE_REALTIME_NORMAL +#define SENSOR_CHANNEL_MODE_SONY_DOL CUS_SENSOR_CHANNEL_MODE_RAW_STORE_HDR + +//============================================ +//MIPI config begin. +#define SENSOR_MIPI_LANE_NUM (4) +//#define SENSOR_MIPI_HDR_MODE (2) //0: Non-HDR mode. 1:Sony DOL mode. 2:CUS_HDR_MODE_DCG +//MIPI config end. +//============================================ + +#define R_GAIN_REG 1 +#define G_GAIN_REG 2 +#define B_GAIN_REG 3 + + +//#undef SENSOR_DBG +#define SENSOR_DBG 0 + +/////////////////////////////////////////////////////////////// +// @@@ // +// @ @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@ == S t a r t * H e r e == // +// @@@@ // +// // +// Start Step 1 -- show preview on LCM // +// �@// +// Fill these #define value and table with correct settings // +// camera can work and show preview on LCM // +// // +/////////////////////////////////////////////////////////////// + +#define SENSOR_ISP_TYPE ISP_EXT //ISP_EXT, ISP_SOC +#define F_number 22 // CFG, demo module +//#define SENSOR_DATAFMT CUS_DATAFMT_BAYER //CUS_DATAFMT_YUV, CUS_DATAFMT_BAYER +#define SENSOR_IFBUS_TYPE CUS_SENIF_BUS_MIPI //CFG //CUS_SENIF_BUS_PARL, CUS_SENIF_BUS_MIPI +#define SENSOR_MIPI_HSYNC_MODE PACKET_HEADER_EDGE1 +#define SENSOR_MIPI_HSYNC_MODE_HDR_DOL PACKET_FOOTER_EDGE +#define SENSOR_DATAPREC CUS_DATAPRECISION_10 //CFG //CUS_DATAPRECISION_8, CUS_DATAPRECISION_10 +#define SENSOR_DATAPREC_HDR_DOL CUS_DATAPRECISION_10 +#define SENSOR_DATAMODE CUS_SEN_10TO12_9000 //CFG +//#define SENSOR_MAXGAIN (15875*315)/10000 /////sensor again 15.875 dgain=31.5 +#define SENSOR_MAXGAIN 500 /////sensor again 15.875 dgain=31.5 +#define SENSOR_BAYERID CUS_BAYER_BG //CFG //CUS_BAYER_GB, CUS_BAYER_GR, CUS_BAYER_BG, CUS_BAYER_RG +#define SENSOR_BAYERID_HDR_DOL CUS_BAYER_BG//CUS_BAYER_GR +#define SENSOR_RGBIRID CUS_RGBIR_NONE +#define SENSOR_ORIT CUS_ORIT_M0F0 //CUS_ORIT_M0F0, CUS_ORIT_M1F0, CUS_ORIT_M0F1, CUS_ORIT_M1F1, +#define SENSOR_MAX_GAIN 80 // max sensor again, a-gain +//#define SENSOR_YCORDER CUS_SEN_YCODR_YC //CUS_SEN_YCODR_YC, CUS_SEN_YCODR_CY +#define lane_number 4 +#define vc0_hs_mode 3 //0: packet header edge 1: line end edge 2: line start edge 3: packet footer edge +#define long_packet_type_enable 0x00 //UD1~UD8 (user define) + +#define Preview_MCLK_SPEED CUS_CMU_CLK_27MHZ //CFG //CUS_CMU_CLK_12M, CUS_CMU_CLK_16M, CUS_CMU_CLK_24M, CUS_CMU_CLK_27M +#define Preview_MCLK_SPEED_HDR_DOL CUS_CMU_CLK_27MHZ + +//#define Preview_line_period 30000 ////HTS/PCLK=4455 pixels/148.5MHZ=30usec @MCLK=36MHz +//#define vts_30fps 1125//1346,1616 //for 29.1fps @ MCLK=36MHz +//#define Preview_line_period //(36M/37.125M)*30fps=29.091fps(34.375msec), hts=34.375/1125=30556, +//#define Line_per_second 32727 +//#define vts_30fps +u32 Preview_line_period; +u32 vts_30fps; +u32 Preview_line_period_HDR_DOL = 14815; +u32 vts_30fps_HDR_DOL; +#define Preview_WIDTH 3840 //resolution Width when preview +#define Preview_HEIGHT 2160 //resolution Height when preview +#define Preview_MAX_FPS 15 //fastest preview FPS +#define Preview_MIN_FPS 3 //slowest preview FPS +#define Preview_CROP_START_X 0 //CROP_START_X +#define Preview_CROP_START_Y 0 //CROP_START_Y + +#define SENSOR_I2C_ADDR 0x60 //I2C slave address +#define SENSOR_I2C_SPEED 200000 //300000// 240000 //I2C speed, 60000~320000 + +#define SENSOR_I2C_LEGACY I2C_NORMAL_MODE //usally set CUS_I2C_NORMAL_MODE, if use old OVT I2C protocol=> set CUS_I2C_LEGACY_MODE +#define SENSOR_I2C_FMT I2C_FMT_A16D8 //CUS_I2C_FMT_A8D8, CUS_I2C_FMT_A8D16, CUS_I2C_FMT_A16D8, CUS_I2C_FMT_A16D16 + +#define SENSOR_PWDN_POL CUS_CLK_POL_NEG // if PWDN pin High can makes sensor in power down, set CUS_CLK_POL_POS +#define SENSOR_RST_POL CUS_CLK_POL_NEG // if RESET pin High can makes sensor in reset state, set CUS_CLK_POL_NEG + +// VSYNC/HSYNC POL can be found in data sheet timing diagram, +// Notice: the initial setting may contain VSYNC/HSYNC POL inverse settings so that condition is different. + +#define SENSOR_VSYNC_POL CUS_CLK_POL_NEG // if VSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_HSYNC_POL CUS_CLK_POL_NEG // if HSYNC pin High and data bus have data, set CUS_CLK_POL_POS +#define SENSOR_PCLK_POL CUS_CLK_POL_POS // depend on sensor setting, sometimes need to try CUS_CLK_POL_POS or CUS_CLK_POL_NEG + +#if defined (SENSOR_MODULE_VERSION) +#define TO_STR_NATIVE(e) #e +#define TO_STR_PROXY(m, e) m(e) +#define MACRO_TO_STRING(e) TO_STR_PROXY(TO_STR_NATIVE, e) +static char *sensor_module_version = MACRO_TO_STRING(SENSOR_MODULE_VERSION); +module_param(sensor_module_version, charp, S_IRUGO); +#endif +static int cus_camsensor_release_handle(ms_cus_sensor *handle); +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain); +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us); +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +static int pCus_SetOrien_HDR(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit); +//static int sc8238_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info); +#define ABS(a) ((a)>(0) ? (a) : (-(a))) +static int g_sensor_ae_min_gain = 1024; + +CUS_MCLK_FREQ UseParaMclk(void); + +typedef struct { + struct { + u16 pre_div0; + u16 div124; + u16 div_cnt7b; + u16 sdiv0; + u16 mipi_div0; + u16 r_divp; + u16 sdiv1; + u16 r_seld5; + u16 r_sclk_dac; + u16 sys_sel; + u16 pdac_sel; + u16 adac_sel; + u16 pre_div_sp; + u16 r_div_sp; + u16 div_cnt5b; + u16 sdiv_sp; + u16 div12_sp; + u16 mipi_lane_sel; + u16 div_dac; + } clk_tree; + struct { + u32 sclk; + u32 hts; + u32 vts; + u32 ho; + u32 xinc; + u32 line_freq; + u32 us_per_line; + u32 final_us; + u32 final_gain; + u32 back_pv_us; + u32 half_lines; + u32 half_line; + u32 fps; + u32 preview_fps; + u32 max_short_exp; + u32 line; + } expo; + struct { + bool bVideoMode; + u16 res_idx; + // bool binning; + // bool scaling; + CUS_CAMSENSOR_ORIT orit; + } res; + + int sen_init; + int still_min_fps; + int video_min_fps; + bool reg_mf; + bool reg_dirty; + CUS_CAMSENSOR_ORIT cur_orien; +} sc8238_params; +// set sensor ID address and data, + +typedef struct { + u64 gain; + u8 fine_gain_reg; +} FINE_GAIN; + +I2C_ARRAY Sensor_id_table[] = +{ + {0x3107, 0x82}, + {0x3108, 0x35}, +}; + +I2C_ARRAY Sensor_init_table_4lane_4K30fps[] = +{ +//0x02_Apollo_30fps_10bit_4lane_708.75Mbps_3840x2160(HTS=4200,VTS=2250).ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x336c,0xc2}, +{0x3624,0x45}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x5799,0x06}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e0e,0x09}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x1c}, +{0x3366,0x92}, +{0x3314,0x94}, +{0x334c,0x10}, +{0x3e09,0x40}, +{0x3e08,0x03}, +{0x3637,0x52}, +{0x3631,0x80}, +{0x3308,0x20}, +{0x335d,0x60}, +{0x337f,0x33}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x3367,0x08}, +{0x330e,0x58}, +{0x33af,0x48}, +{0x3638,0x0a}, +{0x3306,0xa8}, +{0x3309,0x68}, +{0x331f,0x59}, +{0x330d,0x28}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x3332,0x24}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x3628,0x83}, +{0x3633,0x53}, +{0x3630,0x80}, +{0x3622,0xf7}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x363a,0x88}, +{0x3e26,0x40}, +{0x360f,0x01}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3670,0x4a}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x3699,0x88}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x3364,0x16}, +{0x3301,0x1c}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3981,0x70}, +{0x3984,0x20}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3980,0x71}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39c5,0x30}, +{0x330b,0x48}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x320e,0x08}, +{0x320f,0xca}, +{0x3635,0x02}, +{0x3902,0xc5}, +{0x3038,0x44}, +{0x3632,0x98}, +{0x3e14,0x31}, +{0x3e1b,0x3a}, +{0x3248,0x04}, +{0x3901,0x00}, +{0x3904,0x18}, +{0x3987,0x0b}, +{0x363b,0x06}, +{0x3905,0xd8}, +{0x301f,0x02}, +{0x3203,0x08}, +{0x3207,0x87}, +{0x3213,0x08}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x3641,0x0c}, +{0x36f9,0x57}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x36e9,0x53}, +{0x36ea,0x39}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x3641,0x00}, +{0x0100,0x01}, +}; + +I2C_ARRAY Sensor_init_table_4lane_4K20fps[] = +{ +//cleaned_0x32_SC8235_MIPI_27Minput_4lane_10bit_472.5Mbps_3840x2160_20fps.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x32}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x18}, +{0x3306,0x88}, +{0x3308,0x20}, +{0x3309,0x68}, +{0x330b,0x70}, +{0x330d,0x28}, +{0x330e,0x48}, +{0x3314,0x94}, +{0x331f,0x59}, +{0x3332,0x24}, +{0x334c,0x10}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x18}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x33af,0x48}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x53}, +{0x3635,0x02}, +{0x3637,0x52}, +{0x3638,0x0a}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x2a}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x56}, +{0x36ea,0x39}, +{0x36eb,0x0e}, +{0x36ec,0x15}, +{0x36ed,0x14}, +{0x36f9,0x11}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, +}; + +I2C_ARRAY Sensor_init_table_4lane_4K15fps[] = +{ +//0x20_Apollo_MIPI_27Minput_4lane_10bit_421.875Mbps_3840x2160_15fps_(hts=5000,vts=2250).ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x20}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x320c,0x09}, +{0x320d,0xc4}, +{0x320e,0x08}, +{0x320f,0xca}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xc0}, +{0x3309,0x40}, +{0x330b,0xc0}, +{0x330e,0x60}, +{0x3314,0x94}, +{0x331f,0x31}, +{0x334c,0x10}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x09}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x33af,0x24}, +{0x33e0,0xa0}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x22}, +{0x3635,0x02}, +{0x3637,0x29}, +{0x3638,0x08}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x03}, +{0x3995,0xff}, +{0x3996,0x00}, +{0x3997,0x03}, +{0x3998,0x00}, +{0x3999,0x06}, +{0x399a,0x00}, +{0x399b,0x0e}, +{0x399c,0x00}, +{0x399d,0x10}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xee}, +{0x39a6,0x03}, +{0x39a7,0xf4}, +{0x39a8,0x03}, +{0x39a9,0xf6}, +{0x39aa,0x03}, +{0x39ab,0xfd}, +{0x39ac,0x00}, +{0x39ad,0x04}, +{0x39ae,0x00}, +{0x39af,0x06}, +{0x39b0,0x00}, +{0x39b1,0x0e}, +{0x39b2,0x00}, +{0x39b3,0x1c}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x19}, +{0x39e3,0xe9}, +{0x39e4,0x0e}, +{0x39e5,0x14}, +{0x39e6,0x00}, +{0x39e7,0x23}, +{0x39e8,0x03}, +{0x39e9,0xba}, +{0x39ea,0x02}, +{0x39eb,0x6d}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x3f00,0x4a}, +{0x4501,0xb4}, +{0x4509,0x20}, +{0x4837,0x2f}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x52}, +{0x36ea,0xbb}, +{0x36eb,0x14}, +{0x36ec,0x05}, +{0x36ed,0x14}, +{0x36f9,0x52}, +{0x36fa,0xbb}, +{0x36fb,0x14}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, +}; + +I2C_ARRAY Sensor_init_table_4lane_5M30fps[] = +{ +//cleaned_0x10_SC8235_MIPI_4lane_10bit_708.75Mbps_2592x1944_4200x2250_30fps.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x10}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x3200,0x02}, +{0x3201,0x80}, +{0x3202,0x00}, +{0x3203,0x78}, +{0x3204,0x0c}, +{0x3205,0xa7}, +{0x3206,0x08}, +{0x3207,0x17}, +{0x3208,0x0a}, +{0x3209,0x20}, +{0x320a,0x07}, +{0x320b,0x98}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x3210,0x00}, +{0x3211,0x04}, +{0x3212,0x00}, +{0x3213,0x04}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xa8}, +{0x3308,0x20}, +{0x3309,0x68}, +{0x330b,0x48}, +{0x330d,0x28}, +{0x330e,0x58}, +{0x3314,0x94}, +{0x331f,0x59}, +{0x3332,0x24}, +{0x334c,0x10}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x33af,0x48}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x53}, +{0x3635,0x02}, +{0x3637,0x52}, +{0x3638,0x0a}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x1c}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x53}, +{0x36ea,0x39}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x36f9,0x57}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, +}; + +I2C_ARRAY Sensor_init_table_4lane_5MP3_30fps[] = +{ +//new_special_0x02_FT_SC8235_MIPI_27Minput_4lane_10bit_708.75Mbps_3072x1728_30fps.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x36e9,0x80}, +{0x36f9,0x80}, +{0x336c,0xc2}, +{0x3624,0x45}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x5799,0x06}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e0e,0x09}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x1c}, +{0x3366,0x92}, +{0x3314,0x94}, +{0x334c,0x10}, +{0x3e09,0x40}, +{0x3e08,0x03}, +{0x3637,0x52}, +{0x3631,0x80}, +{0x3308,0x20}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x335d,0x60}, +{0x337f,0x33}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x3367,0x08}, +{0x330e,0x58}, +{0x33af,0x48}, +{0x3638,0x0a}, +{0x3306,0xa8}, +{0x3309,0x68}, +{0x331f,0x59}, +{0x330d,0x28}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x3332,0x24}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x3628,0x83}, +{0x3633,0x53}, +{0x3630,0x80}, +{0x3622,0xf7}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x363a,0x88}, +{0x3e26,0x40}, +{0x360f,0x01}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3670,0x4a}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x3699,0x88}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x3364,0x16}, +{0x3301,0x1c}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3981,0x70}, +{0x3984,0x20}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3980,0x71}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39c5,0x30}, +{0x330b,0x48}, +{0x36f9,0x57}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x36e9,0x53}, +{0x36ea,0x39}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x3635,0x02}, +{0x3902,0xc5}, +{0x3038,0x44}, +{0x3632,0x98}, +{0x3e14,0x31}, +{0x3e1b,0x3a}, +{0x3248,0x04}, +{0x3901,0x00}, +{0x3904,0x18}, +{0x3987,0x0b}, +{0x363b,0x06}, +{0x3905,0xd8}, +{0x301f,0x02}, +{0x3200,0x01}, +{0x3201,0x88}, +{0x3202,0x00}, +{0x3203,0xda}, +{0x3204,0x0d}, +{0x3205,0x97}, +{0x3206,0x07}, +{0x3207,0xa9}, +{0x3208,0x0c}, +{0x3209,0x00}, +{0x320a,0x06}, +{0x320b,0xc0}, +{0x3210,0x00}, +{0x3211,0x08}, +{0x3212,0x00}, +{0x3213,0x08}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x0100,0x01}, +}; + + +I2C_ARRAY Sensor_init_table_4lane_4P8M30fps[] = +{ +//cleaned_0x11_SC8235_MIPI_4lane_10bit_708.75Mbps_2944x1656_4200x2250_30fps.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x11}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x3200,0x01}, +{0x3201,0xd0}, +{0x3202,0x01}, +{0x3203,0x08}, +{0x3204,0x0d}, +{0x3205,0x57}, +{0x3206,0x07}, +{0x3207,0x87}, +{0x3208,0x0b}, +{0x3209,0x80}, +{0x320a,0x06}, +{0x320b,0x78}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x3210,0x00}, +{0x3211,0x04}, +{0x3212,0x00}, +{0x3213,0x04}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xa8}, +{0x3308,0x20}, +{0x3309,0x68}, +{0x330b,0x48}, +{0x330d,0x28}, +{0x330e,0x58}, +{0x3314,0x94}, +{0x331f,0x59}, +{0x3332,0x24}, +{0x334c,0x10}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x33af,0x48}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x53}, +{0x3635,0x02}, +{0x3637,0x52}, +{0x3638,0x0a}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x01}, +{0x3e01,0x18}, +{0x3e02,0xa0}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x1c}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x53}, +{0x36ea,0x39}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x36f9,0x57}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, + +}; + + +I2C_ARRAY Sensor_init_table_4lane_3P6M30fps[] = +{ +//cleaned_0x1e_SC8235_MIPI_27Minput_4lane_10bit_583.2Mbps_2560x1440_30fps_2592x1500.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x1e}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x3200,0x02}, +{0x3201,0x88}, +{0x3202,0x02}, +{0x3203,0xd8}, +{0x3204,0x0c}, +{0x3205,0x8f}, +{0x3206,0x08}, +{0x3207,0x7f}, +{0x3208,0x0a}, +{0x3209,0x00}, +{0x320a,0x05}, +{0x320b,0xa0}, +{0x320c,0x0a}, +{0x320d,0x20}, +{0x320e,0x05}, +{0x320f,0xdc}, +{0x3210,0x00}, +{0x3211,0x04}, +{0x3212,0x00}, +{0x3213,0x04}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xc8}, +{0x3309,0x40}, +{0x330b,0xc0}, +{0x330e,0x60}, +{0x3314,0x94}, +{0x331f,0x31}, +{0x334c,0x10}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x09}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x33af,0x24}, +{0x33e0,0xa0}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x22}, +{0x3635,0x02}, +{0x3637,0x29}, +{0x3638,0x08}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x55}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x03}, +{0x3995,0xff}, +{0x3996,0x00}, +{0x3997,0x03}, +{0x3998,0x00}, +{0x3999,0x06}, +{0x399a,0x00}, +{0x399b,0x0e}, +{0x399c,0x00}, +{0x399d,0x10}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xee}, +{0x39a6,0x03}, +{0x39a7,0xf4}, +{0x39a8,0x03}, +{0x39a9,0xf6}, +{0x39aa,0x03}, +{0x39ab,0xfd}, +{0x39ac,0x00}, +{0x39ad,0x04}, +{0x39ae,0x00}, +{0x39af,0x06}, +{0x39b0,0x00}, +{0x39b1,0x0e}, +{0x39b2,0x00}, +{0x39b3,0x1c}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x19}, +{0x39e3,0xe9}, +{0x39e4,0x0e}, +{0x39e5,0x14}, +{0x39e6,0x00}, +{0x39e7,0x23}, +{0x39e8,0x03}, +{0x39e9,0xba}, +{0x39ea,0x02}, +{0x39eb,0x6d}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x00}, +{0x3e01,0xba}, +{0x3e02,0xe0}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x3f00,0x4e}, +{0x3f05,0x70}, +{0x4501,0xb4}, +{0x4509,0x20}, +{0x4837,0x22}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x37}, +{0x36ea,0x7d}, +{0x36eb,0x14}, +{0x36ec,0x05}, +{0x36ed,0x14}, +{0x36f9,0x37}, +{0x36fa,0x7d}, +{0x36fb,0x14}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, + +}; + + +I2C_ARRAY Sensor_init_table_4lane_2M60fps[] = +{ +//cleaned_0x29_SC8235_MIPI_27Minput_4lane_10bit_675Mbps_1920x1080_60fps_hbin_vbin_2000x1125.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x29}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x3203,0x08}, +{0x3207,0x87}, +{0x3208,0x07}, +{0x3209,0x80}, +{0x320a,0x04}, +{0x320b,0x38}, +{0x320c,0x07}, +{0x320d,0xd0}, +{0x320e,0x04}, +{0x320f,0x65}, +{0x3211,0x08}, +{0x3213,0x04}, +{0x3214,0x31}, +{0x3215,0x31}, +{0x3220,0x1c}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xa0}, +{0x3308,0x20}, +{0x3309,0x68}, +{0x330b,0x38}, +{0x330d,0x28}, +{0x330e,0x58}, +{0x3314,0x94}, +{0x331f,0x59}, +{0x3332,0x24}, +{0x334c,0x10}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x335d,0x60}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x07}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x38}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x38}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x33af,0x48}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3620,0x48}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x23}, +{0x3635,0x02}, +{0x3637,0x52}, +{0x3638,0x0a}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x9f}, +{0x369a,0x9f}, +{0x369b,0x9f}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x00}, +{0x3e01,0x8c}, +{0x3e02,0x00}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x450d,0x08}, +{0x4837,0x1c}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x40}, +{0x36ea,0x31}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x36f9,0x44}, +{0x36fa,0x31}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, + +}; + +I2C_ARRAY Sensor_init_table_HDR_DOL_4lane[] = +{ +//cleaned_0x23_SC8235_MIPI_27Minput_4lane_10bit_708.75Mbps_3840x2160_hdr(vc)_15fps_4200x4500.ini +{0x0103,0x01}, +{0x0100,0x00}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x301f,0x23}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x3038,0x44}, +{0x320c,0x08}, +{0x320d,0x34}, +{0x320e,0x11}, +{0x320f,0x94}, +{0x3220,0x50}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3248,0x04}, +{0x3250,0x3f}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x3301,0x1c}, +{0x3306,0xa8}, +{0x3308,0x20}, +{0x3309,0x68}, +{0x330b,0x48}, +{0x330d,0x28}, +{0x330e,0x58}, +{0x3314,0x98}, +{0x331f,0x59}, +{0x3332,0x24}, +{0x334a,0x18}, +{0x334c,0x10}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x335d,0x60}, +{0x3360,0x40}, +{0x3362,0x72}, +{0x3364,0x16}, +{0x3366,0x92}, +{0x3367,0x08}, +{0x3368,0x10}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x336c,0xc2}, +{0x336f,0x58}, +{0x337f,0x33}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x60}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x60}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x33af,0x48}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x360f,0x01}, +{0x3622,0xf7}, +{0x3624,0x45}, +{0x3628,0x83}, +{0x3630,0x80}, +{0x3631,0x80}, +{0x3632,0xa8}, +{0x3633,0x23}, +{0x3635,0x02}, +{0x3636,0x11}, +{0x3637,0x10}, +{0x3638,0x0a}, +{0x363a,0x88}, +{0x363b,0x06}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x3670,0x4a}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x3699,0x88}, +{0x369a,0x88}, +{0x369b,0x88}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x3901,0x00}, +{0x3902,0xc5}, +{0x3904,0x18}, +{0x3905,0xd8}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3980,0x71}, +{0x3981,0x70}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3984,0x20}, +{0x3987,0x0b}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39c5,0x30}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3e00,0x02}, +{0x3e01,0x0f}, +{0x3e02,0xa0}, +{0x3e04,0x20}, +{0x3e05,0xc0}, +{0x3e06,0x00}, +{0x3e07,0x80}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e0e,0x09}, +{0x3e10,0x00}, +{0x3e11,0x80}, +{0x3e12,0x03}, +{0x3e13,0x40}, +{0x3e14,0x31}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e1b,0x3a}, +{0x3e1e,0x76}, +{0x3e23,0x01}, +{0x3e24,0x0e}, +{0x3e25,0x23}, +{0x3e26,0x40}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4816,0x51}, +{0x4837,0x1c}, +{0x5799,0x06}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3641,0x0c}, +{0x36e9,0x53}, +{0x36ea,0x39}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x36f9,0x57}, +{0x36fa,0x39}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x3641,0x00}, +{0x0100,0x01}, +}; + +I2C_ARRAY Sensor_init_table_HDR_DOL_4lane_2M[] = +{ +{0x0103,0x01}, +{0x0100,0x00}, +{0x336c,0xc2}, +{0x3624,0x45}, +{0x33e1,0x08}, +{0x33e2,0x18}, +{0x33e3,0x10}, +{0x33e4,0x0c}, +{0x33e5,0x10}, +{0x33e6,0x06}, +{0x33e7,0x02}, +{0x33e8,0x18}, +{0x33e9,0x10}, +{0x33ea,0x0c}, +{0x33eb,0x10}, +{0x33ec,0x04}, +{0x33ed,0x02}, +{0x33ee,0xa0}, +{0x33ef,0x08}, +{0x33f4,0x18}, +{0x33f5,0x10}, +{0x33f6,0x0c}, +{0x33f7,0x10}, +{0x33f8,0x06}, +{0x33f9,0x02}, +{0x33fa,0x18}, +{0x33fb,0x10}, +{0x33fc,0x0c}, +{0x33fd,0x10}, +{0x33fe,0x04}, +{0x33ff,0x02}, +{0x5799,0x06}, +{0x3e16,0x00}, +{0x3e17,0xac}, +{0x3e18,0x00}, +{0x3e19,0xac}, +{0x3e0e,0x09}, +{0x3e1e,0x76}, +{0x3e25,0x23}, +{0x57aa,0x2f}, +{0x57ab,0xff}, +{0x3018,0x72}, +{0x3019,0x00}, +{0x3031,0x0a}, +{0x3037,0x20}, +{0x4501,0xa4}, +{0x4509,0x10}, +{0x4837,0x1c}, +{0x3366,0x92}, +{0x334c,0x10}, +{0x3631,0x80}, +{0x3308,0x20}, +{0x335d,0x60}, +{0x337f,0x33}, +{0x3369,0x00}, +{0x336a,0x00}, +{0x336b,0x00}, +{0x3367,0x08}, +{0x330e,0x58}, +{0x33af,0x48}, +{0x3638,0x0a}, +{0x3309,0x68}, +{0x331f,0x59}, +{0x330d,0x28}, +{0x339e,0x24}, +{0x33aa,0x24}, +{0x3332,0x24}, +{0x3350,0x24}, +{0x3358,0x24}, +{0x335c,0x24}, +{0x3628,0x83}, +{0x3633,0x23}, +{0x3630,0x80}, +{0x3622,0xf7}, +{0x363d,0x01}, +{0x363e,0x00}, +{0x363a,0x88}, +{0x3e26,0x40}, +{0x360f,0x01}, +{0x367a,0x48}, +{0x367b,0x78}, +{0x3671,0xf7}, +{0x3672,0xf7}, +{0x3673,0x17}, +{0x3670,0x4a}, +{0x367c,0x48}, +{0x367d,0x78}, +{0x3674,0x80}, +{0x3675,0x85}, +{0x3676,0xa5}, +{0x369c,0x48}, +{0x369d,0x78}, +{0x3690,0x53}, +{0x3691,0x63}, +{0x3692,0x54}, +{0x36a2,0x48}, +{0x36a3,0x78}, +{0x3699,0x88}, +{0x36bb,0x48}, +{0x36bc,0x78}, +{0x36c9,0x05}, +{0x36ca,0x05}, +{0x36cb,0x05}, +{0x36d0,0x30}, +{0x36d1,0x48}, +{0x36d2,0x78}, +{0x36cc,0x00}, +{0x36cd,0x10}, +{0x36ce,0x1a}, +{0x3364,0x16}, +{0x3301,0x1c}, +{0x3393,0x1c}, +{0x3394,0x28}, +{0x3395,0x38}, +{0x3390,0x08}, +{0x3391,0x18}, +{0x3392,0x38}, +{0x3399,0x1c}, +{0x339a,0x1c}, +{0x339b,0x28}, +{0x339c,0x38}, +{0x3396,0x08}, +{0x3397,0x18}, +{0x3398,0x38}, +{0x3241,0x00}, +{0x3243,0x03}, +{0x3271,0x1c}, +{0x3273,0x1f}, +{0x394c,0x0f}, +{0x394d,0x20}, +{0x394e,0x08}, +{0x394f,0x90}, +{0x3981,0x70}, +{0x3984,0x20}, +{0x39ec,0x08}, +{0x39ed,0x00}, +{0x3982,0x00}, +{0x3983,0x00}, +{0x3980,0x71}, +{0x39b4,0x0c}, +{0x39b5,0x1c}, +{0x39b6,0x38}, +{0x39b7,0x5b}, +{0x39b8,0x50}, +{0x39b9,0x38}, +{0x39ba,0x20}, +{0x39bb,0x10}, +{0x39bc,0x0c}, +{0x39bd,0x16}, +{0x39be,0x21}, +{0x39bf,0x36}, +{0x39c0,0x3b}, +{0x39c1,0x2a}, +{0x39c2,0x16}, +{0x39c3,0x0c}, +{0x39a2,0x03}, +{0x39a3,0xe3}, +{0x39a4,0x03}, +{0x39a5,0xf2}, +{0x39a6,0x03}, +{0x39a7,0xf6}, +{0x39a8,0x03}, +{0x39a9,0xfa}, +{0x39aa,0x03}, +{0x39ab,0xff}, +{0x39ac,0x00}, +{0x39ad,0x06}, +{0x39ae,0x00}, +{0x39af,0x09}, +{0x39b0,0x00}, +{0x39b1,0x12}, +{0x39b2,0x00}, +{0x39b3,0x22}, +{0x39c6,0x07}, +{0x39c7,0xf8}, +{0x39c9,0x07}, +{0x39ca,0xf8}, +{0x3990,0x03}, +{0x3991,0xfd}, +{0x3992,0x03}, +{0x3993,0xfc}, +{0x3994,0x00}, +{0x3995,0x00}, +{0x3996,0x00}, +{0x3997,0x05}, +{0x3998,0x00}, +{0x3999,0x09}, +{0x399a,0x00}, +{0x399b,0x12}, +{0x399c,0x00}, +{0x399d,0x12}, +{0x399e,0x00}, +{0x399f,0x18}, +{0x39a0,0x00}, +{0x39a1,0x14}, +{0x39cc,0x00}, +{0x39cd,0x1b}, +{0x39ce,0x00}, +{0x39cf,0x00}, +{0x39d0,0x1b}, +{0x39d1,0x00}, +{0x39e2,0x15}, +{0x39e3,0x87}, +{0x39e4,0x12}, +{0x39e5,0xb7}, +{0x39e6,0x00}, +{0x39e7,0x8c}, +{0x39e8,0x01}, +{0x39e9,0x31}, +{0x39ea,0x01}, +{0x39eb,0xd7}, +{0x39c5,0x30}, +{0x3214,0x31}, +{0x3620,0x48}, +{0x3208,0x07}, +{0x3209,0x80}, +{0x3211,0x08}, +{0x450d,0x08}, +{0x3215,0x31}, +{0x320a,0x04}, +{0x320b,0x38}, +{0x3641,0x00}, +{0x3635,0x02}, +{0x3902,0xc5}, +{0x3038,0x44}, +{0x3e14,0x31}, +{0x3e1b,0x3a}, +{0x3248,0x04}, +{0x3901,0x00}, +{0x3904,0x18}, +{0x3987,0x0b}, +{0x363b,0x06}, +{0x3905,0xd8}, +{0x301f,0x29}, +{0x320c,0x07}, +{0x320d,0xd0}, +{0x3641,0x0c}, +{0x36f9,0x44}, +{0x36fa,0x31}, +{0x36fb,0x13}, +{0x36fc,0x10}, +{0x36fd,0x14}, +{0x36e9,0x40}, +{0x36ea,0x31}, +{0x36eb,0x06}, +{0x36ec,0x05}, +{0x36ed,0x24}, +{0x3641,0x00}, +{0x3306,0xa0}, +{0x330b,0x38}, +{0x3203,0x08}, +{0x3207,0x87}, +{0x3213,0x04}, +{0x3802,0x01}, +{0x3220,0x5c}, +{0x336f,0x58}, +{0x4816,0x51}, +{0x3250,0x3f}, +{0x320e,0x08}, +{0x320f,0xca}, +{0x3e23,0x00}, +{0x3e24,0x8c}, +{0x3314,0x98}, +{0x334a,0x18}, +{0x3636,0x11}, +{0x3637,0x10}, +{0x3e00,0x01}, +{0x3e01,0x06}, +{0x3e02,0xc0}, +{0x3e04,0x10}, +{0x3e05,0x60}, +{0x3e06,0x00}, +{0x3e07,0x80}, +{0x3e08,0x03}, +{0x3e09,0x40}, +{0x3e10,0x00}, +{0x3e11,0x80}, +{0x3e12,0x03}, +{0x3e13,0x40}, +{0x3362,0x72}, +{0x3360,0x40}, +{0x3368,0x0e}, +{0x369a,0x88}, +{0x369b,0x88}, +{0x3632,0xa8},//2020/06/11 +{0x0100,0x01}, +}; + + +I2C_ARRAY TriggerStartTbl[] = { +//{0x30f4,0x00},//Master mode start +}; + +I2C_ARRAY PatternTbl[] = { + //pattern mode +}; + +I2C_ARRAY mirror_reg[] = +{ + {0x3221, 0x00}, // mirror[2:1], flip[6:5] +}; + +I2C_ARRAY mirror_reg_HDR[] = +{ + {0x3221, 0x00}, // mirror[2:1], flip[6:5] + {0x3812, 0x00}, + {0x4505, 0x80}, + {0x3812, 0x30}, +}; + +typedef struct { + short reg; + char startbit; + char stopbit; +} COLLECT_REG_SET; + +static I2C_ARRAY gain_reg[] = { + {0x3e06, 0x00}, + {0x3e07, 0x00}, + {0x3e08, 0x00|0x03}, + {0x3e09, 0x40}, //low bit, 0x40 - 0x7f, step 1/64 + +}; +static I2C_ARRAY gain_reg_HDR_DOL_SEF[] = { + {0x3e10, 0x00}, + {0x3e11, 0x00}, + {0x3e12, 0x00|0x03}, + {0x3e13, 0x10}, //low bit, 0x40 - 0x7f, step 1/64 + }; + +I2C_ARRAY expo_reg[] = { + {0x3e00, 0x00}, //expo [3:0] + {0x3e01, 0x30}, // expo[7:0] + {0x3e02, 0x00}, // expo[7:4] +}; +I2C_ARRAY expo_reg_HDR_DOL_SEF[] = { + {0x3e04, 0x21}, // expo[7:0] + {0x3e05, 0x00}, // expo[7:4] +}; + +I2C_ARRAY vts_reg[] = { + {0x320e, 0x08}, + {0x320f, 0xca} +}; +I2C_ARRAY max_short_exp_reg[] = { + {0x3e23, 0x01}, + {0x3e24, 0x0e} +}; + +#if 0 +CUS_INT_TASK_ORDER def_order = { + .RunLength = 9, + .Orders = { + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AE|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_AWB|CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + CUS_INT_TASK_VDOS|CUS_INT_TASK_AF, + }, +}; +#endif + +/////////// function definition /////////////////// +#if SENSOR_DBG == 1 +//#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +//#define SENSOR_DMSG(args...) LOGE(args) +#define SENSOR_DMSG(args...) SENSOR_DMSG(args) +#elif SENSOR_DBG == 0 +//#define SENSOR_DMSG(args...) +#endif +#undef SENSOR_NAME +#define SENSOR_NAME sc8238 + +#define SensorReg_Read(_reg,_data) (handle->i2c_bus->i2c_rx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorReg_Write(_reg,_data) (handle->i2c_bus->i2c_tx(handle->i2c_bus, &(handle->i2c_cfg),_reg,_data)) +#define SensorRegArrayW(_reg,_len) (handle->i2c_bus->i2c_array_tx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) +#define SensorRegArrayR(_reg,_len) (handle->i2c_bus->i2c_array_rx(handle->i2c_bus, &(handle->i2c_cfg),(_reg),(_len))) + +/////////////////// sensor hardware dependent ////////////// +#if 0 +static int ISP_config_io(ms_cus_sensor *handle) { + ISensorIfAPI *sensor_if = handle->sensor_if_api; + + SENSOR_DMSG("[%s]", __FUNCTION__); + + sensor_if->HsyncPol(handle, handle->HSYNC_POLARITY); + sensor_if->VsyncPol(handle, handle->VSYNC_POLARITY); + sensor_if->ClkPol(handle, handle->PCLK_POLARITY); + sensor_if->BayerFmt(handle, handle->bayer_id); + sensor_if->DataBus(handle, handle->sif_bus); + + sensor_if->DataPrecision(handle, handle->data_prec); + sensor_if->FmtConv(handle, handle->data_mode); + return SUCCESS; +} +#endif +static int pCus_poweron(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + //Sensor power on sequence + sensor_if->MCLK(idx, 1, handle->mclk); + + sensor_if->SetIOPad(idx, handle->sif_bus, handle->interface_attr.attr_mipi.mipi_lane_num); +/* sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_DCG) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 2); + } */ + + SENSOR_DMSG("[%s] reset low\n", __FUNCTION__); + sensor_if->Reset(idx, handle->reset_POLARITY); + SENSOR_USLEEP(1000); + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + + // power -> high, reset -> high + SENSOR_DMSG("[%s] power high\n", __FUNCTION__); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_USLEEP(1000); + SENSOR_DMSG("[%s] reset high\n", __FUNCTION__); + sensor_if->Reset(idx, !handle->reset_POLARITY); + SENSOR_USLEEP(1000); + + //sensor_if->Set3ATaskOrder(handle, def_order); + // pure power on + //ISP_config_io(handle); + sensor_if->PowerOff(idx, !handle->pwdn_POLARITY); + SENSOR_USLEEP(5000); + //handle->i2c_bus->i2c_open(handle->i2c_bus,&handle->i2c_cfg); + + return SUCCESS; +} + +static int pCus_post_init(ms_cus_sensor *handle, u32 idx) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + SENSOR_DMSG("[%s] ", __FUNCTION__); + + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_216M); + sensor_if->SetCSI_Lane(idx, handle->interface_attr.attr_mipi.mipi_lane_num, 1); + sensor_if->SetCSI_LongPacketType(idx, 0, 0x1C00, 0); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_DCG) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 2); + } + return SUCCESS; +} + +static int pCus_poweroff(ms_cus_sensor *handle, u32 idx) +{ + // power/reset low + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sc8238_params *params = (sc8238_params *)handle->private_data; + SENSOR_DMSG("[%s] power low\n", __FUNCTION__); + sensor_if->PowerOff(idx, handle->pwdn_POLARITY); + //handle->i2c_bus->i2c_close(handle->i2c_bus); + SENSOR_USLEEP(1000); + //Set_csi_if(0, 0); + sensor_if->SetCSI_Clk(idx, CUS_CSI_CLK_DISABLE); + if (handle->interface_attr.attr_mipi.mipi_hdr_mode == CUS_HDR_MODE_DCG) { + sensor_if->SetCSI_hdr_mode(idx, handle->interface_attr.attr_mipi.mipi_hdr_mode, 0); + } + sensor_if->MCLK(idx, 0, handle->mclk); + + params->cur_orien = CUS_ORIT_M0F0; + + SENSOR_USLEEP(2000);//mantis:1690203 + return SUCCESS; +} + +/////////////////// image function ///////////////////////// +//Get and check sensor ID +//if i2c error or sensor id does not match then return FAIL +static int pCus_GetSensorID(ms_cus_sensor *handle, u32 *id) +{ + int i,n; + int table_length= ARRAY_SIZE(Sensor_id_table); + I2C_ARRAY id_from_sensor[ARRAY_SIZE(Sensor_id_table)]; + + SensorReg_Write(0xef,0x00); + + for(n=0;n8) table_length=8; + + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + + for(n=0;n<4;++n) //retry , until I2C success + { + if(n>2) return FAIL; + + if( SensorRegArrayR((I2C_ARRAY*)id_from_sensor,table_length) == SUCCESS) //read sensor ID from I2C + break; + else + continue; + } + + //convert sensor id to u32 format + for(i=0;i>= 8; + SENSOR_DMSG("[%s]sc8238 Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + //SENSOR_DMSG("[%s]Read sensor id, get 0x%x Success\n", __FUNCTION__, (int)*id); + + return SUCCESS; +} + +static int sc8238_SetPatternMode(ms_cus_sensor *handle,u32 mode) +{ + + SENSOR_DMSG("\n\n[%s], mode=%d \n", __FUNCTION__, mode); + + return SUCCESS; +} +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps); +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain); +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status); + +static int pCus_init_mipi4lane_linear_4K30fps(ms_cus_sensor *handle) +{ + short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K30fps);i++) + { + if(Sensor_init_table_4lane_4K30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K30fps[i].reg, Sensor_init_table_4lane_4K30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + pr_info("[%s] vts_reg_sef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_4K20fps(ms_cus_sensor *handle) +{ + short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K20fps);i++) + { + if(Sensor_init_table_4lane_4K20fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K20fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K20fps[i].reg, Sensor_init_table_4lane_4K20fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } + + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } + //BL control + //SensorReg_Write(0x3907,0x01); + //SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + pr_info("[%s] vts_reg_sef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_4K15fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4K15fps);i++) + { + if(Sensor_init_table_4lane_4K15fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4K15fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4K15fps[i].reg, Sensor_init_table_4lane_4K15fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_5M30fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5M30fps);i++) + { + if(Sensor_init_table_4lane_5M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5M30fps[i].reg, Sensor_init_table_4lane_5M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +//////// +static int pCus_init_mipi4lane_linear_5MP3_30fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_5MP3_30fps);i++) + { + if(Sensor_init_table_4lane_5MP3_30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_5MP3_30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_5MP3_30fps[i].reg, Sensor_init_table_4lane_5MP3_30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + + + + +static int pCus_init_mipi4lane_linear_4P8M30fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_4P8M30fps);i++) + { + if(Sensor_init_table_4lane_4P8M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_4P8M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_4P8M30fps[i].reg, Sensor_init_table_4lane_4P8M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + +static int pCus_init_mipi4lane_linear_3P6M30fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_3P6M30fps);i++) + { + if(Sensor_init_table_4lane_3P6M30fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_3P6M30fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_3P6M30fps[i].reg, Sensor_init_table_4lane_3P6M30fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} +static int pCus_init_mipi4lane_linear_2M60fps(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + //SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + int i,cnt; + //ISensorIfAPI *sensor_if = &(handle->sensor_if_api); + //sensor_if->PCLK(NULL,CUS_PCLK_MIPI_TOP); + + for(i=0;i< ARRAY_SIZE(Sensor_init_table_4lane_2M60fps);i++) + { + if(Sensor_init_table_4lane_2M60fps[i].reg==0xffff) + { + SENSOR_MSLEEP(Sensor_init_table_4lane_2M60fps[i].data); + } + else + { + cnt = 0; + while(SensorReg_Write(Sensor_init_table_4lane_2M60fps[i].reg, Sensor_init_table_4lane_2M60fps[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table -> Retry %d...\n",cnt); + if(cnt>=10) + { + SENSOR_DMSG("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + SENSOR_MSLEEP(10); + } + } + } +#if 0 + SensorReg_Read(0x3040,&ver); + if(ver == 0){ + SensorReg_Write(0x36c9,0x01); + SensorReg_Write(0x36ca,0x00); + SensorReg_Write(0x36cb,0x00); + }else if(ver == 1){ + SensorReg_Write(0x36c9,0x05); + SensorReg_Write(0x36ca,0x05); + SensorReg_Write(0x36cb,0x05); + } +#endif + //BL control + // SensorReg_Write(0x3907,0x01); + // SensorReg_Write(0x3908,0x11); + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + // usleep(50*1000); + //pCus_SetAEGain(handle,1024); + //pCus_SetAEUSecs(handle, 40000); + //pCus_AEStatusNotify(handle,CUS_FRAME_ACTIVE); + return SUCCESS; +} + + +static int pCus_init_mipi4lane_HDR_DOL(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + int i,cnt=0; + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane);i++) + { + if(Sensor_init_table_HDR_DOL_4lane[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane[i].data); + } + else + { + cnt = 0; + SENSOR_DMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane[i].reg, Sensor_init_table_HDR_DOL_4lane[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane[i].reg,Sensor_init_table_HDR_DOL_4lane[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + //SensorReg_Read( Sensor_init_table_HDR_DOL_4lane[i].reg, &sen_data ); + //UartSendTrace("sc8238 reg: 0x%x, data: 0x%x, read: 0x%x.\n",Sensor_init_table_HDR_DOL_4lane[i].reg, Sensor_init_table_HDR_DOL_4lane[i].data, sen_data); + } + } + + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien_HDR(handle, params->cur_orien); + // pr_info("cur_orien %s pCus_SetOrien %x\n",__FUNCTION__, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + + return SUCCESS; +} + +static int pCus_init_mipi4lane_HDR_DOL_2M(ms_cus_sensor *handle) +{ + // short ver=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + int i,cnt=0; + for(i=0;i< ARRAY_SIZE(Sensor_init_table_HDR_DOL_4lane_2M);i++) + { + if(Sensor_init_table_HDR_DOL_4lane_2M[i].reg==0xffff) + { + //MsSleep(RTK_MS_TO_TICK(1));//usleep(1000*Sensor_init_table_HDR_DOL_4lane_2M[i].data); + SENSOR_MSLEEP(Sensor_init_table_HDR_DOL_4lane_2M[i].data); + } + else + { + cnt = 0; + SENSOR_DMSG("reg = %x, data = %x\n", Sensor_init_table_HDR_DOL_4lane_2M[i].reg, Sensor_init_table_HDR_DOL_4lane_2M[i].data); + while(SensorReg_Write(Sensor_init_table_HDR_DOL_4lane_2M[i].reg,Sensor_init_table_HDR_DOL_4lane_2M[i].data) != SUCCESS) + { + cnt++; + SENSOR_DMSG("Sensor_init_table_HDR_DOL_4lane_2M -> Retry %d...\n",cnt); + if(cnt>=10) + { + //printf("[%s:%d]Sensor init fail!!\n", __FUNCTION__, __LINE__); + return FAIL; + } + //usleep(10*1000); + } + } + } + //DPC patch + SensorReg_Write(0x5780,0x57); + SensorReg_Write(0x5785,0x00); + SensorReg_Write(0x5786,0x00); + SensorReg_Write(0x5799,0x07); //20190710 + + pCus_SetOrien_HDR(handle, params->cur_orien); + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + + return SUCCESS; +} + + +/* +int pCus_release(ms_cus_sensor *handle) +{ + ISensorIfAPI *sensor_if = handle->sensor_if_api; + sensor_if->PCLK(NULL,CUS_PCLK_OFF); + return SUCCESS; +} +*/ + +static int pCus_GetVideoResNum( ms_cus_sensor *handle, u32 *ulres_num) +{ + *ulres_num = handle->video_res_supported.num_res; + return SUCCESS; +} + +static int pCus_GetVideoRes(ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + if (res_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[res_idx]; + + return SUCCESS; +} + +static int pCus_GetCurVideoRes(ms_cus_sensor *handle, u32 *cur_idx, cus_camsensor_res **res) +{ + u32 num_res = handle->video_res_supported.num_res; + + *cur_idx = handle->video_res_supported.ulcur_res; + + if (*cur_idx >= num_res) { + return FAIL; + } + + *res = &handle->video_res_supported.res[*cur_idx]; + + return SUCCESS; +} + +static int pCus_SetVideoRes(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + sc8238_params *params = (sc8238_params *)handle->private_data; + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + + case 0: //"3840x2160@15fps" + handle->video_res_supported.ulcur_res = 0; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K15fps; + vts_30fps=2250; + params->expo.vts = vts_30fps; + params->expo.fps = 15; + Preview_line_period = 29630; + break; + case 1: //"3840x2160@20fps" + handle->video_res_supported.ulcur_res = 1; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K20fps; + vts_30fps=2250;//3375 + params->expo.vts = vts_30fps; + params->expo.fps = 20; + Preview_line_period = 22222;///14815 + break; + case 2: //"3072x1728@30fps" + handle->video_res_supported.ulcur_res = 2; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_5MP3_30fps; + vts_30fps=2250;//3375 + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815;///14815 + break; + case 3: //"2592x1944@30fps" + handle->video_res_supported.ulcur_res = 3; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_5M30fps; + vts_30fps=2250;//3375 + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815;///14815 + break; + case 4: //"2944x1656@30fps" + handle->video_res_supported.ulcur_res = 4; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4P8M30fps; + vts_30fps=2250;//3375 + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815;///14815 + break; + case 5: //"2560x1440@30fps" + handle->video_res_supported.ulcur_res = 5; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_3P6M30fps; + vts_30fps=1500; + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 22222; + break; + case 6: //"1920x1080@60fps" + handle->video_res_supported.ulcur_res = 6; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_2M60fps; + vts_30fps=1125; + params->expo.vts = vts_30fps; + params->expo.fps = 60; + Preview_line_period = 14815; + break; + case 7: //"3840x2160@30fps" + handle->video_res_supported.ulcur_res = 7; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K30fps; + vts_30fps=2250;//3375 + params->expo.vts = vts_30fps; + params->expo.fps = 30; + Preview_line_period = 14815;///14815 + break; + default: + break; + } + + return SUCCESS; +} +static int pCus_SetVideoRes_HDR_DOL(ms_cus_sensor *handle, u32 res_idx) +{ + u32 num_res = handle->video_res_supported.num_res; + sc8238_params *params = (sc8238_params *)handle->private_data; + + if (res_idx >= num_res) { + return FAIL; + } + switch (res_idx) { + case 0: + handle->video_res_supported.ulcur_res = 0; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + } + vts_30fps_HDR_DOL = 4500;//3375 + Preview_line_period_HDR_DOL = 14815;///14815 + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + params->expo.max_short_exp=260; + break; + case 1: + handle->video_res_supported.ulcur_res = 1; + if (handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num == 1) { + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL_2M; + } + vts_30fps_HDR_DOL = 2250;//3375 + Preview_line_period_HDR_DOL = 14815;///14815 + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + params->expo.max_short_exp=130; + break; + default: + break; + } + + return SUCCESS; +} + +static int pCus_GetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) { + char sen_data; + sen_data = mirror_reg[0].data; + SENSOR_DMSG("mirror:%x\r\n", sen_data); + switch(sen_data) { + case 0x00: + *orit = CUS_ORIT_M0F0; + break; + case 0x06: + *orit = CUS_ORIT_M1F0; + break; + case 0x60: + *orit = CUS_ORIT_M0F1; + break; + case 0x66: + *orit = CUS_ORIT_M1F1; + break; + } + return SUCCESS; +} + +static int pCus_SetOrien(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + switch(orit) + { + case CUS_ORIT_M0F0: + mirror_reg[0].data = 0x00; + params->cur_orien = CUS_ORIT_M0F0; + params->reg_mf = true; + break; + case CUS_ORIT_M1F0: + mirror_reg[0].data = 0x06; + params->cur_orien = CUS_ORIT_M1F0; + params->reg_mf = true; + break; + case CUS_ORIT_M0F1: + mirror_reg[0].data = 0x60; + params->cur_orien = CUS_ORIT_M0F1; + params->reg_mf = true; + break; + case CUS_ORIT_M1F1: + mirror_reg[0].data = 0x66; + params->cur_orien = CUS_ORIT_M1F1; + params->reg_mf = true; + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_SetOrien_HDR(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + SENSOR_DMSG("\n\n[%s]", __FUNCTION__); + switch(orit) + { + case CUS_ORIT_M0F0: + mirror_reg_HDR[0].data = 0x00; + mirror_reg_HDR[2].data = 0x80; + params->cur_orien = CUS_ORIT_M0F0; + params->reg_mf = true; + break; + case CUS_ORIT_M1F0: + mirror_reg_HDR[0].data = 0x06; + mirror_reg_HDR[2].data = 0x83; + params->cur_orien = CUS_ORIT_M1F0; + params->reg_mf = true; + break; + case CUS_ORIT_M0F1: + mirror_reg_HDR[0].data = 0x60; + mirror_reg_HDR[2].data = 0x80; + params->cur_orien = CUS_ORIT_M0F1; + params->reg_mf = true; + break; + case CUS_ORIT_M1F1: + mirror_reg_HDR[0].data = 0x66; + mirror_reg_HDR[2].data = 0x83; + params->cur_orien = CUS_ORIT_M1F1; + params->reg_mf = true; + break; + default : + break; + } + return SUCCESS; +} + +static int pCus_GetFPS(ms_cus_sensor *handle) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (vts_reg[0].data << 8) | (vts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS(ms_cus_sensor *handle, u32 fps) +{ + u32 vts=0; + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + pr_info("[%s] max_min_fps : %d ,%d\n\n", __FUNCTION__,max_fps,min_fps); + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*max_fps)/fps; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= (vts_30fps*(max_fps*1000))/fps; + }else{ + SENSOR_DMSG("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + + if(params->expo.line > 2* (params->expo.vts) -10){ + vts = (params->expo.line + 11)/2; + }else{ + vts = params->expo.vts; + } + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + params->reg_dirty = true; + return SUCCESS; + +} + +static int pCus_GetFPS_HDR_DOL_SEF(ms_cus_sensor *handle) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (vts_reg[0].data << 8) | (vts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_SetFPS_HDR_DOL_SEF(ms_cus_sensor *handle, u32 fps) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; + //pr_info("[%s] max_min_fps : %d ,%d\n\n", __FUNCTION__,max_fps,min_fps); + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= ((vts_30fps_HDR_DOL*max_fps)/fps >> 1) << 1; + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + params->reg_dirty = true; + pr_info("[%s] vts_reg_sef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + return SUCCESS; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= ((vts_30fps_HDR_DOL*(max_fps*1000))/fps >> 1) << 1; + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + params->reg_dirty = true; + pr_info("[%s] vts_reg_sef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + return SUCCESS; + }else{ + pr_info("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + +} +static int pCus_SetFPS_hdr_dol_lef(ms_cus_sensor *handle, u32 fps) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 min_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].min_fps; +// pr_info("[%s] max_min_fps : %d ,%d\n\n", __FUNCTION__,max_fps,min_fps); + + if(fps>=min_fps && fps <= max_fps){ + params->expo.fps = fps; + params->expo.vts= ((vts_30fps_HDR_DOL*max_fps)/fps >> 1) << 1; + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + params->reg_dirty = true; + pr_info("[%s] vts_reg_lef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + return SUCCESS; + }else if((fps >= (min_fps*1000)) && (fps <= (max_fps*1000))){ + params->expo.fps = fps; + params->expo.vts= ((vts_30fps_HDR_DOL*(max_fps*1000))/fps >> 1) << 1; + vts_reg[0].data = (params->expo.vts >> 8) & 0x00ff; + vts_reg[1].data = (params->expo.vts >> 0) & 0x00ff; + params->reg_dirty = true; + pr_info("[%s] vts_reg_lef : %x , %x\n\n", __FUNCTION__,vts_reg[0].data,vts_reg[1].data); + return SUCCESS; + }else{ + pr_info("[%s] FPS %d out of range.\n",__FUNCTION__,fps); + return FAIL; + } + +} + + +#if 0 +static int pCus_GetSensorCap(ms_cus_sensor *handle, CUS_CAMSENSOR_CAP *cap) { + if (cap) + memcpy(cap, &sensor_cap, sizeof(CUS_CAMSENSOR_CAP)); + else return FAIL; + return SUCCESS; +} +#endif + +/////////////////////////////////////////////////////////////////////// +// auto exposure +/////////////////////////////////////////////////////////////////////// +// unit: micro seconds +//AE status notification +static int pCus_AEStatusNotify(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status){ + + sc8238_params *params = (sc8238_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + if(params->reg_mf) + { + SensorRegArrayW((I2C_ARRAY*)mirror_reg, ARRAY_SIZE(mirror_reg)); + params->reg_mf = false; + } + if(params->reg_dirty) + { + SensorRegArrayW((I2C_ARRAY*)expo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)gain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)vts_reg, ARRAY_SIZE(vts_reg)); + params->reg_dirty = false; + } + break; + default : + break; + } + return SUCCESS; +} +static int pCus_AEStatusNotifyHDR_DOL_LEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + //sc8238_params *params = (sc8238_params *)handle->private_data; + + switch(status) + { + case CUS_FRAME_INACTIVE: + break; + case CUS_FRAME_ACTIVE: + break; + default : + break; + } + return SUCCESS; + +} + +static int pCus_AEStatusNotifyHDR_DOL_SEF(ms_cus_sensor *handle, CUS_CAMSENSOR_AE_STATUS_NOTIFY status) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + switch(status) + { + case CUS_FRAME_INACTIVE: + //SensorReg_Write(0x3001,0); + + break; + case CUS_FRAME_ACTIVE: + if(params->reg_mf) + { + SensorRegArrayW((I2C_ARRAY*)mirror_reg_HDR, ARRAY_SIZE(mirror_reg_HDR)); + params->reg_mf = false; + } + if(params->reg_dirty) + { + SensorRegArrayW((I2C_ARRAY*)expo_reg, ARRAY_SIZE(expo_reg)); + SensorRegArrayW((I2C_ARRAY*)gain_reg, ARRAY_SIZE(gain_reg)); + SensorRegArrayW((I2C_ARRAY*)expo_reg_HDR_DOL_SEF, ARRAY_SIZE(expo_reg_HDR_DOL_SEF)); + SensorRegArrayW((I2C_ARRAY*)gain_reg_HDR_DOL_SEF, ARRAY_SIZE(gain_reg_HDR_DOL_SEF)); + SensorRegArrayW((I2C_ARRAY*)vts_reg, ARRAY_SIZE(vts_reg)); + params->reg_dirty = false; + } + break; + default : + break; + } + return SUCCESS; +} +static int pCus_SetAEUSecsHDR_DOL_LEF(ms_cus_sensor *handle, u32 us) +{ + int i; + u32 half_lines = 0,dou_lines = 0,vts = 0; + sc8238_params *params = (sc8238_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { // max expo line vts-4! + {0x3e00, 0x00},//expo [20:17] + {0x3e01, 0x00}, // expo[16:8] + {0x3e02, 0x10}, // expo[7:0], [3:0] fraction of line + }; + memcpy(expo_reg_temp, expo_reg, sizeof(expo_reg)); + dou_lines = (1000*us)/(Preview_line_period_HDR_DOL*2); // Preview_line_period in ns + half_lines = 4*dou_lines; + if(half_lines<8) half_lines=8; + if (half_lines > 2 * (params->expo.vts-params->expo.max_short_exp-10)) { + half_lines = 2 * (params->expo.vts-params->expo.max_short_exp-10); + } + else + vts=params->expo.vts; +// SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; + + expo_reg[0].data = (half_lines>>16) & 0x0f; + expo_reg[1].data = (half_lines>>8) & 0xff; + expo_reg[2].data = (half_lines>>0) & 0xf0; + // pr_info("[%s] expo_reg : %x ,%x , %x\n\n", __FUNCTION__,expo_reg[0].data,expo_reg[1].data,expo_reg[2].data); + for (i = 0; i < ARRAY_SIZE(expo_reg); i++) + { + if (expo_reg[i].data != expo_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; + +} + +static int pCus_SetAEUSecsHDR_DOL_SEF(ms_cus_sensor *handle, u32 us) +{ + int i; + u32 half_lines = 0,dou_lines = 0,vts = 0; + sc8238_params *params = (sc8238_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { + {0x3e04, 0x21}, // expo[7:0] + {0x3e05, 0x00}, // expo[7:4] + }; + memcpy(expo_reg_temp, expo_reg_HDR_DOL_SEF, sizeof(expo_reg_HDR_DOL_SEF)); + + dou_lines = (1000*us)/(Preview_line_period_HDR_DOL*2); // Preview_line_period in ns + half_lines = 4*dou_lines; + if(half_lines<8) half_lines=8; + if (half_lines > 2 * (params->expo.max_short_exp-8)) { + half_lines = 2 * (params->expo.max_short_exp-8); + } + else + vts=params->expo.vts; +// SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; + + expo_reg_HDR_DOL_SEF[0].data = (half_lines>>8) & 0xff; + expo_reg_HDR_DOL_SEF[1].data = (half_lines>>0) & 0xf0; + // pr_info("[%s] expo_reg_HDR_DOL_SEF : %x , %x\n\n", __FUNCTION__,expo_reg_HDR_DOL_SEF[0].data,expo_reg_HDR_DOL_SEF[1].data); + for (i = 0; i < ARRAY_SIZE(expo_reg_HDR_DOL_SEF); i++) + { + if (expo_reg_HDR_DOL_SEF[i].data != expo_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; + +} + +static int pCus_GetAEUSecs(ms_cus_sensor *handle, u32 *us) { + + u32 lines = 0; + lines |= (u32)(expo_reg[0].data&0x0f)<<16; + lines |= (u32)(expo_reg[1].data&0xff)<<8; + lines |= (u32)(expo_reg[2].data&0xf0)<<0; + lines >>= 4; + *us = (lines*Preview_line_period)/1000/2; //return us + + SENSOR_DMSG("[%s] sensor expo lines/us %d, %dus\n", __FUNCTION__, lines, *us); + return SUCCESS; +} + +static int pCus_SetAEUSecs(ms_cus_sensor *handle, u32 us) { + int i; + u32 half_lines = 0,vts = 0; + sc8238_params *params = (sc8238_params *)handle->private_data; + I2C_ARRAY expo_reg_temp[] = { // max expo line vts-4! + {0x3e00, 0x00},//expo [20:17] + {0x3e01, 0x00}, // expo[16:8] + {0x3e02, 0x10}, // expo[7:0], [3:0] fraction of line + }; + memcpy(expo_reg_temp, expo_reg, sizeof(expo_reg)); + + half_lines = (1000*us*2)/Preview_line_period; // Preview_line_period in ns + if(half_lines<3) half_lines=3; + if (half_lines > 2 * (params->expo.vts)-10) { + vts = (half_lines+11)/2; + } + else + vts=params->expo.vts; + + params->expo.line = half_lines; + SENSOR_DMSG("[%s] us %ld, half_lines %ld, vts %ld\n", __FUNCTION__, us, half_lines, params->expo.vts); + + half_lines = half_lines<<4; + + expo_reg[0].data = (half_lines>>16) & 0x0f; + expo_reg[1].data = (half_lines>>8) & 0xff; + expo_reg[2].data = (half_lines>>0) & 0xf0; + vts_reg[0].data = (vts >> 8) & 0x00ff; + vts_reg[1].data = (vts >> 0) & 0x00ff; + + for (i = 0; i < ARRAY_SIZE(expo_reg); i++) + { + if (expo_reg[i].data != expo_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +// Gain: 1x = 1024 +static int pCus_GetAEGain(ms_cus_sensor *handle, u32* gain) { + int rc = 0; + u8 Dgain = 1, Coarse_gain = 1; + + Coarse_gain = ((gain_reg[2].data&0x1C)>>2) +1; + Dgain = ((gain_reg[0].data&0x0f) + 1); + + *gain = (Coarse_gain*Dgain*(gain_reg[1].data)*(gain_reg[3].data))/2; + + return rc; +} +static int pCus_GetAEGainHDR_DOL_SEF(ms_cus_sensor *handle, u32* gain) { + int rc = 0; + u8 Dgain = 1, Coarse_gain = 1; + + Coarse_gain = ((gain_reg_HDR_DOL_SEF[2].data&0x1C)>>2) +1; + Dgain = ((gain_reg_HDR_DOL_SEF[0].data&0x0f) + 1); + + *gain = (Coarse_gain*Dgain*(gain_reg_HDR_DOL_SEF[1].data)*(gain_reg_HDR_DOL_SEF[3].data))/2; + + + return rc; +} + +static int pCus_SetAEGain_cal(ms_cus_sensor *handle, u32 gain) { + + return SUCCESS; +} + +static int pCus_SetAEGain(ms_cus_sensor *handle, u32 gain) { + sc8238_params *params = (sc8238_params *)handle->private_data; + u8 i=0 ,Dgain = 1, Ana_gain = 1; + u64 Fine_againx64 = 64,Fine_dgainx128 = 128; + u8 Dgain_reg = 0, Ana_gain_reg = 0, Fine_again_reg= 0x40,Fine_dgain_reg= 0x80; + + I2C_ARRAY gain_reg_temp[] = { + {0x3e06, 0x00}, + {0x3e07, 0x80}, + {0x3e08, (0x00|0x03)}, + {0x3e09, 0x40}, + }; + memcpy(gain_reg_temp, gain_reg, sizeof(gain_reg)); + + if (gain < 1024) { + gain = 1024; + } else if (gain > SENSOR_MAXGAIN*1024) { + gain = SENSOR_MAXGAIN*1024; + } + + if (gain < 2 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 1; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x03; + } + else if (gain < 4 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 2; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x07; + } + else if (gain < 8 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 4; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x0f; + } + else if (gain <= 16256) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 8; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x1f; + } + else if (gain < 32512) + { + Dgain = 1; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x00; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 65024) + { + Dgain = 2; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x01; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 127 * 1024) + { + Dgain = 4; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x03; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 254 * 1024) + { + Dgain = 8; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x07; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain <= SENSOR_MAXGAIN * 1024) + { + Dgain = 16; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x0f; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + + if (gain <= 16256) + { + Fine_againx64 = abs(8 * gain/ (Dgain * Ana_gain * Fine_dgainx128)); + //Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_again_reg = Fine_againx64; + //Fine_dgain_reg = Fine_dgainx128; + } + else + { + Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_dgain_reg = Fine_dgainx128; + } + // pr_info("[%s] gain : %d,%lld,%lld,%d, %d\n\n", __FUNCTION__,gain,Fine_again,Fine_dgainx128,Dgain,Ana_gain); + // pr_info("[%s] gain_reg : %x ,%x ,%x , %x\n\n", __FUNCTION__,Fine_again_reg,Ana_gain_reg,Fine_dgain_reg,Dgain_reg); + + gain_reg[3].data = Fine_again_reg; + gain_reg[2].data = Ana_gain_reg; + gain_reg[1].data = Fine_dgain_reg; + gain_reg[0].data = Dgain_reg & 0xF; + //pr_info("[%s] gain_reg : %x ,%x ,%x , %x\n\n", __FUNCTION__,gain_reg[3].data,gain_reg[2].data,gain_reg[1].data,gain_reg[0].data); + + for (i = 0; i < ARRAY_SIZE(gain_reg); i++) + { + if (gain_reg[i].data != gain_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + +static int pCus_SetAEGainHDR_DOL_SEF(ms_cus_sensor *handle, u32 gain) { + sc8238_params *params = (sc8238_params *)handle->private_data; + u8 i=0 ,Dgain = 1, Ana_gain = 1; + u64 Fine_againx64 = 64,Fine_dgainx128 = 128; + u8 Dgain_reg = 0, Ana_gain_reg = 0, Fine_again_reg= 0x10,Fine_dgain_reg= 0x80; + + I2C_ARRAY gain_reg_temp[] = { + {0x3e10, 0x00}, + {0x3e11, 0x80}, + {0x3e12, (0x00|0x03)}, + {0x3e13, 0x40}, + }; + memcpy(gain_reg_temp, gain_reg_HDR_DOL_SEF, sizeof(gain_reg_HDR_DOL_SEF)); + + if (gain < 1024) { + gain = 1024; + } else if (gain > SENSOR_MAXGAIN*1024) { + gain = SENSOR_MAXGAIN*1024; + } + + if (gain < 2 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 1; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x03; + } + else if (gain < 4 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 2; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x07; + } + else if (gain < 8 * 1024) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 4; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x0f; + } + else if (gain <= 16256) + { + Dgain = 1; Fine_dgainx128 = 128; Ana_gain = 8; + Dgain_reg = 0x00; Fine_dgain_reg = 0x80; Ana_gain_reg = 0x1f; + } + else if (gain < 32512) + { + Dgain = 1; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x00; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 65024) + { + Dgain = 2; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x01; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 127 * 1024) + { + Dgain = 4; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x03; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain < 254 * 1024) + { + Dgain = 8; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x07; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + else if (gain <= SENSOR_MAXGAIN * 1024) + { + Dgain = 16; Fine_againx64 = 127; Ana_gain = 8; + Dgain_reg = 0x0f; Fine_again_reg = 0x7f; Ana_gain_reg = 0x1f; + } + + if (gain <= 16256) + { + Fine_againx64 = abs(8 * gain/ (Dgain * Ana_gain * Fine_dgainx128)); + //Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_again_reg = Fine_againx64; + //Fine_dgain_reg = Fine_dgainx128; + } + else + { + Fine_dgainx128 = abs(8 * gain/ (Dgain * Ana_gain * Fine_againx64)); + Fine_dgain_reg = Fine_dgainx128; + } + // pr_info("[%s] gain : %d,%lld,%lld,%d, %d\n\n", __FUNCTION__,gain,Fine_again,Fine_dgain,Dgain,Ana_gain); + // pr_info("[%s] gain_reg : %x ,%x ,%x , %x\n\n", __FUNCTION__,Fine_again_reg,Ana_gain_reg,Fine_dgain_reg,Dgain_reg); + + gain_reg_HDR_DOL_SEF[3].data = Fine_again_reg; + gain_reg_HDR_DOL_SEF[2].data = Ana_gain_reg; + gain_reg_HDR_DOL_SEF[1].data = Fine_dgain_reg; + gain_reg_HDR_DOL_SEF[0].data = Dgain_reg & 0xF; + //pr_info("[%s] gain_reg : %x ,%x ,%x , %x\n\n", __FUNCTION__,gain_reg_HDR_DOL_SEF[3].data,gain_reg_HDR_DOL_SEF[2].data,gain_reg_HDR_DOL_SEF[1].data,gain_reg_HDR_DOL_SEF[0].data); + + for (i = 0; i < ARRAY_SIZE(gain_reg_HDR_DOL_SEF); i++) + { + if (gain_reg_HDR_DOL_SEF[i].data != gain_reg_temp[i].data) + { + params->reg_dirty = true; + break; + } + } + return SUCCESS; +} + + +static int pCus_GetAEMinMaxUSecs(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 30; + *max = 1000000/Preview_MIN_FPS; + return SUCCESS; +} + +static int pCus_GetAEMinMaxGain(ms_cus_sensor *handle, u32 *min, u32 *max) { + *min = 1024; + *max = SENSOR_MAXGAIN*1024; + return SUCCESS; +} + +static int sc8238_GetShutterInfo(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = Preview_line_period * 3; + info->step = Preview_line_period; + return SUCCESS; +} +static int pCus_GetShutterInfo_hdr_dol_lef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + info->max = 1000000000/Preview_MIN_FPS; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL*2; + return SUCCESS; +} +static int pCus_GetShutterInfo_hdr_dol_sef(struct __ms_cus_sensor* handle,CUS_SHUTTER_INFO *info) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + info->max = Preview_line_period_HDR_DOL * params->expo.max_short_exp; + info->min = (Preview_line_period_HDR_DOL * 4); + info->step = Preview_line_period_HDR_DOL*2; + return SUCCESS; +} +static int pCus_poweron_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} + +static int pCus_poweroff_hdr_dol_lef(ms_cus_sensor *handle, u32 idx) +{ + return SUCCESS; +} +static int pCus_GetSensorID_hdr_dol_lef(ms_cus_sensor *handle, u32 *id) +{ + *id = 0; + return SUCCESS; +} +static int pCus_init_hdr_dol_lef(ms_cus_sensor *handle) +{ + return SUCCESS; +} +#if 0 +static int pCus_GetVideoRes_hdr_dol_lef( ms_cus_sensor *handle, u32 res_idx, cus_camsensor_res **res ) +{ + *res = &handle->video_res_supported.res[res_idx]; + return SUCCESS; +} + +static int pCus_SetVideoRes_hdr_dol_lef( ms_cus_sensor *handle, u32 res ) +{ + handle->video_res_supported.ulcur_res = 0; //TBD + return SUCCESS; +} +#endif +/* static int pCus_GetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT *orit) +{ + *orit = CUS_ORIT_M0F0; + return SUCCESS; +} + +static int pCus_SetOrien_hdr_dol_lef(ms_cus_sensor *handle, CUS_CAMSENSOR_ORIT orit) +{ + return SUCCESS; +} */ + +static int pCus_GetFPS_hdr_dol_lef(ms_cus_sensor *handle) +{ + sc8238_params *params = (sc8238_params *)handle->private_data; + u32 max_fps = handle->video_res_supported.res[handle->video_res_supported.ulcur_res].max_fps; + u32 tVts = (vts_reg[0].data << 8) | (vts_reg[1].data << 0); + + if (params->expo.fps >= 1000) + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps*1000)/tVts; + else + params->expo.preview_fps = (vts_30fps_HDR_DOL*max_fps)/tVts; + + return params->expo.preview_fps; +} + +static int pCus_setCaliData_gain_linearity_hdr_dol_lef(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) +{ + return SUCCESS; +} +static int pCus_SetAEGain_cal_hdr_dol_lef(ms_cus_sensor *handle, u32 gain) +{ + return SUCCESS; +} +static int pCus_setCaliData_gain_linearity(ms_cus_sensor* handle, CUS_GAIN_GAP_ARRAY* pArray, u32 num) { + + return SUCCESS; +} + +int cus_camsensor_init_handle_linear(ms_cus_sensor* drv_handle) { + ms_cus_sensor *handle = drv_handle; + sc8238_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (sc8238_params *)handle->private_data; + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"sc8238_MIPI"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_NONE; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Short frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= 15; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 3840; + handle->video_res_supported.res[0].nOutputHeight= 2160; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = Preview_WIDTH; + handle->video_res_supported.res[1].height = Preview_HEIGHT; + handle->video_res_supported.res[1].max_fps= 20; + handle->video_res_supported.res[1].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[1].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[1].nOutputWidth= 3840; + handle->video_res_supported.res[1].nOutputHeight= 2160; + sprintf(handle->video_res_supported.res[1].strResDesc, "3840x2160@20fps"); + + + handle->video_res_supported.num_res = 3; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[2].width = 3072; + handle->video_res_supported.res[2].height = 1728; + handle->video_res_supported.res[2].max_fps= 30; + handle->video_res_supported.res[2].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[2].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[2].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[2].nOutputWidth= 3072; + handle->video_res_supported.res[2].nOutputHeight= 1728; + sprintf(handle->video_res_supported.res[2].strResDesc, "3072x1728@30fps"); + + + handle->video_res_supported.num_res = 4; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[3].width = 2592; + handle->video_res_supported.res[3].height = 1944; + handle->video_res_supported.res[3].max_fps= 30; + handle->video_res_supported.res[3].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[3].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[3].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[3].nOutputWidth= 2592; + handle->video_res_supported.res[3].nOutputHeight= 1944; + sprintf(handle->video_res_supported.res[3].strResDesc, "2592x1944@30fps"); + + handle->video_res_supported.num_res = 5; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[4].width = 2944; + handle->video_res_supported.res[4].height = 1656; + handle->video_res_supported.res[4].max_fps= 30; + handle->video_res_supported.res[4].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[4].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[4].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[4].nOutputWidth= 2944; + handle->video_res_supported.res[4].nOutputHeight= 1656; + sprintf(handle->video_res_supported.res[4].strResDesc, "2944x1656@30fps"); + + handle->video_res_supported.num_res = 6; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[5].width = 2560; + handle->video_res_supported.res[5].height = 1440; + handle->video_res_supported.res[5].max_fps= 30; + handle->video_res_supported.res[5].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[5].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[5].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[5].nOutputWidth= 2560; + handle->video_res_supported.res[5].nOutputHeight= 1440; + sprintf(handle->video_res_supported.res[5].strResDesc, "2560x1440@30fps"); + + handle->video_res_supported.num_res = 7; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[6].width = 1920; + handle->video_res_supported.res[6].height = 1080; + handle->video_res_supported.res[6].max_fps= 60; + handle->video_res_supported.res[6].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[6].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[6].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[6].nOutputWidth= 1920; + handle->video_res_supported.res[6].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[6].strResDesc, "1920x1080@60fps"); + + handle->video_res_supported.num_res = 8; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[7].width = Preview_WIDTH; + handle->video_res_supported.res[7].height = Preview_HEIGHT; + handle->video_res_supported.res[7].max_fps= 30; + handle->video_res_supported.res[7].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[7].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[7].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[7].nOutputWidth= 3840; + handle->video_res_supported.res[7].nOutputHeight= 2160; + sprintf(handle->video_res_supported.res[7].strResDesc, "3840x2160@30fps"); + + // i2c + + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2; + handle->ae_shutter_delay = 2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 1; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_mipi4lane_linear_4K15fps; + + handle->pCus_sensor_poweron = pCus_poweron ; + handle->pCus_sensor_poweroff = pCus_poweroff; + handle->pCus_sensor_post_init = pCus_post_init; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID ; + + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes; + + handle->pCus_sensor_GetOrien = pCus_GetOrien ; + handle->pCus_sensor_SetOrien = pCus_SetOrien ; + handle->pCus_sensor_GetFPS = pCus_GetFPS ; + handle->pCus_sensor_SetFPS = pCus_SetFPS ; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap; + handle->pCus_sensor_SetPatternMode = sc8238_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + //handle->pCus_sensor_GetAETrigger_mode = pCus_GetAETrigger_mode; + //handle->pCus_sensor_SetAETrigger_mode = pCus_SetAETrigger_mode; + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotify; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecs; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal; + handle->pCus_sensor_setCaliData_gain_linearity=pCus_setCaliData_gain_linearity; + handle->pCus_sensor_GetShutterInfo = sc8238_GetShutterInfo; + // params->expo.vts=vts_30fps; + // params->expo.fps = 30; + params->expo.line= 1000; + Preview_line_period = 25720; + params->expo.fps = 15; + params->reg_dirty = false; + params->reg_mf = false; + return SUCCESS; +} +int cus_camsensor_init_handle_hdr_dol_sef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + sc8238_params *params = NULL; + + cus_camsensor_init_handle_linear(drv_handle); + params = (sc8238_params *)handle->private_data; + + sprintf(handle->model_id,"sc8238_MIPI_HDR_SEF"); + + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; + handle->RGBIR_id = SENSOR_RGBIRID; + + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 3840; + handle->video_res_supported.res[0].nOutputHeight= 2160; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = 1920; + handle->video_res_supported.res[1].height = 1080; + handle->video_res_supported.res[1].max_fps= 30; + handle->video_res_supported.res[1].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[1].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[1].nOutputWidth= 1920; + handle->video_res_supported.res[1].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[1].strResDesc, "1920x1080@30fps"); + + + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + + handle->pCus_sensor_init = pCus_init_mipi4lane_HDR_DOL; + handle->pCus_sensor_GetFPS = pCus_GetFPS_HDR_DOL_SEF; + handle->pCus_sensor_SetFPS = pCus_SetFPS_HDR_DOL_SEF; //TBD + + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_SEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_SEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGainHDR_DOL_SEF; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + handle->pCus_sensor_SetAEGain = pCus_SetAEGainHDR_DOL_SEF; + handle->pCus_sensor_GetShutterInfo = pCus_GetShutterInfo_hdr_dol_sef; + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + params->expo.max_short_exp = 130; + handle->data_prec = SENSOR_DATAPREC_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 1; //Short frame + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + return SUCCESS; +} + +int cus_camsensor_init_handle_hdr_dol_lef(ms_cus_sensor* drv_handle) +{ + ms_cus_sensor *handle = drv_handle; + sc8238_params *params; + if (!handle) { + SENSOR_DMSG("[%s] not enough memory!\n", __FUNCTION__); + return FAIL; + } + SENSOR_DMSG("[%s]", __FUNCTION__); + //private data allocation & init + if (handle->private_data == NULL) { + SENSOR_EMSG("[%s] Private data is empty!\n", __FUNCTION__); + return FAIL; + } + params = (sc8238_params *)handle->private_data; + + //////////////////////////////////// + // sensor model ID // + //////////////////////////////////// + sprintf(handle->model_id,"sc8238_MIPI_HDR_LEF"); + + //////////////////////////////////// + // sensor interface info // + //////////////////////////////////// + //SENSOR_DMSG("[%s] entering function with id %d\n", __FUNCTION__, id); + handle->isp_type = SENSOR_ISP_TYPE; //ISP_SOC; + //handle->data_fmt = SENSOR_DATAFMT; //CUS_DATAFMT_YUV; + handle->sif_bus = SENSOR_IFBUS_TYPE;//CUS_SENIF_BUS_PARL; + handle->data_prec = SENSOR_DATAPREC_HDR_DOL; //CUS_DATAPRECISION_8; + handle->data_mode = SENSOR_DATAMODE; + handle->bayer_id = SENSOR_BAYERID_HDR_DOL; //CUS_BAYER_GB; + handle->RGBIR_id = SENSOR_RGBIRID; + handle->orient = SENSOR_ORIT; //CUS_ORIT_M1F1; + //handle->YC_ODER = SENSOR_YCORDER; //CUS_SEN_YCODR_CY; + handle->interface_attr.attr_mipi.mipi_lane_num = SENSOR_MIPI_LANE_NUM; + handle->interface_attr.attr_mipi.mipi_data_format = CUS_SEN_INPUT_FORMAT_RGB; // RGB pattern. + handle->interface_attr.attr_mipi.mipi_yuv_order = 0; //don't care in RGB pattern. + handle->interface_attr.attr_mipi.mipi_hsync_mode = SENSOR_MIPI_HSYNC_MODE_HDR_DOL; + handle->interface_attr.attr_mipi.mipi_hdr_mode = CUS_HDR_MODE_DCG; + handle->interface_attr.attr_mipi.mipi_hdr_virtual_channel_num = 0; //Long frame + + //////////////////////////////////// + // resolution capability // + //////////////////////////////////// + handle->video_res_supported.num_res = 1; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[0].width = Preview_WIDTH; + handle->video_res_supported.res[0].height = Preview_HEIGHT; + handle->video_res_supported.res[0].max_fps= Preview_MAX_FPS; + handle->video_res_supported.res[0].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[0].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[0].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[0].nOutputWidth= 3840; + handle->video_res_supported.res[0].nOutputHeight= 2160; + sprintf(handle->video_res_supported.res[0].strResDesc, "3840x2160@15fps"); + + handle->video_res_supported.num_res = 2; + handle->video_res_supported.ulcur_res = 0; //default resolution index is 0. + handle->video_res_supported.res[1].width = 1920; + handle->video_res_supported.res[1].height = 1080; + handle->video_res_supported.res[1].max_fps= 30; + handle->video_res_supported.res[1].min_fps= Preview_MIN_FPS; + handle->video_res_supported.res[1].crop_start_x= Preview_CROP_START_X; + handle->video_res_supported.res[1].crop_start_y= Preview_CROP_START_Y; + handle->video_res_supported.res[1].nOutputWidth= 1920; + handle->video_res_supported.res[1].nOutputHeight= 1080; + sprintf(handle->video_res_supported.res[1].strResDesc, "1920x1080@30fps"); + + + // i2c + handle->i2c_cfg.mode = SENSOR_I2C_LEGACY; //(CUS_ISP_I2C_MODE) FALSE; + handle->i2c_cfg.fmt = SENSOR_I2C_FMT; //CUS_I2C_FMT_A16D16; + handle->i2c_cfg.address = SENSOR_I2C_ADDR; //0x5a; + handle->i2c_cfg.speed = SENSOR_I2C_SPEED; //320000; + + // mclk + handle->mclk = Preview_MCLK_SPEED_HDR_DOL; + + //polarity + ///////////////////////////////////////////////////// + handle->pwdn_POLARITY = SENSOR_PWDN_POL; //CUS_CLK_POL_NEG; + handle->reset_POLARITY = SENSOR_RST_POL; //CUS_CLK_POL_NEG; + handle->VSYNC_POLARITY = SENSOR_VSYNC_POL; //CUS_CLK_POL_POS; + handle->HSYNC_POLARITY = SENSOR_HSYNC_POL; //CUS_CLK_POL_POS; + handle->PCLK_POLARITY = SENSOR_PCLK_POL; //CUS_CLK_POL_POS); // use '!' to clear board latch error + ///////////////////////////////////////////////////// + + + + //////////////////////////////////////////////////// + // AE parameters + //////////////////////////////////////////////////// + handle->ae_gain_delay = 2;//0;//1; + handle->ae_shutter_delay = 2;//1;//2; + + handle->ae_gain_ctrl_num = 1; + handle->ae_shutter_ctrl_num = 2; + + ///calibration + handle->sat_mingain=g_sensor_ae_min_gain; + + //LOGD("[%s:%d]\n", __FUNCTION__, __LINE__); + handle->pCus_sensor_release = cus_camsensor_release_handle; + handle->pCus_sensor_init = pCus_init_hdr_dol_lef; + //handle->pCus_sensor_powerupseq = pCus_powerupseq ; + handle->pCus_sensor_poweron = pCus_poweron_hdr_dol_lef; + handle->pCus_sensor_poweroff = pCus_poweroff_hdr_dol_lef; + handle->pCus_sensor_post_init = pCus_post_init; + + // Normal + handle->pCus_sensor_GetSensorID = pCus_GetSensorID_hdr_dol_lef; + handle->pCus_sensor_GetVideoResNum = pCus_GetVideoResNum; + handle->pCus_sensor_GetVideoRes = pCus_GetVideoRes; + handle->pCus_sensor_GetCurVideoRes = pCus_GetCurVideoRes; + handle->pCus_sensor_SetVideoRes = pCus_SetVideoRes_HDR_DOL; + handle->pCus_sensor_GetOrien = pCus_GetOrien; + handle->pCus_sensor_SetOrien = pCus_SetOrien_HDR; + handle->pCus_sensor_GetFPS = pCus_GetFPS_hdr_dol_lef; + handle->pCus_sensor_SetFPS = pCus_SetFPS_hdr_dol_lef; + //handle->pCus_sensor_GetSensorCap = pCus_GetSensorCap_hdr_dol_lef; + handle->pCus_sensor_SetPatternMode = sc8238_SetPatternMode; + /////////////////////////////////////////////////////// + // AE + /////////////////////////////////////////////////////// + // unit: micro seconds + handle->pCus_sensor_AEStatusNotify = pCus_AEStatusNotifyHDR_DOL_LEF; + handle->pCus_sensor_GetAEUSecs = pCus_GetAEUSecs; + handle->pCus_sensor_SetAEUSecs = pCus_SetAEUSecsHDR_DOL_LEF; + handle->pCus_sensor_GetAEGain = pCus_GetAEGain; + //handle->pCus_sensor_SetAEGain = pCus_SetAEGain_hdr_dol_lef; + handle->pCus_sensor_SetAEGain = pCus_SetAEGain; + + handle->pCus_sensor_GetAEMinMaxGain = pCus_GetAEMinMaxGain; + //handle->pCus_sensor_GetAEMinMaxUSecs= pCus_GetAEMinMaxUSecs_hdr_dol_lef; + + //sensor calibration + handle->pCus_sensor_SetAEGain_cal = pCus_SetAEGain_cal_hdr_dol_lef; + handle->pCus_sensor_setCaliData_gain_linearity= pCus_setCaliData_gain_linearity_hdr_dol_lef; + handle->pCus_sensor_GetShutterInfo = pCus_GetShutterInfo_hdr_dol_lef; + + params->expo.vts = vts_30fps_HDR_DOL; + params->expo.fps = 15; + params->reg_dirty = false; + + return SUCCESS; +} + +int cus_camsensor_release_handle(ms_cus_sensor *handle) +{ + return SUCCESS; +} + +SENSOR_DRV_ENTRY_IMPL_END_EX( SC8235_HDR, + cus_camsensor_init_handle_linear, + cus_camsensor_init_handle_hdr_dol_sef, + cus_camsensor_init_handle_hdr_dol_lef, + sc8238_params + ); + +