From 46028feca770f2770587334f125c52613adbffda Mon Sep 17 00:00:00 2001 From: Wang Panzhenzhuan Date: Thu, 12 Nov 2020 09:48:40 +0000 Subject: [PATCH] media: i2c: nvp6324 drivers synchronize with kernel 4.4 kernel 4.4 commit ends 9784ddae3834e1d2a27a55abfadeed635f6bd008 Signed-off-by: Wang Panzhenzhuan Change-Id: If7d53e4c6667c09a8db90dca571599f12a2088ce --- drivers/media/i2c/Kconfig | 9 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/jaguar1_drv/Makefile | 5 + .../jaguar1_cableA_video_eq_table.h | 3575 +++++++++++++++ .../jaguar1_cableB_video_eq_table.h | 2081 +++++++++ .../i2c/jaguar1_drv/jaguar1_coax_protocol.c | 1677 +++++++ .../i2c/jaguar1_drv/jaguar1_coax_protocol.h | 201 + .../i2c/jaguar1_drv/jaguar1_coax_table.h | 2907 ++++++++++++ .../media/i2c/jaguar1_drv/jaguar1_common.h | 454 ++ drivers/media/i2c/jaguar1_drv/jaguar1_drv.c | 918 ++++ drivers/media/i2c/jaguar1_drv/jaguar1_drv.h | 31 + drivers/media/i2c/jaguar1_drv/jaguar1_i2c.c | 46 + drivers/media/i2c/jaguar1_drv/jaguar1_ioctl.h | 79 + drivers/media/i2c/jaguar1_drv/jaguar1_mipi.c | 317 ++ drivers/media/i2c/jaguar1_drv/jaguar1_mipi.h | 41 + .../i2c/jaguar1_drv/jaguar1_mipi_table.h | 315 ++ .../media/i2c/jaguar1_drv/jaguar1_motion.c | 262 ++ .../media/i2c/jaguar1_drv/jaguar1_motion.h | 38 + .../i2c/jaguar1_drv/jaguar1_reg_set_def.h | 268 ++ drivers/media/i2c/jaguar1_drv/jaguar1_v4l2.c | 959 ++++ drivers/media/i2c/jaguar1_drv/jaguar1_video.c | 945 ++++ drivers/media/i2c/jaguar1_drv/jaguar1_video.h | 68 + .../media/i2c/jaguar1_drv/jaguar1_video_eq.c | 260 ++ .../media/i2c/jaguar1_drv/jaguar1_video_eq.h | 170 + .../i2c/jaguar1_drv/jaguar1_video_table.h | 3913 +++++++++++++++++ 25 files changed, 19540 insertions(+) create mode 100644 drivers/media/i2c/jaguar1_drv/Makefile create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_cableA_video_eq_table.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_cableB_video_eq_table.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_coax_table.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_common.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_drv.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_drv.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_i2c.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_ioctl.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_mipi.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_mipi.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_mipi_table.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_motion.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_motion.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_reg_set_def.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_v4l2.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_video.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_video.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.c create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.h create mode 100644 drivers/media/i2c/jaguar1_drv/jaguar1_video_table.h diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 933a9db9e336..1527eadf8e4a 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -1669,6 +1669,15 @@ config VIDEO_I2C To compile this driver as a module, choose M here: the module will be called video-i2c +config VIDEO_NVP6324 + tristate "NEXTCHIP nvp6324 driver support" + depends on VIDEO_V4L2 && I2C + ---help--- + Support for the NVP6324. + + To compile this driver as a module, choose M here: the + module will be called jaguar1_drv. + config VIDEO_HALL_DC_MOTOR tristate "Hall dc-motor driver for camera iris" depends on PWM && VIDEO_V4L2 diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile index 62e8e7e41a3b..319d1bced6ec 100644 --- a/drivers/media/i2c/Makefile +++ b/drivers/media/i2c/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_VIDEO_ET8EK8) += et8ek8/ obj-$(CONFIG_VIDEO_CX25840) += cx25840/ obj-$(CONFIG_VIDEO_M5MOLS) += m5mols/ obj-y += soc_camera/ +obj-$(CONFIG_VIDEO_NVP6324) += jaguar1_drv/ obj-$(CONFIG_VIDEO_APTINA_PLL) += aptina-pll.o obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o diff --git a/drivers/media/i2c/jaguar1_drv/Makefile b/drivers/media/i2c/jaguar1_drv/Makefile new file mode 100644 index 000000000000..12b00eb7251e --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/Makefile @@ -0,0 +1,5 @@ +subdir-ccflags-y += -DNC_DEBUG +obj-y := jaguar1_drv.o jaguar1_i2c.o \ + jaguar1_video.o jaguar1_coax_protocol.o \ + jaguar1_motion.o jaguar1_video_eq.o \ + jaguar1_mipi.o jaguar1_v4l2.o diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_cableA_video_eq_table.h b/drivers/media/i2c/jaguar1_drv/jaguar1_cableA_video_eq_table.h new file mode 100644 index 000000000000..a0754f7b4fb3 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_cableA_video_eq_table.h @@ -0,0 +1,3575 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_eq_table.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _CABLE_A_VIDEO_EQ_TABLE_H_ +#define _CABLE_A_VIDEO_EQ_TABLE_H_ + +#include "jaguar1_common.h" +#include "jaguar1_video_eq.h" + +/*===================================================================================== + * Cable : 3C2V + *=====================================================================================*/ +_jaguar1_video_eq_value_table_s equalizer_value_fmtdef_cableA[ ] = +{ + [ AHD20_SD_H720_NT_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H720_NT_SINGLE_ENDED", + .video_fmt = AHD20_SD_SH720_NT, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0xD4, 0xD4, 0xD4, 0xD4, 0xD4, 0xD4 }, + .h_delay_b = { 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c }, + }, + /* clock */ + { + .clk_adc = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .clk_adc_pre= { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .clk_adc_post = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ AHD20_SD_H720_PAL_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H720_PAL_SINGLE_ENDED", + .video_fmt = AHD20_SD_SH720_PAL, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .pal_cm_off= { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0xD8, 0xD8, 0xD8, 0xD8, 0xD8, 0xD8 }, + .h_delay_b = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + }, + { + .clk_adc = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .clk_adc_pre= { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .clk_adc_post = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + }, + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + [ AHD20_SD_H1440_NT_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H1440_NT_SINGLE_ENDED", + .video_fmt = AHD20_SD_H1440_NT, + .analog_input = SINGLE_ENDED, + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + { + .h_delay_a = { 0xD4, 0xD4, 0xD4, 0xD4, 0xD4, 0xD4 }, + .h_delay_b = { 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c }, + }, + { + .clk_adc = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .clk_adc_pre= { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .clk_adc_post = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + }, + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + [ AHD20_SD_H1440_PAL_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H1440_PAL_SINGLE_ENDED", + .video_fmt = AHD20_SD_H1440_PAL, + .analog_input = SINGLE_ENDED, + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .pal_cm_off= { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + { + .h_delay_a = { 0xD8, 0xD8, 0xD8, 0xD8, 0xD8, 0xD8 }, + .h_delay_b = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + }, + /* clock */ + { + .clk_adc = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .clk_adc_pre= { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .clk_adc_post = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + //======================================================================================================= + + + [ AHD20_SD_H960_2EX_Btype_NT_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H960_2EX_Btype_NT_SINGLE_ENDED", + .video_fmt = AHD20_SD_H960_2EX_Btype_NT, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x77, 0x77 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x70, 0x70, 0x70, 0x70, 0x70, 0x70 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED", + .video_fmt = AHD20_SD_H960_2EX_Btype_PAL, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x77, 0x77 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .c_filter = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x68, 0x68, 0x68, 0x68, 0x68, 0x68 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x7, 0x7, 0x7, 0x7, 0x7, 0x7 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + +#if 0 + [ AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED ] = + { + .name = "AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED", + .video_fmt = AHD20_SD_H960_2EX_Btype_PAL, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x77, 0x77 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .pal_cm_off= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x18, 0x18, 0x18, 0x18, 0x18, 0x18 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler2 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .sd_mode= { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, +#endif + [ AHD20_1080P_30P_SINGLE_ENDED ] = + { + .name = "AHD20_1080P_30P_SINGLE_ENDED", + .video_fmt = AHD20_1080P_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x0, 0x0, 0x4, 0x10, 0x10, 0x18 }, + .v_gain = { 0x0, 0x0, 0xf0, 0xe, 0xe, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_1080P_25P_SINGLE_ENDED ] = + { + .name = "AHD20_1080P_25P_SINGLE_ENDED", + .video_fmt = AHD20_1080P_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x0, 0x0, 0x4, 0x10, 0x10, 0x18 }, + .v_gain = { 0x0, 0x0, 0xf0, 0x0e, 0xe, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_60P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_60P_SINGLE_ENDED", + .video_fmt = AHD20_720P_60P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .u_gain = { 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc }, + .v_gain = { 0x0, 0x0, 0xf0, 0xe, 0xe, 0x14 }, + .u_offset = { 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .v_offset = { 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .black_level = { 0x80, 0x80, 0x80, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_50P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_50P_SINGLE_ENDED", + .video_fmt = AHD20_720P_50P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .u_gain = { 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc }, + .v_gain = { 0x0, 0x0, 0xf0, 0xe, 0xe, 0x14 }, + .u_offset = { 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .v_offset = { 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .black_level = { 0x80, 0x80, 0x80, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_25P_EX_Btype_SINGLE_ENDED ] = + { + .name = "AHD20_720P_25P_EX_Btype_SINGLE_ENDED", + .video_fmt = AHD20_720P_25P_EX_Btype, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0xf, 0xf, 0xf, 0xf, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x43, 0x43, 0x43, 0x43, 0x43, 0x43 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_30P_EX_Btype_SINGLE_ENDED ] = + { + .name = "AHD20_720P_30P_EX_Btype_SINGLE_ENDED", + .video_fmt = AHD20_720P_30P_EX_Btype, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0xf, 0xf, 0xf, 0xf, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_25P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_25P_SINGLE_ENDED", + .video_fmt = AHD20_720P_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0xf, 0xf, 0xf, 0xf, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_720P_30P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_30P_SINGLE_ENDED", + .video_fmt = AHD20_720P_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0xf, 0xf, 0xf, 0xf, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_960P_30P_SINGLE_ENDED ] = + { + .name = "AHD20_960P_30P_SINGLE_ENDED", + .video_fmt = AHD20_720P_960P_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x0, 0x0, 0x4, 0x10, 0x10, 0x18 }, + .v_gain = { 0x0, 0x0, 0xf0, 0xe, 0xe, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ AHD20_960P_25P_SINGLE_ENDED ] = + { + .name = "AHD20_960P_25P_SINGLE_ENDED", + .video_fmt = AHD20_720P_960P_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x87, 0x89, 0x93, 0x94 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0xf, 0xf }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x0, 0x0, 0x4, 0x10, 0x10, 0x18 }, + .v_gain = { 0x0, 0x0, 0xf0, 0x0e, 0xe, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x81, 0x81, 0x81, 0x81, 0x81, 0x81 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_FHD_25P_SINGLE_ENDED ] = + { + .name = "CVI_FHD_25P_SINGLE_ENDED", + .video_fmt = CVI_FHD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x92, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x4, 0x4, 0x4, 0x4 }, + .u_gain = { 0xc, 0xc, 0xc, 0xc, 0xc, 0xc }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0xF9, 0xF9, 0xF9, 0xF9, 0xF9, 0xF9 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .h_scaler5 = { 0x88, 0x88, 0x88, 0x88, 0x88, 0x88 }, + .h_scaler6 = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .h_scaler7 = { 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c }, + .h_scaler8 = { 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_FHD_30P_SINGLE_ENDED ] = + { + .name = "CVI_FHD_30P_SINGLE_ENDED", + .video_fmt = CVI_FHD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x92, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x4, 0x4, 0x4, 0x4 }, + .u_gain = { 0xc, 0xc, 0xc, 0xc, 0xc, 0xc }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x89, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .h_delay_b = { 0x16, 0x16, 0x16, 0x16, 0x16, 0x16 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x39, 0x39, 0x39, 0x39, 0x39, 0x39 }, + .h_scaler3 = { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50 }, + .h_scaler4 = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_25P_SINGLE_ENDED ] = + { + .name = "CVI_HD_25P_SINGLE_ENDED", + .video_fmt = CVI_HD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0x70, 0x70, 0x70, 0x70, 0x70, 0x70 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_30P_SINGLE_ENDED ] = + { + .name = "CVI_HD_30P_SINGLE_ENDED", + .video_fmt = CVI_HD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler3 = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .h_scaler4 = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_25P_EX_SINGLE_ENDED ] = + { + .name = "CVI_HD_25P_EX_SINGLE_ENDED", + .video_fmt = CVI_HD_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0x70, 0x70, 0x70, 0x70, 0x70, 0x70 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_30P_EX_SINGLE_ENDED ] = + { + .name = "CVI_HD_30P_EX_SINGLE_ENDED", + .video_fmt = CVI_HD_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler3 = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .h_scaler4 = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_50P_SINGLE_ENDED ] = + { + .name = "CVI_HD_50P_SINGLE_ENDED", + .video_fmt = CVI_HD_50P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x92, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x4, 0x4, 0x4, 0x4 }, + .u_gain = { 0xc, 0xc, 0xc, 0xc, 0xc, 0xc }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x68, 0x68, 0x68, 0x68, 0x68, 0x68 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ CVI_HD_60P_SINGLE_ENDED ] = + { + .name = "CVI_HD_60P_SINGLE_ENDED", + .video_fmt = CVI_HD_60P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x92, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x3, 0x3, 0x4, 0x4, 0x4, 0x4 }, + .u_gain = { 0x0c, 0xc, 0xc, 0xc, 0xc, 0xc }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler3 = { 0x68, 0x68, 0x68, 0x68, 0x68, 0x68 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_FHD_25P_SINGLE_ENDED ] = + { + .name = "TVI_FHD_25P_SINGLE_ENDED", + .video_fmt = TVI_FHD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .c_filter = { 0x82, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .h_delay_b = { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_FHD_30P_SINGLE_ENDED ] = + { + .name = "TVI_FHD_30P_SINGLE_ENDED", + .video_fmt = TVI_FHD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .c_filter = { 0x82, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x68, 0x68, 0x68, 0x68, 0x68, 0x68 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x7, 0x7, 0x7, 0x7, 0x7, 0x7 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_50P_SINGLE_ENDED ] = + { + .name = "TVI_HD_50P_SINGLE_ENDED", + .video_fmt = TVI_HD_50P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .c_filter = { 0x2, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .h_delay_b = { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_60P_SINGLE_ENDED ] = + { + .name = "TVI_HD_60P_SINGLE_ENDED", + .video_fmt = TVI_HD_60P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x93, 0x94, 0x95, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .y_peaking_mode= { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .y_fir_mode = { 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f }, + .c_filter = { 0x82, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x68, 0x68, 0x68, 0x68, 0x68, 0x68 }, + .h_delay_b = { 0x13, 0x13, 0x13, 0x13, 0x13, 0x13 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x7, 0x7, 0x7, 0x7, 0x7, 0x7 }, + }, + /* clock */ + { + .clk_adc = { 0x8, 0x8, 0x8, 0x8, 0x8, 0x8 }, + .clk_adc_pre= { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x0, 0x0, 0x0, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_25P_SINGLE_ENDED ] = + { + .name = "TVI_HD_25P_SINGLE_ENDED", + .video_fmt = TVI_HD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xac, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x2, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x70, 0x70, 0x70, 0x70, 0x70, 0x70 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_30P_SINGLE_ENDED ] = + { + .name = "TVI_HD_30P_SINGLE_ENDED", + .video_fmt = TVI_HD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xac, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x2, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x70, 0x70, 0x70, 0x70, 0x70, 0x70 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_B_25P_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_25P_SINGLE_ENDED", + .video_fmt = TVI_HD_B_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x77, 0x77 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x86, 0x86, 0x86, 0x86, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc_pre = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_post= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_B_30P_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_30P_SINGLE_ENDED", + .video_fmt = TVI_HD_B_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x77, 0x77 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deq_a_on = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deq_a_sel = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x86, 0x86, 0x86, 0x86, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc_pre = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_post= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_25P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_25P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0x0a, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x2, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_30P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_30P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0x0a, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_B_25P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_25P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_B_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .h_delay_b = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + [ TVI_HD_B_30P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_30P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_B_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x0, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .deq_a_sel = { 0x0, 0x91, 0x92, 0x93, 0x93, 0x93 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xac, 0xac, 0xac, 0xac, 0xac, 0xac }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_07 = { 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3 }, + .deqA_08 = { 0xa, 0xa, 0xa, 0xa, 0xa, 0xa }, + .deqA_09 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_10 = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + .deqA_11 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .deqA_12 = { 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .y_peaking_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_fir_mode = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .pal_cm_off= { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .hue = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .saturation_b = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .burst_dec_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12 }, + .h_delay_c = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .y_delay = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + }, + /* clock */ + { + .clk_adc = { 0x4, 0x4, 0x4, 0x4, 0x4, 0x4 }, + .clk_adc_pre= { 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + .clk_adc_post = { 0x2, 0x2, 0x2, 0x2, 0x2, 0x2 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler2 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler4 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler5 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler6 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler7 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler8 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .h_scaler9 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .pn_auto = { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .comb_mode = { 0x5, 0x5, 0x5, 0x5, 0x5, 0x5 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .ahd_mode= { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .sd_mode= { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, + .spl_mode = { 0x3, 0x3, 0x3, 0x3, 0x3, 0x3 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .afe_g_sel= { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .afe_ctr_clp= { 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c }, + .d_agc_option = { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }, + }, + }, + + + + [ AHD20_SD_H960_2EX_Btype_NT_DIFFERENTIAL ] = /* o */ + { + .name = "AHD20_SD_H960_2EX_Btype_NT_DIFFERENTIAL", + .video_fmt = AHD20_SD_H960_2EX_Btype_NT, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_SD_H960_2EX_Btype_PAL_DIFFERENTIAL ] = /* o */ + { + .name = "AHD20_SD_H960_2EX_Btype_PAL_DIFFERENTIAL", + .video_fmt = AHD20_SD_H960_2EX_Btype_PAL, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_1080P_30P_DIFFERENTIAL ] = /* o */ + { + .name = "AHD20_1080P_30P_DIFFERENTIAL", + .video_fmt = AHD20_1080P_30P, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_1080P_25P_DIFFERENTIAL ] = + { + .name = "AHD20_1080P_25P_DIFFERENTIAL", + .video_fmt = AHD20_1080P_25P, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_720P_25P_EX_Btype_DIFFERENTIAL ] = + { + .name = "AHD20_720P_25P_EX_Btype_DIFFERENTIAL", + .video_fmt = AHD20_720P_25P_EX_Btype, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_720P_30P_EX_Btype_DIFFERENTIAL ] = + { + .name = "AHD20_720P_30P_EX_Btype_DIFFERENTIAL", + .video_fmt = AHD20_720P_30P_EX_Btype, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_720P_25P_DIFFERENTIAL ] = + { + .name = "AHD20_720P_25P_DIFFERENTIAL", + .video_fmt = AHD20_720P_25P, + .analog_input = DIFFERENTIAL, + }, + + [ AHD20_720P_30P_DIFFERENTIAL ] = + { + .name = "AHD20_720P_30P_DIFFERENTIAL", + .video_fmt = AHD20_720P_30P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_FHD_25P_DIFFERENTIAL ] = + { + .name = "CVI_FHD_25P_DIFFERENTIAL", + .video_fmt = CVI_FHD_25P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_FHD_30P_DIFFERENTIAL ] = + { + .name = "CVI_FHD_30P_DIFFERENTIAL", + .video_fmt = CVI_FHD_30P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_25P_DIFFERENTIAL ] = + { + .name = "CVI_HD_25P_DIFFERENTIAL", + .video_fmt = CVI_HD_25P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_30P_DIFFERENTIAL ] = + { + .name = "CVI_HD_30P_DIFFERENTIAL", + .video_fmt = CVI_HD_30P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_25P_EX_DIFFERENTIAL ] = + { + .name = "CVI_HD_25P_EX_DIFFERENTIAL", + .video_fmt = CVI_HD_25P_EX, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_30P_EX_DIFFERENTIAL ] = + { + .name = "CVI_HD_30P_EX_DIFFERENTIAL", + .video_fmt = CVI_HD_30P_EX, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_50P_DIFFERENTIAL ] = + { + .name = "CVI_HD_50P_DIFFERENTIAL", + .video_fmt = CVI_HD_50P, + .analog_input = DIFFERENTIAL, + }, + + [ CVI_HD_60P_DIFFERENTIAL ] = + { + .name = "CVI_HD_60P_DIFFERENTIAL", + .video_fmt = CVI_HD_60P, + .analog_input = DIFFERENTIAL, + }, + + + + [ TVI_FHD_25P_DIFFERENTIAL ] = + { + .name = "TVI_FHD_25P_DIFFERENTIAL", + .video_fmt = TVI_FHD_25P, + .analog_input = DIFFERENTIAL, + + }, + + [ TVI_FHD_30P_DIFFERENTIAL ] = + { + .name = "TVI_FHD_30P_DIFFERENTIAL", + .video_fmt = TVI_FHD_30P, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_25P_DIFFERENTIAL ] = + { + .name = "TVI_HD_25P_DIFFERENTIAL", + .video_fmt = TVI_HD_25P, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_30P_DIFFERENTIAL ] = + { + .name = "TVI_HD_30P_DIFFERENTIAL", + .video_fmt = TVI_HD_30P, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_B_25P_DIFFERENTIAL ] = + { + .name = "TVI_HD_B_25P_DIFFERENTIAL", + .video_fmt = TVI_HD_B_25P, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_B_30P_DIFFERENTIAL ] = + { + .name = "TVI_HD_B_30P_DIFFERENTIAL", + .video_fmt = TVI_HD_B_30P, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_25P_EX_DIFFERENTIAL ] = + { + .name = "TVI_HD_25P_EX_DIFFERENTIAL", + .video_fmt = TVI_HD_25P_EX, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_30P_EX_DIFFERENTIAL ] = + { + .name = "TVI_HD_30P_EX_DIFFERENTIAL", + .video_fmt = TVI_HD_30P_EX, + .analog_input = DIFFERENTIAL, + + }, + + [ TVI_HD_B_25P_EX_DIFFERENTIAL ] = + { + .name = "TVI_HD_B_25P_EX_DIFFERENTIAL", + .video_fmt = TVI_HD_B_25P_EX, + .analog_input = DIFFERENTIAL, + }, + + [ TVI_HD_B_30P_EX_DIFFERENTIAL ] = + { + .name = "TVI_HD_B_30P_EX_DIFFERENTIAL", + .video_fmt = TVI_HD_B_30P_EX, + .analog_input = DIFFERENTIAL, + }, + +}; + + + + +#endif /* EXTDRV_JAGUAR1_VIDEO_INPUT_TABLE_H_ */ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_cableB_video_eq_table.h b/drivers/media/i2c/jaguar1_drv/jaguar1_cableB_video_eq_table.h new file mode 100644 index 000000000000..88cdd7015264 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_cableB_video_eq_table.h @@ -0,0 +1,2081 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_eq_table.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _CABLE_B_VIDEO_EQ_TABLE_H_ +#define _CABLE_B_VIDEO_EQ_TABLE_H_ + +#include "new_video_eq.h" + +_video_equalizer_value_table_s_test equalizer_value_fmtdef_cableB[ NC_EQ_SETTING_FMT_MAX ] = +{ + [ AHD20_1080P_30P_SINGLE_ENDED ] = /* o */ + { + .name = "AHD20_1080P_30P_SINGLE_ENDED", + .video_fmt = AHD20_1080P_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x87, 0x89, 0x93, 0x94 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .hue = { 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x00, 0x00, 0x04, 0x10, 0x10, 0x18 }, + .v_gain = { 0x00, 0x00, 0xf0, 0x0e, 0x0e, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x86, 0x84, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .y_delay = { 0x05, 0x03, 0x03, 0x03, 0x03, 0x03 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ AHD20_1080P_25P_SINGLE_ENDED ] = + { + .name = "AHD20_1080P_25P_SINGLE_ENDED", + .video_fmt = AHD20_1080P_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x57, 0x57 }, + .eq_gain_sel = { 0x78, 0x7b, 0x7f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x87, 0x89, 0x93, 0x94 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x86, 0x82, 0x82, 0x7e, 0x7c, 0x77 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0xa2, 0xb2 }, + .hue = { 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0x00, 0x00, 0x04, 0x10, 0x10, 0x18 }, + .v_gain = { 0x00, 0x00, 0xf0, 0x0e, 0x0e, 0x14 }, + .u_offset = { 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .v_offset = { 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb }, + .black_level = { 0x80, 0x81, 0x81, 0x83, 0x83, 0x87 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa8, 0xa8, 0xa8, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x90, 0x90, 0x90, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x86, 0x84, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .y_delay = { 0x05, 0x03, 0x03, 0x03, 0x03, 0x03 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ AHD20_720P_25P_EX_Btype_SINGLE_ENDED ] = + { + .name = "AHD20_720P_25P_EX_Btype_SINGLE_ENDED", + .video_fmt = AHD20_720P_25P_EX_Btype, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x62, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ AHD20_720P_30P_EX_Btype_SINGLE_ENDED ] = + { + .name = "AHD20_720P_30P_EX_Btype_SINGLE_ENDED", + .video_fmt = AHD20_720P_30P_EX_Btype, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x62, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ AHD20_720P_25P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_25P_SINGLE_ENDED", + .video_fmt = AHD20_720P_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x62, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ AHD20_720P_30P_SINGLE_ENDED ] = + { + .name = "AHD20_720P_30P_SINGLE_ENDED", + .video_fmt = AHD20_720P_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x62, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x77, 0x67, 0x57 }, + .eq_gain_sel = { 0x78, 0x78, 0x7a, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x86, 0x87, 0x93, 0x8e, 0x8e }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x88, 0x78, 0x88, 0x88, 0x7e }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x82, 0x82, 0x92, 0x92 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x84, 0x84, 0x84, 0x84, 0x86 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xab, 0xb0, 0xb0, 0xa4, 0xa0 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0x90, 0x90 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .format_set2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ CVI_FHD_25P_SINGLE_ENDED ] = + { + .name = "CVI_FHD_25P_SINGLE_ENDED", + .video_fmt = CVI_FHD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x07, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x92, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .hue = { 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 }, + .u_gain = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .y_delay = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x49, 0x49, 0x49, 0x49, 0x49, 0x49 }, + .h_scaler3 = { 0x4f, 0x4f, 0x4f, 0x4f, 0x4f, 0x4f }, + .h_scaler4 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + }, + }, + + [ CVI_FHD_30P_SINGLE_ENDED ] = + { + .name = "CVI_FHD_30P_SINGLE_ENDED", + .video_fmt = CVI_FHD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x07, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x92, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .hue = { 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 }, + .u_gain = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .y_delay = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x39, 0x39, 0x39, 0x39, 0x39, 0x39 }, + .h_scaler3 = { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + }, + }, + + [ CVI_HD_25P_SINGLE_ENDED ] = + { + .name = "CVI_HD_25P_SINGLE_ENDED", + .video_fmt = CVI_HD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .h_scaler4 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ CVI_HD_30P_SINGLE_ENDED ] = + { + .name = "CVI_HD_30P_SINGLE_ENDED", + .video_fmt = CVI_HD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x60, 0x5e, 0x5b, 0x59, 0x59 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .h_scaler4 = { 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ CVI_HD_25P_EX_SINGLE_ENDED ] = + { + .name = "CVI_HD_25P_EX_SINGLE_ENDED", + .video_fmt = CVI_HD_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x7b, 0x7b, 0x7a, 0x79, 0x79, 0x7a }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ CVI_HD_30P_EX_SINGLE_ENDED ] = + { + .name = "CVI_HD_30P_EX_SINGLE_ENDED", + .video_fmt = CVI_HD_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x88, 0x8c, 0x8a, 0x87, 0x85, 0x84 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0x92, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x84, 0x86, 0x84, 0x84, 0x86, 0x88 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0x80, 0xa0, 0xa0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x7b, 0x7b, 0x7a, 0x79, 0x79, 0x7a }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler3 = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ CVI_HD_50P_SINGLE_ENDED ] = + { + .name = "CVI_HD_50P_SINGLE_ENDED", + .video_fmt = CVI_HD_50P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x07, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x92, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .hue = { 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 }, + .u_gain = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .y_delay = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29 }, + .h_scaler3 = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ CVI_HD_60P_SINGLE_ENDED ] = + { + .name = "CVI_HD_60P_SINGLE_ENDED", + .video_fmt = CVI_HD_60P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x62, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x07, 0x77, 0x77, 0x77, 0x67, 0x47 }, + .eq_gain_sel = { 0x78, 0x7f, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x92, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x98, 0x98, 0x98, 0x98, 0x98, 0x98 }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x92, 0x92, 0x92, 0x92, 0xb2, 0xb2 }, + .hue = { 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 }, + .u_gain = { 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c }, + .v_gain = { 0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x1a }, + .u_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .v_offset = { 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa }, + .black_level = { 0x86, 0x7a, 0x88, 0x84, 0x84, 0x84 }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x47, 0x37 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xa0, 0xa0, 0x90, 0x90, 0x90 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler3 = { 0x19, 0x19, 0x19, 0x19, 0x19, 0x19 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 }, + .format_set2 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ TVI_HD_25P_SINGLE_ENDED ] = + { + .name = "TVI_HD_25P_SINGLE_ENDED", + .video_fmt = TVI_HD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x7e, 0x7d, 0x7c, 0x5c, 0x7d }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0xc0, 0xc0, 0xc0, 0x00, 0xc0, 0xc0 }, + .h_scaler4 = { 0x01, 0x01, 0x01, 0x00, 0x01, 0x01 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x07, 0x07, 0x07, 0x07, 0x07, 0x07 }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x21, 0x21, 0x21, 0x21, 0x21, 0x21 }, + }, + }, + + [ TVI_HD_30P_SINGLE_ENDED ] = + { + .name = "TVI_HD_30P_SINGLE_ENDED", + .video_fmt = TVI_HD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x20, 0x1e, 0x1d, 0x1c, 0x1c, 0x1d }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0xff, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .h_scaler4 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_B_25P_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_25P_SINGLE_ENDED", + .video_fmt = TVI_HD_B_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x7e, 0x7d, 0x7c, 0x7c, 0x7d }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .format_set2 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_B_30P_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_30P_SINGLE_ENDED", + .video_fmt = TVI_HD_B_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x7e, 0x7d, 0x7c, 0x7c, 0x7d }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .format_set2 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_25P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_25P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x60, 0x5e, 0x5d, 0x5c, 0x5c, 0x5d }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x59, 0x59, 0x29, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_30P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_30P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x7e, 0x7d, 0x7c, 0x7c, 0x7d }, + .h_delay_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_delay_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x59, 0x59, 0x59, 0x59, 0x59, 0x59 }, + .h_scaler3 = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_B_25P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_25P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_B_25P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x82, 0x80, 0x7f, 0x7e, 0x7e, 0x7f }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .format_set2 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_HD_B_30P_EX_SINGLE_ENDED ] = + { + .name = "TVI_HD_B_30P_EX_SINGLE_ENDED", + .video_fmt = TVI_HD_B_30P_EX, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x67, 0x57, 0x57, 0x57, 0x47 }, + .eq_gain_sel = { 0x78, 0x78, 0x78, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x92, 0x93, 0x93, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x86, 0x84, 0x81, 0x7f, 0x7e }, + .h_peaking = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_filter = { 0x82, 0x92, 0x92, 0xa2, 0xa2, 0xa2 }, + .hue = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_gain = { 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0 }, + .v_gain = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x86, 0x86, 0x88, 0x8a }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x57 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xa8, 0xaa, 0xaa, 0xac, 0xa8, 0xa6 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .c_option = { 0x80, 0x80, 0x80, 0xb0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x7e, 0x7d, 0x7c, 0x7c, 0x7d }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + }, + /* clock */ + { + .clk_adc = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .clk_dec = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .format_set2 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_FHD_25P_SINGLE_ENDED ] = + { + .name = "TVI_FHD_25P_SINGLE_ENDED", + .video_fmt = TVI_FHD_25P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .hue = { 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x82, 0x82, 0x82, 0x82, 0x82, 0x82 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .y_delay = { 0x05, 0x05, 0x05, 0x05, 0x20, 0x20 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + [ TVI_FHD_30P_SINGLE_ENDED ] = + { + .name = "TVI_FHD_30P_SINGLE_ENDED", + .video_fmt = TVI_FHD_30P, + .analog_input = SINGLE_ENDED, + + /* base */ + { + .eq_bypass = { 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 }, + .eq_band_sel = { 0x77, 0x77, 0x77, 0x67, 0x57, 0x37 }, + .eq_gain_sel = { 0x78, 0x78, 0x6f, 0x7f, 0x7f, 0x7f }, + .deq_a_on = { 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .deq_a_sel = { 0x00, 0x91, 0x93, 0x94, 0x95, 0x93 }, + .deq_b_sel = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + }, + /* coeff_ */ + { + .deqA_01 = { 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC }, + .deqA_02 = { 0x78, 0x78, 0x78, 0x78, 0x78, 0x78 }, + .deqA_03 = { 0x17, 0x17, 0x17, 0x17, 0x17, 0x17 }, + .deqA_04 = { 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1 }, + .deqA_05 = { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 }, + .deqA_06 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_07 = { 0xC3, 0xC3, 0xC3, 0xC3, 0xC3, 0xC3 }, + .deqA_08 = { 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A }, + .deqA_09 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_10 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .deqA_11 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .deqA_12 = { 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2 }, + }, + /* color */ + { + .contrast = { 0x82, 0x7c, 0x78, 0x6c, 0x70, 0x68 }, + .h_peaking = { 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f }, + .c_filter = { 0x82, 0x82, 0x92, 0xb2, 0xb2, 0xb2 }, + .hue = { 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe }, + .u_gain = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .v_gain = { 0x00, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8 }, + .u_offset = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, + .v_offset = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .black_level = { 0x86, 0x88, 0x88, 0x8c, 0x8f, 0x8f }, + .acc_ref = { 0x57, 0x57, 0x57, 0x57, 0x57, 0x27 }, + .cti_delay = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .sub_saturation = { 0xdf, 0xe0, 0xe0, 0xe0, 0xa0, 0x80 }, + .burst_dec_a = { 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a }, + .burst_dec_b = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .burst_dec_c = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .c_option = { 0x80, 0x80, 0x80, 0xa0, 0xb0, 0xb0 }, + .y_filter_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .y_filter_b_sel = { 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e }, + }, + /* timing_a */ + { + .h_delay_a = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, + .h_delay_b = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .h_delay_c = { 0x03, 0x03, 0x03, 0x02, 0x03, 0x03 }, + .y_delay = { 0x07, 0x07, 0x07, 0x05, 0x20, 0x20 }, + }, + /* clock */ + { + .clk_adc = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .clk_dec = { 0x44, 0x44, 0x44, 0x44, 0x44, 0x44 }, + }, + /* timing_b */ + { + .h_scaler1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .h_scaler2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .h_scaler9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .pn_auto = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .comb_mode = { 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 }, + .h_pll_op_a = { 0x72, 0x72, 0x72, 0x72, 0x72, 0x72 }, + .mem_path = { 0x00, 0x00, 0x00, 0x10, 0x10, 0x10 }, + .fsc_lock_speed = { 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc }, + .format_set1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .format_set2 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .vblk_end = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + }, + }, + + + + + + [ AHD20_1080P_30P_DIFFERENTIAL ] = /* o */ + { + .name = "AHD20_1080P_30P_DIFFERENTIAL", + .video_fmt = AHD20_1080P_30P, + .analog_input = DIFFERENTIAL, + + }, +}; + + + + +#endif /* EXTDRV_JAGUAR1_VIDEO_INPUT_TABLE_H_ */ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.c b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.c new file mode 100644 index 000000000000..eabfff9491e4 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.c @@ -0,0 +1,1677 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : coax_protocol.c + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#include +#include +#include +#include "jaguar1_common.h" +#include "jaguar1_coax_table.h" +#include "jaguar1_coax_protocol.h" +#include "jaguar1_video.h" + +extern unsigned int acp_mode_enable; + +/*======================================================================================================= + ******************************************************************************************************** + **************************** Coaxial protocol up stream function *************************************** + ******************************************************************************************************** + * Coaxial protocol up stream Flow + * 1. Up stream initialize - coax_tx_init + * 2. Fill upstream data & Send - coax_tx_cmd_send + * + * Coaxial protocol up stream register(example: channel 0) + * (3x00) tx_baud : 1 bit duty + * (3x02) tx_pel_baud : 1 bit duty of pelco(SD) + * (3x03) tx_line_pos0 : up stream line position(low) + * (3x04) tx_line_pos1 : up stream line position(high) + * (3x05) tx_line_count : up stream output line number in 1 frame + * (3x07) tx_pel_line_pos0 : up stream line position of pelco(low) + * (3x08) tx_pel_line_pos1 : up stream line position of pelco(high) + * (3x0A) tx_line_count_max : up stream output total line + * (3x0B) tx_mode : up stream Mode set (ACP, CCP, TCP) + * (3x0D) tx_sync_pos0 : up stream sync start position(low) + * (3x0E) tx_sync_pos1 : up stream sync start position(high) + * (3x2F) tx_even : up stream SD..Interlace + * (3x0C) tx_zero_length : Only CVI 4M + ========================================================================================================*/ +static NC_VIVO_CH_FORMATDEF g_coax_format; + + +/************************************************************************************** + * @desc + * JAGUAR1's This function initializes the register associated with the UP Stream.. + * + * @param_in (NC_VD_COAX_Tx_Init_STR *)coax_tx_mode UP Stream Initialize structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TX_INIT + ***************************************************************************************/ +static NC_VD_ACP_CMDDEF_STR *__NC_VD_ACP_Get_CommandFormat_Get( NC_COAX_CMD_DEF def ) +{ + NC_VD_ACP_CMDDEF_STR *pRet = &coax_cmd_lists[def]; + if( pRet == NULL ) + { + printk("Not Supported format Yet!!!(%d)\n",def); + } + return pRet; +} + +static NC_VD_COAX_Init_STR *__NC_VD_COAX_InitFormat_Get( NC_VIVO_CH_FORMATDEF def ) +{ + NC_VD_COAX_Init_STR *pRet = &coax_init_lists[def]; + if( pRet == NULL ) + { + printk("Not Supported format Yet!!!(%d)\n",def); + } + return pRet; +} + +static NC_VD_COAX_Init_STR *__NC_VD_COAX_16bit_InitFormat_Get( NC_VIVO_CH_FORMATDEF def ) +{ + NC_VD_COAX_Init_STR *pRet = &coax_acp_16bit_init_lists[def]; + if( pRet == NULL ) + { + printk("Not Supported format Yet!!!(%d)\n",def); + } + return pRet; +} + +static int __NC_VD_COAX_Command_Each_Copy( unsigned char *Dst, int *Src ) +{ + int items = 0; + + while( Src[items] != EOD ) + { + Dst[items] = Src[items]; + items++; + } + + return items; +} + +static int __NC_VD_COAX_Command_Copy( NC_FORMAT_STANDARD format, NC_VIVO_CH_FORMATDEF vivofmt, unsigned char *Dst, NC_VD_ACP_CMDDEF_STR *pCMD ) +{ + int cmd_cnt = 0; + + if( format == FMT_SD ) + { + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->sd ); + } + else if( (format == FMT_AHD20) || (format == FMT_AHD30) ) + { + if( vivofmt == AHD30_5M_20P || vivofmt == AHD30_5M_12_5P || vivofmt == AHD30_5_3M_20P ) + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->ahd_4_5m ); + else if( vivofmt == AHD30_4M_30P || vivofmt == AHD30_4M_25P || vivofmt == AHD30_4M_15P ) + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->ahd_4_5m ); + else + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->ahd_8bit ); + } + else if( format == FMT_CVI ) + { + cmd_cnt= __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->cvi_cmd ); + } + else if( format == FMT_TVI ) + { + if( (vivofmt == TVI_4M_30P) || (vivofmt == TVI_4M_25P) || (vivofmt == TVI_4M_15P) ) + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->tvi_v2_0 ); + else + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->tvi_v1_0 ); + } + else + printk("NC_VD_COAX_Tx_Command_Send::Command Copy Error!!\n"); + + + return cmd_cnt; +} + +static int __NC_VD_COAX_16bit_Command_Copy( NC_FORMAT_STANDARD format, NC_VIVO_CH_FORMATDEF vivofmt, unsigned char *Dst, NC_VD_ACP_CMDDEF_STR *pCMD ) +{ + int cmd_cnt = 0; + + if( (vivofmt == AHD20_720P_25P) || (vivofmt == AHD20_720P_30P) ||\ + (vivofmt == AHD20_720P_25P_EX) || (vivofmt == AHD20_720P_30P_EX) ||\ + (vivofmt == AHD20_720P_25P_EX_Btype) || (vivofmt == AHD20_720P_30P_EX_Btype) ) + { + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->ahd_16bit ); + } + else if( (vivofmt == CVI_4M_25P) || (vivofmt == CVI_4M_30P) ||\ + (vivofmt == CVI_8M_15P) || (vivofmt == CVI_8M_12_5P) ) + { + cmd_cnt = __NC_VD_COAX_Command_Each_Copy( Dst, pCMD->cvi_new_cmd ); + } + else + { + printk("[drv_coax] Can not send commands!! Unsupported format!!\n" ); + return 0; + } + + return cmd_cnt; +} + +/************************************************************************************** + * @desc + * JAGUAR1's This function initializes the register associated with the UP Stream.. + * + * @param_in (NC_VD_COAX_Tx_Init_STR *)coax_tx_mode UP Stream Initialize structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TX_INIT + ***************************************************************************************/ +void coax_tx_init( void *p_param ) +{ + NC_VD_COAX_STR *coax_tx = (NC_VD_COAX_STR*)p_param; + NC_VD_COAX_Init_STR *CoaxVal = __NC_VD_COAX_InitFormat_Get( coax_tx->vivo_fmt ); + + int ch = coax_tx->ch; + unsigned char distance = 0; + + g_coax_format = coax_tx->vivo_fmt; + printk("[drv_coax]ch::%d >>> fmt::%s\n", ch, CoaxVal->name ); + +#if 0 + // Cable distance check + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->devnum], 0xFF, 0x13); // BANK 13 + distance = gpio_i2c_read(jaguar1_i2c_addr[coax_tx->devnum], (0xA0+ch)); // 0:short, 1:100m, 2:200m, 3:300m, 4:400m, 5:500m, 0x0F:Unknown + + distance = distance&0x0F; + if(distance == 0x0F) + { + printk("DRV::Cable distance Unknown!!\n"); + distance = 0; + } + else + printk("DRV::Cable distance(%x)\n", distance); +#endif + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x01); // BANK 1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA8, 0x00); // MPP_TST_SEL1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA9, 0x00); // MPP_TST_SEL2 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAA, 0x00); // MPP_TST_SEL3 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAB, 0x00); // MPP_TST_SEL4 + + // Coaxial each mode set + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2)); // BANK 2, 3 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7C+((ch%2)*0x80), CoaxVal->rx_src); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7D+((ch%2)*0x80), CoaxVal->rx_slice_lev); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x00+((ch%2)*0x80), CoaxVal->tx_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x02+((ch%2)*0x80), CoaxVal->tx_pel_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x03+((ch%2)*0x80), CoaxVal->tx_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x04+((ch%2)*0x80), CoaxVal->tx_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x05+((ch%2)*0x80), CoaxVal->tx_line_count); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x07+((ch%2)*0x80), CoaxVal->tx_pel_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x08+((ch%2)*0x80), CoaxVal->tx_pel_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0A+((ch%2)*0x80), CoaxVal->tx_line_count_max); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0B+((ch%2)*0x80), CoaxVal->tx_mode); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0D+((ch%2)*0x80), CoaxVal->tx_sync_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0E + ((ch%2)*0x80), CoaxVal->tx_sync_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x2F+((ch%2)*0x80), CoaxVal->tx_even); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0C+((ch%2)*0x80), CoaxVal->tx_zero_length); + +#if 0 + // MPP Coaxial mode select Ch1~4 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x01); // BANK 1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA8, 0x08); // MPP_TST_SEL1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA9, 0x09); // MPP_TST_SEL2 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAA, 0x0A); // MPP_TST_SEL3 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAB, 0x0B); // MPP_TST_SEL4 + + // Coaxial each mode set + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x05+ch%4); // BANK 5 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x2F, 0x00); // MPP_H_INV, MPP_V_INV, MPP_F_INV + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x30, 0xE0); // MPP_H_S[7~4], MPP_H_E[3:0] + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x31, 0x43); // MPP_H_S[7:0] + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x32, 0xA2); // MPP_H_E[7:0] + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7C, CoaxVal->rx_src); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7D, CoaxVal->rx_slice_lev); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x00+((ch%2)*0x80), CoaxVal->tx_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x02+((ch%2)*0x80), CoaxVal->tx_pel_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x03+((ch%2)*0x80), CoaxVal->tx_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x04+((ch%2)*0x80), CoaxVal->tx_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x05+((ch%2)*0x80), CoaxVal->tx_line_count); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x07+((ch%2)*0x80), CoaxVal->tx_pel_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x08+((ch%2)*0x80), CoaxVal->tx_pel_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0A+((ch%2)*0x80), CoaxVal->tx_line_count_max); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0B+((ch%2)*0x80), CoaxVal->tx_mode); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0D+((ch%2)*0x80), CoaxVal->tx_sync_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0E + ((ch%2)*0x80), CoaxVal->tx_sync_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x2F+((ch%2)*0x80), CoaxVal->tx_even); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0C+((ch%2)*0x80), CoaxVal->tx_zero_length); +#endif + +#if DBG_TX_INIT_PRINT + printk("[drv]tx_src: 5x7C>> 0x%02X\n", CoaxVal->rx_src ); + printk("[drv]tx_slice_lev: 5x7D>> 0x%02X\n", CoaxVal->rx_slice_lev ); + printk("[drv]tx_pel_baud: 3x02>> 0x%02X\n", CoaxVal->tx_baud[distance] ); + printk("[drv]tx_pel_line_pos0: 3x07>> 0x%02X\n", CoaxVal->tx_pel_line_pos0[distance] ); + printk("[drv]tx_pel_line_pos1: 3x08>> 0x%02X\n", CoaxVal->tx_pel_line_pos1[distance] ); + printk("[drv]tx_mode: 3x0B>> 0x%02X\n", CoaxVal->tx_mode ); + printk("[drv]tx_baud: 3x00>> 0x%02X\n", CoaxVal->tx_baud[distance]); + printk("[drv]tx_line_pos0: 3x03>> 0x%02X\n", CoaxVal->tx_line_pos0[distance] ); + printk("[drv]tx_line_pos1: 3x04>> 0x%02X\n", CoaxVal->tx_line_pos1[distance] ); + printk("[drv]tx_line_count: 3x05>> 0x%02X\n", CoaxVal->tx_line_count ); + printk("[drv]tx_line_count_max: 3x0A>> 0x%02X\n", CoaxVal->tx_line_count_max ); + printk("[drv]tx_sync_pos0: 3x0D>> 0x%02X\n", CoaxVal->tx_sync_pos0[distance] ); + printk("[drv]tx_sync_pos1: 3x0E>> 0x%02X\n", CoaxVal->tx_sync_pos1[distance] ); + printk("[drv]tx_even: 3x2F>> 0x%02X\n", CoaxVal->tx_even ); + printk("[drv]tx_zero_length: 3x0C>> 0x%02X\n", CoaxVal->tx_zero_length); +#endif + +} + +/************************************************************************************** + * @desc + * JAGUAR1's This function initializes the register associated with the UP Stream.. + * + * @param_in (NC_VD_COAX_Tx_Init_STR *)coax_tx_mode UP Stream Initialize structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TX_INIT + ***************************************************************************************/ +void coax_tx_16bit_init( void *p_param ) +{ + NC_VD_COAX_STR *coax_tx = (NC_VD_COAX_STR*)p_param; + NC_VD_COAX_Init_STR *CoaxVal; + + int ch = coax_tx->ch; + int fmt = coax_tx->vivo_fmt; + unsigned char distance = 0; + + if( (fmt == AHD20_720P_25P) || (fmt == AHD20_720P_30P) ||\ + (fmt == AHD20_720P_25P_EX) || (fmt == AHD20_720P_30P_EX) ||\ + (fmt == AHD20_720P_25P_EX_Btype) || (fmt == AHD20_720P_30P_EX_Btype)\ + ) + { + printk("[drv_coax]Ch: %d ACP 16bit initialize!!!\n", ch ); + } + else if( (fmt == CVI_4M_25P) || (fmt == CVI_4M_30P) ||\ + (fmt == CVI_8M_15P) || (fmt == CVI_8M_12_5P) ) + { + printk("[drv_coax]Ch: %d CVI New Protocol initialize!!!\n", ch ); + } + else + { + printk("[drv_coax]Ch: %d Can not initialize!! Unsupported format!!\n", ch ); + return; + } + + CoaxVal = __NC_VD_COAX_16bit_InitFormat_Get( coax_tx->vivo_fmt ); + printk("[drv_coax]Ch: %d Format >>>>> %s\n", ch, CoaxVal->name ); + +#if 0 + // Cable distance check + gpio_i2c_write(jaguar1_i2c_addr[chip_num], 0xFF, 0x13); // BANK 13 + distance = gpio_i2c_read(jaguar1_i2c_addr[chip_num], (0xA0+ch)); // 0:short, 1:100m, 2:200m, 3:300m, 4:400m, 5:500m, 0x0F:Unknown + + distance = distance&0x0F; + if(distance == 0x0F) + { + printk("DRV::Cable distance Unknown!!\n"); + distance = 0; + } + else + printk("DRV::Cable distance(%x)\n", distance); +#endif + + // MPP Coaxial mode select Ch1~4 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x01); // BANK 1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA8, 0x00); // MPP_TST_SEL1 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xA9, 0x00); // MPP_TST_SEL2 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAA, 0x00); // MPP_TST_SEL3 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xAB, 0x00); // MPP_TST_SEL4 + + // Coaxial each mode set + //gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x05+ch%4); // BANK 5 + //gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x2F, 0x00); // MPP_H_INV, MPP_V_INV, MPP_F_INV + //gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x30, 0xE0); // MPP_H_S[7~4], MPP_H_E[3:0] + //gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x31, 0x43); // MPP_H_S[7:0] + //gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x32, 0xA2); // MPP_H_E[7:0] + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2)); // BANK 2, 3 + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7C, CoaxVal->rx_src); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x7D, CoaxVal->rx_slice_lev); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x00+((ch%2)*0x80), CoaxVal->tx_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x02+((ch%2)*0x80), CoaxVal->tx_pel_baud[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x03+((ch%2)*0x80), CoaxVal->tx_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x04+((ch%2)*0x80), CoaxVal->tx_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x05+((ch%2)*0x80), CoaxVal->tx_line_count); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x07+((ch%2)*0x80), CoaxVal->tx_pel_line_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x08+((ch%2)*0x80), CoaxVal->tx_pel_line_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0A+((ch%2)*0x80), CoaxVal->tx_line_count_max); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0B+((ch%2)*0x80), CoaxVal->tx_mode); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0D+((ch%2)*0x80), CoaxVal->tx_sync_pos0[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0E + ((ch%2)*0x80), CoaxVal->tx_sync_pos1[distance]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x2F+((ch%2)*0x80), CoaxVal->tx_even); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0C+((ch%2)*0x80), CoaxVal->tx_zero_length); + +#if DBG_TX_INIT_PRINT + printk("[drv]tx_src: 5x7C>> 0x%02X\n", CoaxVal->rx_src ); + printk("[drv]tx_slice_lev: 5x7D>> 0x%02X\n", CoaxVal->rx_slice_lev ); + printk("[drv]tx_pel_baud: 3x02>> 0x%02X\n", CoaxVal->tx_baud[distance] ); + printk("[drv]tx_pel_line_pos0: 3x07>> 0x%02X\n", CoaxVal->tx_pel_line_pos0[distance] ); + printk("[drv]tx_pel_line_pos1: 3x08>> 0x%02X\n", CoaxVal->tx_pel_line_pos1[distance] ); + printk("[drv]tx_mode: 3x0B>> 0x%02X\n", CoaxVal->tx_mode ); + printk("[drv]tx_baud: 3x00>> 0x%02X\n", CoaxVal->tx_baud[distance]); + printk("[drv]tx_line_pos0: 3x03>> 0x%02X\n", CoaxVal->tx_line_pos0[distance] ); + printk("[drv]tx_line_pos1: 3x04>> 0x%02X\n", CoaxVal->tx_line_pos1[distance] ); + printk("[drv]tx_line_count: 3x05>> 0x%02X\n", CoaxVal->tx_line_count ); + printk("[drv]tx_line_count_max: 3x0A>> 0x%02X\n", CoaxVal->tx_line_count_max ); + printk("[drv]tx_sync_pos0: 3x0D>> 0x%02X\n", CoaxVal->tx_sync_pos0[distance] ); + printk("[drv]tx_sync_pos1: 3x0E>> 0x%02X\n", CoaxVal->tx_sync_pos1[distance] ); + printk("[drv]tx_even: 3x2F>> 0x%02X\n", CoaxVal->tx_even ); + printk("[drv]tx_zero_length: 3x0C>> 0x%02X\n", CoaxVal->tx_zero_length); +#endif + +} + +/************************************************************************************** + * @desc + * JAGUAR1's Send UP Stream command. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode UP Stream Command structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TX_CMD_SEND + ***************************************************************************************/ +void coax_tx_cmd_send( void *p_param ) +{ + NC_VD_COAX_STR *coax_tx = (NC_VD_COAX_STR*)p_param; + int i; + int cmd_cnt = 0; + unsigned char ch = coax_tx->ch; + NC_COAX_CMD_DEF cmd = coax_tx->cmd; + NC_FORMAT_STANDARD format = coax_tx->format_standard; + NC_VIVO_CH_FORMATDEF vivofmt = coax_tx->vivo_fmt; + + unsigned char tx_bank = 0x00; + unsigned char tx_cmd_addr = 0x00; + unsigned char tx_shot_addr = 0x00; + unsigned char command[32] = {0,}; + unsigned char TCP_CMD_Stop_v10[10] = { 0xb5, 0x00, 0x14, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc9, 0x80 }; + unsigned char TCP_CMD_Stop_v20[10] = { 0xb5, 0x01, 0x14, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc5, 0x80 }; + + // UP Stream get from coax table + NC_VD_COAX_Init_STR *CoaxVal = __NC_VD_COAX_InitFormat_Get(vivofmt); // Get from Coax_Tx_Init Table + NC_VD_ACP_CMDDEF_STR *pCMD = __NC_VD_ACP_Get_CommandFormat_Get(cmd); // Get From Coax_Tx_Command Table + printk("[drv_coax]Ch: %d Command >>>>> %s\n", ch, pCMD->name ); + + tx_bank = CoaxVal->tx_bank; + tx_cmd_addr = CoaxVal->tx_cmd_addr; + tx_shot_addr = CoaxVal->tx_shot_addr; + + // UP Stream command copy in coax command table + cmd_cnt = __NC_VD_COAX_Command_Copy( format, vivofmt, command, pCMD ); + // printk("cmd_cnt: %d\n", cmd_cnt); + + // fill command + shot + if( format == FMT_SD ) + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+((ch%4)/2) ); + for(i=0;ivd_dev], (tx_cmd_addr+((ch%2)*0x80))+i, 0); + } + // Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + msleep(CoaxVal->shot_delay); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); + + msleep(CoaxVal->reset_delay); + + for(i=0;ivd_dev], (tx_cmd_addr+((ch%2)*0x80))+i, command[i]); + } + // Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + msleep(CoaxVal->shot_delay); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); + } + else if(format == FMT_CVI) + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+(ch%4)); + for(i=0;ivd_dev], tx_cmd_addr+i, command[i]); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x10+i, 0xff); + } + + // Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+((ch%4)/2) ); + for(i=0;ivd_dev], (tx_cmd_addr+((ch%2)*0x80))+i, command[i]); + } + + // Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); + } + + // Only TVI >>> OSD Stop Command Send + if( format == FMT_TVI ) + { + msleep(30); + if( (vivofmt == TVI_4M_30P) || (vivofmt == TVI_4M_25P) || (vivofmt == TVI_4M_15P) ) + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+((ch%4)/2)); + for(i=0;i<10;i++) + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_cmd_addr+((ch%2)*0x80)+i, TCP_CMD_Stop_v20[i]); + } + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+((ch%4)/2)); + for(i=0;i<10;i++) + { + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_cmd_addr+((ch%2)*0x80)+i, TCP_CMD_Stop_v10[i]); + } + } + + // shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); + } +} + +/************************************************************************************** + * @desc + * JAGUAR1's Send UP Stream command. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode UP Stream Command structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TX_CMD_SEND + ***************************************************************************************/ +void coax_tx_16bit_cmd_send( void *p_param ) +{ + NC_VD_COAX_STR *coax_tx = (NC_VD_COAX_STR*)p_param; + int i; + int cmd_cnt = 0; + unsigned char ch = coax_tx->ch; + NC_COAX_CMD_DEF cmd = coax_tx->cmd; + NC_FORMAT_STANDARD format = coax_tx->format_standard; + NC_VIVO_CH_FORMATDEF vivofmt = coax_tx->vivo_fmt; + + unsigned char tx_bank = 0x00; + unsigned char tx_cmd_addr = 0x00; + unsigned char tx_shot_addr = 0x00; + unsigned char command[32] ={0,}; + + // UP Stream get from coax table + NC_VD_COAX_Init_STR *CoaxVal = __NC_VD_COAX_InitFormat_Get(vivofmt); // Get from Coax_Tx_Init Table + NC_VD_ACP_CMDDEF_STR *pCMD = __NC_VD_ACP_Get_CommandFormat_Get(cmd); // Get From Coax_Tx_Command Table + printk("[drv_coax]Ch: %d 16bit Command >>>>> %s\n", ch, pCMD->name ); + + tx_bank = CoaxVal->tx_bank; + tx_cmd_addr = CoaxVal->tx_cmd_addr; + tx_shot_addr = CoaxVal->tx_shot_addr; + + // UP Stream command copy in coax command table + cmd_cnt = __NC_VD_COAX_16bit_Command_Copy( format, vivofmt, command, pCMD ); + + // Adjust Bank + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + + // fill Reset + for(i=0;ivd_dev], 0x20+((ch%2)*0x80)+i, 0); + } + + // Command Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0c+((ch%2)*0x80), 0x01); + msleep(30); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0c+((ch%2)*0x80), 0x00); + + + // fill command + for(i=0;ivd_dev], 0x20+((ch%2)*0x80)+i, command[i]); + } + + // Command Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0c+((ch%2)*0x80), 0x01); + msleep(30); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0x0c+((ch%2)*0x80), 0x00); + +} + +void coax_tx_cvi_new_cmd_send( void *p_param ) +{ + NC_VD_COAX_STR *coax_tx = (NC_VD_COAX_STR*)p_param; + int i; + int cmd_cnt = 0; + // unsigned char vd_dev = coax_tx->vd_dev; + unsigned char ch = coax_tx->ch; + NC_COAX_CMD_DEF cmd = coax_tx->cmd; + NC_FORMAT_STANDARD format = coax_tx->format_standard; + NC_VIVO_CH_FORMATDEF vivofmt = coax_tx->vivo_fmt; + + unsigned char tx_bank = 0x00; + unsigned char tx_cmd_addr = 0x00; + unsigned char tx_shot_addr = 0x00; + unsigned char command[32] ={0,}; + + // UP Stream get from coax table + NC_VD_COAX_Init_STR *CoaxVal = __NC_VD_COAX_InitFormat_Get(vivofmt); // Get from Coax_Tx_Init Table + NC_VD_ACP_CMDDEF_STR *pCMD = __NC_VD_ACP_Get_CommandFormat_Get(cmd); // Get From Coax_Tx_Command Table + printk("[drv_coax]Ch: %d Command >>>>> %s\n", ch, pCMD->name ); + + tx_bank = CoaxVal->tx_bank; + tx_cmd_addr = CoaxVal->tx_cmd_addr; + tx_shot_addr = CoaxVal->tx_shot_addr; + + // UP Stream command copy in coax command table + cmd_cnt = __NC_VD_COAX_16bit_Command_Copy( format, vivofmt, command, pCMD ); + + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, tx_bank+(ch%4)); + for(i=0;ivd_dev], tx_cmd_addr+i, command[i]); + } + + // Shot + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[coax_tx->vd_dev], tx_shot_addr+((ch%2)*0x80), 0x00); +} + +/*======================================================================================================= + ******************************************************************************************************** + **************************** Coaxial protocol down stream function ************************************* + ******************************************************************************************************** + * + * Coaxial protocol down stream Flow + * 1. Down stream initialize - coax_rx_init + * 2. Down stream data read - coax_rx_data_get + * + * Coaxial protocol down stream register(example: channel 0) + * (3x63) rx_comm_on : Coaxial Down Stream Mode ON/OFF ( 0: OFF / 1: ON ) + * (3x62) rx_area : Down Stream Read Line Number + * (3x66) rx_signal_enhance : Signal Enhance ON/OFF ( 0: OFF / 1: ON ) + * (3x69) rx_manual_duty : 1 Bit Duty Setting ( HD@25, 30P 0x32 / HD@50, 60P, FHD@25, 30P 0x64 ) + * (3x60) rx_head_matching : Same Header Read (EX. 0x48) + * (3x61) rx_data_rz : The lower 2 bits set Coax Mode.. ( 0 : A-CP ), ( 1 : C-CP ), ( 2 : T-CP ) + * (3x68) rx_sz : Down stream size setting + * (3x3A) : Down stream buffer clear + ========================================================================================================*/ +/************************************************************************************** + * @desc + * JAGUAR1's This function initializes the register associated with the Down Stream. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode Down Stream Initialize structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_RX_INIT + ***************************************************************************************/ +void coax_rx_init(void *p_param) +{ + NC_VD_COAX_STR *coax_rx = (NC_VD_COAX_STR*)p_param; + unsigned char ch = coax_rx->ch; + NC_VIVO_CH_FORMATDEF vivofmt = coax_rx->vivo_fmt; + + NC_VD_COAX_Init_STR *coax_rx_val = __NC_VD_COAX_InitFormat_Get(vivofmt); + + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x63+((ch%2)*0x80), coax_rx_val->rx_comm_on); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x62+((ch%2)*0x80), coax_rx_val->rx_area); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x66+((ch%2)*0x80), coax_rx_val->rx_signal_enhance); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x69+((ch%2)*0x80), coax_rx_val->rx_manual_duty); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x60+((ch%2)*0x80), coax_rx_val->rx_head_matching); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x61+((ch%2)*0x80), coax_rx_val->rx_data_rz); + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0x68+((ch%2)*0x80), coax_rx_val->rx_sz); +#if DBG_RX_INIT_PRINT + printk("[drv]Channel %d Format >>>>> %s\n", ch, coax_rx_val->name ); + printk("[drv]rx_head_matching: 0x60 >> 0x%02X\n", coax_rx_val->rx_head_matching); + printk("[drv]rx_data_rz: 0x61 >> 0x%02X\n", coax_rx_val->rx_data_rz); + printk("[drv]rx_area: 0x62 >> 0x%02X\n", coax_rx_val->rx_area); + printk("[drv]rx_comm_on: 0x63 >> 0x%02X\n", coax_rx_val->rx_comm_on ); + printk("[drv]rx_signal_enhance: 0x66 >> 0x%02X\n", coax_rx_val->rx_signal_enhance); + printk("[drv]rx_sz: 0x68 >> 0x%02X\n", coax_rx_val->rx_sz); + printk("[drv]rx_manual_duty: 0x69 >> 0x%02X\n", coax_rx_val->rx_manual_duty); +#endif + +} + +/************************************************************************************** + * @desc + * JAGUAR1's Read down stream data. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode Down Stream read structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_RX_DATA_READ + ***************************************************************************************/ +void coax_rx_data_get(void *p_param) +{ + NC_VD_COAX_STR *coax_rx = (NC_VD_COAX_STR*)p_param; + + int ii = 0; + int ch = coax_rx->ch; + int format = coax_rx->format_standard; + + gpio_i2c_write(jaguar1_i2c_addr[coax_rx->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + if( (format == FMT_CVI) || (format == FMT_TVI) ) + { + for(ii=0;ii<5;ii++) + { + coax_rx->rx_data1[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x40+((ch%2)*0x80))+ii); // ChX_Rx_Line_1 : 0x40 ~ 0x44 5byte + coax_rx->rx_data2[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x45+((ch%2)*0x80))+ii); // ChX_Rx_Line_2 : 0x45 ~ 0x49 5byte + coax_rx->rx_data3[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x4A+((ch%2)*0x80))+ii); // ChX_Rx_Line_3 : 0x4A ~ 0x4E 5byte + coax_rx->rx_data4[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x6C+((ch%2)*0x80))+ii); // ChX_Rx_Line_4 : 0x6C ~ 0x70 5byte + coax_rx->rx_data5[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x71+((ch%2)*0x80))+ii); // ChX_Rx_Line_5 : 0x71 ~ 0x75 5byte + coax_rx->rx_data6[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x76+((ch%2)*0x80))+ii); // ChX_Rx_Line_6 : 0x76 ~ 0x7A 5byte + } + } + else // AHD + { + for(ii=0;ii<8;ii++) + { + coax_rx->rx_pelco_data[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_rx->vd_dev], (0x50+((ch%2)*0x80))+ii); // ChX_PELCO_Rx_Line_1 ~ 8 : 0x50 ~ 0x57 8byte + } + } +} + +/************************************************************************************** + * @desc + * JAGUAR1's Down stream buffer clear. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode UP Stream Command structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_RX_BUF_CLEAR + ***************************************************************************************/ +void coax_rx_buffer_clear(void *p_param) +{ + NC_VD_COAX_STR *coax_val = (NC_VD_COAX_STR*)p_param; + + unsigned char ch = coax_val->ch; + + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0x3A+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0x3A+((ch%2)*0x80), 0x00); +} + +/************************************************************************************** + * @desc + * JAGUAR1's Down stream mode off. + * + * @param_in (NC_VD_COAX_SET_STR *)coax_tx_mode UP Stream Command structure + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_RX_DEINIT + ***************************************************************************************/ +void coax_rx_deinit(void *p_param) +{ + NC_VD_COAX_STR *coax_val = (NC_VD_COAX_STR*)p_param; + + unsigned char ch = coax_val->ch; + + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0x63+((ch%2)*0x80), 0); +} + +/*======================================================================================================= + ******************************************************************************************************** + ************************** Coaxial protocol firmware upgrade function ********************************** + ******************************************************************************************************** + * + * Coaxial protocol firmware upgrade Flow + * 1. ACP Check - Down Stream Header 0x55 - coax_fw_ready_header_check_from_isp_recv + * 2.1 FW ready send - coax_fw_ready_cmd_to_isp_send + * 2.2 FW ready ACK receive - coax_fw_ready_cmd_ack_from_isp_recv + * 3.1 FW start send - coax_fw_start_cmd_to_isp_send + * 3.2 FW start ACK receive - coax_fw_start_cmd_ack_from_isp_recv + * 4.1 FW data send - 139byte - coax_fw_one_packet_data_to_isp_send + * 4.2 FW data ACK receive - offset - coax_fw_one_packet_data_ack_from_isp_recv + * 5.1 FW end send - coax_fw_end_cmd_to_isp_send + * 5.2 FW end ACK receive - coax_fw_end_cmd_ack_from_isp_recv + ========================================================================================================*/ + +/************************************************************************************** + * @desc + * JAGUAR1's Down stream check header value.(AHD : 0x55) + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Header check result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_ACP_HEADER_GET + ***************************************************************************************/ +void coax_fw_ready_header_check_from_isp_recv(void *p_param) +{ + int ret = FW_FAILURE; + int ch = 0; + int devnum = 0; + unsigned char readval = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + /* set register */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x50+((ch%2)*0x80), 0x05 ); // PELCO Down Stream Read 1st Line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x60+((ch%2)*0x80), 0x55 ); // Header Matching + + /* If the header is (0x50=>0x55) and chip information is (0x51=>0x3X, 0x4X, 0x5X ), it can update firmware */ + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x50+((ch%2)*0x80) ) == 0x55 ) + { + printk(">>>>> DRV[%s:%d] CH:%d, this camera can update, please, wait! = 0x%x\n", __func__, __LINE__, ch, gpio_i2c_read( jaguar1_i2c_addr[ch/4], 0x51+((ch%2)*0x80) ) ); + ret = FW_SUCCESS; + } + else + { + readval= gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x50+((ch%2)*0x80) ); + printk(">>>>> DRV[%s:%d] check ACP_STATUS_MODE::0x%x\n", __func__, __LINE__, readval ); + ret = FW_FAILURE; + } + + pstFileInfo->result = ret; +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW Ready command send to camera ( Mode change to FHD@25P ) + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->cp_mode Camera Format + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_READY_CMD_SET + ***************************************************************************************/ +void coax_fw_ready_cmd_to_isp_send(void *p_param) // FW Ready +{ + int ch = 0; + int devnum = 0; + int ret = FW_FAILURE; + int cp_mode = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + ch = pstFileInfo->channel; + cp_mode = pstFileInfo->cp_mode; + devnum = pstFileInfo->channel/4; + + /* Adjust Tx */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x0A+((ch%2)*0x80), 0x04); // Tx Line count max + + /* change video mode FHD@25P Command Send */ + if( (cp_mode == FMT_AHD20) || (cp_mode == FMT_AHD30) ) + { + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x10+((ch%2)*0x80), 0x60); // Register Write Control - 17th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x11+((ch%2)*0x80), 0xB0); // table(Mode Change Command) - 18th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x12+((ch%2)*0x80), 0x02); // Flash Update Mode(big data) - 19th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x13+((ch%2)*0x80), 0x02); // Init Value(FW Information Check Mode) - 20th line + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x08); // trigger on + msleep(200); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x10); // reset + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x00); // trigger Off + printk(">>>>> DRV[%s:%d] CH:%d, coax_fw_ready_cmd_to_isp_send!!- AHD\n", __func__, __LINE__, ch ); + ret = FW_SUCCESS; + } + else if( (cp_mode == FMT_CVI) || (cp_mode == FMT_TVI) ) + { + /* change video mode FHD@25P Command Send */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x10+((ch%2)*0x80), 0x55); // 0x55(header) - 16th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x11+((ch%2)*0x80), 0x60); // Register Write Control - 17th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x12+((ch%2)*0x80), 0xB0); // table(Mode Change Command) - 18th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x13+((ch%2)*0x80), 0x02); // Flash Update Mode - 19th line + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x14+((ch%2)*0x80), 0x00); // Init Value(FW Information Check Mode) - 20th line + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x08); // trigger on + msleep(1000); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x10); // reset + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x00); // trigger Off + printk(">>>>> DRV[%s:%d] CH:%d, coax_fw_ready_cmd_to_isp_send!!- AHD\n", __func__, __LINE__, ch ); + ret = FW_SUCCESS; + } + else + { + printk(">>>> DRV[%s:%d] CH:%d, FMT:%d > Unknown Format!!! \n", __func__, __LINE__, ch, cp_mode ); + ret = FW_FAILURE; + } + + pstFileInfo->result = ret; +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW Ready ACK receive from camera + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_READY_ACK_GET + ***************************************************************************************/ +void coax_fw_ready_cmd_ack_from_isp_recv(void *p_param) +{ + int ret = FW_FAILURE; + int ch = 0; + int devnum = 0; + unsigned char retval = 0x00; + unsigned char retval2 = 0x00; + static int toggle = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + + /* AHD FHD 25P Video Setting */ + if(!toggle) + { + video_input_init vd_set; + vd_set.ch = ch; + vd_set.format = AHD20_1080P_25P; + vd_set.input = SINGLE_ENDED; + vd_jaguar1_init_set(&vd_set); + toggle =1; + } + + /* Adjust Rx FHD@25P */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x63+((ch%2)*0x80), 0x01 ); // Ch_X Rx ON + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x62+((ch%2)*0x80), 0x05 ); // Ch_X Rx Area + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x66+((ch%2)*0x80), 0x81 ); // Ch_X Rx Signal enhance + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x69+((ch%2)*0x80), 0x2D ); // Ch_X Rx Manual duty + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x60+((ch%2)*0x80), 0x55 ); // Ch_X Rx Header matching + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x61+((ch%2)*0x80), 0x00 ); // Ch_X Rx data_rz + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x68+((ch%2)*0x80), 0x80 ); // Ch_X Rx SZ + + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ) == 0x02 ) + { + /* get status, If the status is 0x00(Camera information), 0x01(Firmware version */ + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ) == 0x00 ) + { + printk(">>>>> DRV[%s:%d]CH:%d Receive ISP status : [READY]\n", __func__, __LINE__, ch ); + ret = FW_SUCCESS; + } + } + else + { + retval = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ); + retval2 = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ); + printk(">>>>> DRV[%s:%d]CH:%d retry : Receive ISP status[READY], [0x56-true[0x00]:0x%x], [0x57-true[0x02]:0x%x]\n", __func__, __LINE__, ch, retval, retval2 ); + ret = FW_FAILURE; + } + + /* Rx Buffer clear */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3A+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3A+((ch%2)*0x80), 0x00); + + pstFileInfo->result = ret; +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW start command send to camera ( change to black pattern ) + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->cp_mode Camera Format + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_START_CMD_SET + ***************************************************************************************/ +void coax_fw_start_cmd_to_isp_send(void *p_param) +{ + int ch = 0; + int devnum = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + /* Adjust Tx */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x00+((ch%2)*0x80), 0x2D); // Duty + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x03+((ch%2)*0x80), 0x0D); // line + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x05+((ch%2)*0x80), 0x03); // tx_line_count + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x0A+((ch%2)*0x80), 0x04); // tx_line_count_max + + // Tx Command set + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x10+((ch%2)*0x80), 0x60); // Register Write Control - 17th line + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x11+((ch%2)*0x80), 0xB0); // table(Mode Change Command) - 18th line + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x12+((ch%2)*0x80), 0x02); // Flash Update Mode(big data) - 19th line + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x13+((ch%2)*0x80), 0x40); // Start firmware update - 20th line + + // Tx Command Shot + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x08); // trigger on + msleep(200); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x10); // reset + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x00); // trigger Off + + printk(">>>>> DRV[%s:%d]CH:%d >> Send command[START]\n", __func__, __LINE__, ch ); + +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW Start ACK receive from camera + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->cp_mode Camera Format + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_START_ACK_GET + ***************************************************************************************/ +void coax_fw_start_cmd_ack_from_isp_recv( void *p_param ) +{ + int ch = 0; + int devnum = 0; + int ret = FW_FAILURE; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + /* Adjust Rx FHD@25P */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x63+((ch%2)*0x80), 0x01 ); // Ch_X Rx ON + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x62+((ch%2)*0x80), 0x05 ); // Ch_X Rx Area + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x66+((ch%2)*0x80), 0x81 ); // Ch_X Rx Signal enhance + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x69+((ch%2)*0x80), 0x2D ); // Ch_X Rx Manual duty + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x60+((ch%2)*0x80), 0x55 ); // Ch_X Rx Header matching + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x61+((ch%2)*0x80), 0x00 ); // Ch_X Rx data_rz + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x68+((ch%2)*0x80), 0x80 ); // Ch_X Rx SZ + + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ) == 0x02 ) + { + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ) == 0x02 ) + { + printk(">>>>> DRV[%s:%d]CH:%d Receive ISP status : [START]\n", __func__, __LINE__, ch ); + ret = FW_SUCCESS; + } + else + { + unsigned char retval1; + unsigned char retval2; + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + retval1 = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ); + retval2 = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ); + ret = FW_FAILURE; + printk(">>>>> DRV[%s:%d]CH:%d retry : Receive ISP status[START], [0x56-true[0x02]:0x%x], [0x57-true[0x02]:0x%x]\n", __func__, __LINE__, ch, retval1, retval2 ); + } + } + + /* Rx Buffer clear */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3A+((ch%2)*0x80), 0x01); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3A+((ch%2)*0x80), 0x00); + + pstFileInfo->result = ret; +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW Data send to camera(One packet data size 139byte) + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->readsize One packet data size + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->currentFileOffset File offset + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_SEND_DATA_SET + ***************************************************************************************/ +void coax_fw_one_packet_data_to_isp_send( void *p_param ) +{ + int ch = 0; + int devnum = 0; + int ii = 0; + unsigned int low = 0x00; + unsigned int mid = 0x00; + unsigned int high = 0x00; + unsigned int readsize = 0; + int byteNumOfPacket = 0; + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + + /* file information */ + ch = pstFileInfo->channel; + readsize = pstFileInfo->readsize; + devnum = pstFileInfo->channel/4; + + /* fill packet(139bytes), end packet is filled with 0xff */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xff, 0x0c+(ch%4) ); + for( ii = 0; ii < 139; ii++ ) + { + if( byteNumOfPacket < readsize) + { + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x00+ii, pstFileInfo->onepacketbuf[ii] ); + byteNumOfPacket++; + } + else if( byteNumOfPacket >= readsize ) // end packet : fill 0xff + { + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x00+ii, 0xff ); + byteNumOfPacket++; + } + + if( ii == 0 ) + low = pstFileInfo->onepacketbuf[ii]; + else if( ii == 1 ) + mid = pstFileInfo->onepacketbuf[ii]; + else if( ii == 2 ) + high = pstFileInfo->onepacketbuf[ii]; + } + + /* offset */ + pstFileInfo->currentFileOffset = (unsigned int)((high << 16 )&(0xFF0000))| (unsigned int)((mid << 8 )&(0xFF00)) | (unsigned char)(low); + + /* Tx Change mode to use Big data */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x0B+((ch%2)*0x80), 0x30); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x05+((ch%2)*0x80), 0x8A); + + /* Tx Shot */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x08); // trigger on +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW Data ACK receive from camera + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->currentFileOffset File offset + + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_SEND_ACK_GET + ***************************************************************************************/ +void coax_fw_one_packet_data_ack_from_isp_recv( void *p_param ) +{ + int ret = FW_FAILURE; + int ch = 0; + int devnum = 0; + unsigned int onepacketaddr = 0; + unsigned int receive_addr = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + ch = pstFileInfo->channel; + onepacketaddr = pstFileInfo->currentFileOffset; + devnum = pstFileInfo->channel/4; + + /* Adjust Rx FHD@25P */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x63+((ch%2)*0x80), 0x01 ); // Ch_X Rx ON + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x62+((ch%2)*0x80), 0x05 ); // Ch_X Rx Area + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x66+((ch%2)*0x80), 0x81 ); // Ch_X Rx Signal enhance + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x69+((ch%2)*0x80), 0x2D ); // Ch_X Rx Manual duty + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x60+((ch%2)*0x80), 0x55 ); // Ch_X Rx Header matching + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x61+((ch%2)*0x80), 0x00 ); // Ch_X Rx data_rz + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x68+((ch%2)*0x80), 0x70 ); // Ch_X Rx SZ + + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ) == 0x02 ) + { + /* check ISP status - only check first packet */ + if( pstFileInfo->currentpacketnum == 0 ) + { + if( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ) == 0x03 ) + { + pstFileInfo->result = FW_FAILURE; + printk(">>>>> DRV[%s:%d] CH:%d, Failed, error status, code=3..................\n", __func__, __LINE__, ch ); + return; + } + } + + /* check offset */ + receive_addr = (( gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x53+((ch%2)*0x80))<<16) + \ + (gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x54+((ch%2)*0x80))<<8) + + gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x55+((ch%2)*0x80))); + if( onepacketaddr == receive_addr ) + { + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x10); // Reset + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x00); // trigger off + ret = FW_SUCCESS; + pstFileInfo->receive_addr = receive_addr; + pstFileInfo->result = ret; + } + } + + pstFileInfo->result = ret; +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW End command send to camera + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->result FW Data send result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_END_CMD_SET + ***************************************************************************************/ +void coax_fw_end_cmd_to_isp_send(void *p_param) +{ + int ch = 0; + int devnum = 0; + int send_success = 0; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + + ch = pstFileInfo->channel; + send_success = pstFileInfo->result; + devnum = pstFileInfo->channel/4; + + /* adjust Tx line */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x0B+((ch%2)*0x80), 0x10); // Tx_Mode + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x05+((ch%2)*0x80), 0x03); // Tx_Line Count 3 line number + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x0A+((ch%2)*0x80), 0x03); // Tx Total Line Count 3 line number + + /* Fill end command */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x10+((ch%2)*0x80), 0x60); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x11+((ch%2)*0x80), 0xb0); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x12+((ch%2)*0x80), 0x02); + if( send_success == FW_FAILURE ) + { + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x13+((ch%2)*0x80), 0xE0/*0xC0*/); + printk(">>>>> DRV[%s:%d] CH:%d, Camera UPDATE error signal. send Abnormal ending!\n", __func__, __LINE__, ch ); + } + else + { + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x13+((ch%2)*0x80), 0x80/*0x60*/); + printk(">>>>> DVR[%s:%d] CH:%d, Camera UPDATE ending signal. wait please!\n", __func__, __LINE__, ch ); + } + + /* Shot */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x08); + msleep(200); + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0x09+((ch%2)*0x80), 0x00); + +} + +/************************************************************************************** + * @desc + * JAGUAR1's FW End command ACK receive from camera + * + * @param_in (FIRMWARE_UP_FILE_INFO *)p_param->channel FW Update channel + * + * @param_out (FIRMWARE_UP_FILE_INFO *)p_param->result Function execution result + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_FW_END_ACK_GET + ***************************************************************************************/ +void coax_fw_end_cmd_ack_from_isp_recv(void *p_param) +{ + int ch = 0; + int devnum = 0; + + unsigned char videofm = 0x00; + unsigned char ack_return = 0x00; + unsigned char isp_status = 0x00; + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + /* check video format(video loss), 0:videoloss, 1:video on */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x05+(ch%4)); + videofm = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0xF0); + + if( videofm == 0xFF ) + { + printk(">>>>> DRV[%s:%d] Final[CH:%d], No video[END]!\n", __func__, __LINE__, ch ); + pstFileInfo->result = FW_FAILURE; + return; + } + + /* Adjust Rx FHD@25P */ + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x63+((ch%2)*0x80), 0x01 ); // Ch_X Rx ON + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x62+((ch%2)*0x80), 0x05 ); // Ch_X Rx Area + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x66+((ch%2)*0x80), 0x81 ); // Ch_X Rx Signal enhance + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x69+((ch%2)*0x80), 0x2D ); // Ch_X Rx Manual duty + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x60+((ch%2)*0x80), 0x55 ); // Ch_X Rx Header matching + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x61+((ch%2)*0x80), 0x00 ); // Ch_X Rx data_rz + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x68+((ch%2)*0x80), 0x80 ); // Ch_X Rx SZ + + /* get status, If the ack_return(0x56) is 0x05(completed writing f/w file to isp's flash) */ + gpio_i2c_write( jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + ack_return = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x56+((ch%2)*0x80) ); + isp_status = gpio_i2c_read( jaguar1_i2c_addr[devnum], 0x57+((ch%2)*0x80) ); + if( isp_status == 0x02 && ack_return == 0x05 ) + { + printk(">>>>> DRV[%s:%d]CH:%d Receive ISP status : [END]\n", __func__, __LINE__, ch ); + pstFileInfo->result = FW_SUCCESS; + return; + } + else + { + printk(">>>>> DRV[%s:%d]CH:%d retry : Receive ISP status[END], [0x56-true[0x05]:0x%x], [0x57-true[0x02]:0x%x]\n", __func__, __LINE__, ch, ack_return, isp_status ); + pstFileInfo->result = FW_FAILURE; + return; + } + +} + + +void coax_fw_revert_to_previous_fmt_set(void *p_param) +{ + int ch = 0; + int devnum = 0; + video_input_init vd_set; + + FIRMWARE_UP_FILE_INFO *pstFileInfo = (FIRMWARE_UP_FILE_INFO*)p_param; + + ch = pstFileInfo->channel; + devnum = pstFileInfo->channel/4; + + /* previous video format Setting */ + vd_set.ch = ch; + vd_set.format = g_coax_format; + vd_set.input = SINGLE_ENDED; + vd_jaguar1_init_set(&vd_set); + +} + +/*======================================================================================================= + * Coaxial protocol Support option function + * + ========================================================================================================*/ +/************************************************************************************** + * @desc + * JAGUAR1's RT/NRT Mode change + * + * @param_in (NC_VD_COAX_Tx_Init_STR *)p_param->channel Coax read channel + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TEST_TX_INIT_DATA_READ + ***************************************************************************************/ +void coax_option_rt_nrt_mode_change_set(void *p_param) +{ + NC_VD_COAX_STR *coax_val = (NC_VD_COAX_STR*)p_param; + + unsigned char ch = coax_val->ch; + unsigned char param = coax_val->param; + unsigned char tx_line = 0; + unsigned char tx_line_max = 0; + // + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0xFF, 0x02+((ch%4)/2)); + + tx_line = gpio_i2c_read( jaguar1_i2c_addr[coax_val->vd_dev], 0x05+((ch%2)*0x80) ); + tx_line_max = gpio_i2c_read( jaguar1_i2c_addr[coax_val->vd_dev], 0x0A+((ch%2)*0x80) ); + + // Adjust Tx + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x05+((ch%2)*0x80), 0x03); // Tx line set + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x0A+((ch%2)*0x80), 0x04); // Tx max line set + + if( !param ) // RT Mode + { + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x10+((ch%2)*0x80), 0x60); // Register write + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x11+((ch%2)*0x80), 0xb1); // Output command + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x12+((ch%2)*0x80), 0x00); // RT Mode + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x13+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x14+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x15+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x16+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x17+((ch%2)*0x80), 0x00); + } + else // NRT Mode + { + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x10+((ch%2)*0x80), 0x60); // Register write + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x11+((ch%2)*0x80), 0xb1); // Output command + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x12+((ch%2)*0x80), 0x01); // RT Mode + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x13+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x14+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x15+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x16+((ch%2)*0x80), 0x00); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x17+((ch%2)*0x80), 0x00); + } + + // Tx Command Shot + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x09+((ch%2)*0x80), 0x08); // trigger on + msleep(100); + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x09+((ch%2)*0x80), 0x10); // reset + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x09+((ch%2)*0x80), 0x00); // trigger Off + + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x05+((ch%2)*0x80), tx_line); // Tx line set + gpio_i2c_write( jaguar1_i2c_addr[coax_val->vd_dev], 0x0A+((ch%2)*0x80), tx_line_max); // Tx max line set + +} + +/*======================================================================================================= + * Coaxial protocol test function + * + ========================================================================================================*/ +/************************************************************************************** + * @desc + * JAGUAR1's Test function. Read coax Tx initialize value + * + * @param_in (NC_VD_COAX_Tx_Init_STR *)p_param->channel Coax read channel + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TEST_TX_INIT_DATA_READ + ***************************************************************************************/ +void coax_test_tx_init_read(NC_VD_COAX_TEST_STR *coax_tx_mode) +{ + //int ch = coax_tx_mode->ch; + //int devnum = coax_tx_mode->chip_num; + + int ch = 0; + int devnum = 0; + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x05+ch%4); + coax_tx_mode->rx_src = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x7C); + coax_tx_mode->rx_slice_lev = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x7D); + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x02+((ch%4)/2)); + coax_tx_mode->tx_baud = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x00+((ch%2)*0x80)); + coax_tx_mode->tx_pel_baud = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x02+((ch%2)*0x80)); + coax_tx_mode->tx_line_pos0 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x03+((ch%2)*0x80)); + coax_tx_mode->tx_line_pos1 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x04+((ch%2)*0x80)); + coax_tx_mode->tx_line_count = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x05+((ch%2)*0x80)); + coax_tx_mode->tx_pel_line_pos0 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x07+((ch%2)*0x80)); + coax_tx_mode->tx_pel_line_pos1 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x08+((ch%2)*0x80)); + coax_tx_mode->tx_line_count_max = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x0A+((ch%2)*0x80)); + coax_tx_mode->tx_mode = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x0B+((ch%2)*0x80)); + coax_tx_mode->tx_sync_pos0 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x0D+((ch%2)*0x80)); + coax_tx_mode->tx_sync_pos1 = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x0E +((ch%2)*0x80)); + coax_tx_mode->tx_even = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x2F+((ch%2)*0x80)); + coax_tx_mode->tx_zero_length = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x0C+((ch%2)*0x80)); +} + +void coax_acp_rx_detect_get( void *p_param ) +{ + NC_VD_COAX_STR *coax_val = (NC_VD_COAX_STR*)p_param; + + unsigned char ch = coax_val->ch; + unsigned char val_1 = 0; + unsigned char val_2 = 0; + + + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0xFF, 0x02+ch%4); + val_1 = gpio_i2c_read(jaguar1_i2c_addr[coax_val->vd_dev], 0x5c+((ch%2)*0x80)); + // printk("[drv]%d_1. detection: 0x%02X\n", ch, val_1); + + gpio_i2c_write(jaguar1_i2c_addr[coax_val->vd_dev], 0xFF, 0x00); + val_2 = gpio_i2c_read(jaguar1_i2c_addr[coax_val->vd_dev], 0xa8 + ch); + // printk("[drv]%d_2. detection: 0x%02X\n", ch, val_2); + + coax_val->param = val_1; +} +/************************************************************************************** + * @desc + * JAGUAR1's Test function. bank, address, value setting. get from application + * + * @param_in (NC_VD_COAX_TEST_STR *)coax_data Coax Tx setting value + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TEST_DATA_SET + ***************************************************************************************/ +void coax_test_data_set(NC_VD_COAX_TEST_STR *coax_data) +{ + // printk("[DRV_Set]bank(0x%02X)/addr(0x%02X)/param(0x%02X)\n", coax_data->bank, coax_data->data_addr, coax_data->param ); + gpio_i2c_write(jaguar1_i2c_addr[coax_data->chip_num], 0xFF, coax_data->bank); + gpio_i2c_write(jaguar1_i2c_addr[coax_data->chip_num], coax_data->data_addr, coax_data->param ); +} + +/************************************************************************************** + * @desc + * JAGUAR1's Test function. Read value bank, address, value. To application + * + * @param_in (NC_VD_COAX_TEST_STR *)coax_data Coax read channel + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TEST_DATA_READ + ***************************************************************************************/ +void coax_test_data_get(NC_VD_COAX_TEST_STR *coax_data) +{ + gpio_i2c_write(jaguar1_i2c_addr[coax_data->chip_num], 0xFF, coax_data->bank); + coax_data->param = gpio_i2c_read(jaguar1_i2c_addr[coax_data->chip_num], coax_data->data_addr); + // printk("[DRV_Get]bank(0x%02X), addr(0x%02X), param(0x%02X)\n", coax_data->bank, coax_data->data_addr, coax_data->param ); +} + +/************************************************************************************** + * @desc + * JAGUAR1's Test function. Bank Dump To application + * + * @param_in (NC_VD_COAX_BANK_DUMP_STR *)coax_data Coax read channel + * + * @return void None + * + * ioctl : IOC_VDEC_COAX_TEST_DATA_READ + ***************************************************************************************/ +void coax_test_Bank_dump_get(NC_VD_COAX_BANK_DUMP_STR *coax_data) +{ + int ii = 0; + memset( coax_data->rx_pelco_data, 0, sizeof(coax_data->rx_pelco_data)); + + printk("[drv]dev: %x, Bank: 0x%02X\n", coax_data->vd_dev, coax_data->bank); + + gpio_i2c_write(jaguar1_i2c_addr[coax_data->vd_dev], 0xFF, coax_data->bank); + + for(ii=0; ii<256; ii++) + { + coax_data->rx_pelco_data[ii] = gpio_i2c_read(jaguar1_i2c_addr[coax_data->vd_dev], 0x00+ii); + } + +} + + +/******************************************************************************* +* Description : write data to ISP +* Argurments : ch(channel ID),reg_addr(high[1byte]:bank, low[1byte]:register) +* reg_data(data) +* Return value : void +* Modify : +* warning : +*******************************************************************************/ +void acp_isp_write(unsigned char ch, unsigned int reg_addr, unsigned char reg_data) +{ + unsigned char bankaddr = 0x00; + unsigned char device_id = 0x00; + /* int i; */ + unsigned char lcnt_bak, lcntm_bak, crc_bak; + + /* set coax RX device ID */ + bankaddr = (reg_addr>>8)&0xFF; + if( bankaddr >= 0xB0 && bankaddr <= 0xB4 ) + { + device_id = 0x55; + } + else + { + device_id = ACP_REG_WR; + } + + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + lcnt_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80)); + lcntm_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80)); + crc_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80)); + //gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80), device_id); + + /* write data to isp */ + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + if(acp_mode_enable == 1) + { + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x10+((ch%2)*0x80), ACP_REG_WR); // data1(#define ACP_AHD2_FHD_D0 0x10) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x11+((ch%2)*0x80), (reg_addr>>8)&0xFF); // data2(bank) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x12+((ch%2)*0x80), reg_addr&0xFF); // data3(address) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x13+((ch%2)*0x80), reg_data); // data4(Don't care) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x09+((ch%2)*0x80), 0x08); // - pulse on(trigger) + msleep(200); // sleep to recognize NRT(15fps) signal for ISP (M) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x09+((ch%2)*0x80), 0x10); // reset - pulse off + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x09+((ch%2)*0x80), 0x00); // - pulse off + printk("ahd acp 8bit mode test\n"); + } + else + { + /* + // fill Reset + for(i=0;i<4;i++) + { + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x20+((ch%2)*0x80)+i, 0); + } + // Command Shot + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+((ch%2)*0x80), 0x01); + msleep(30); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+((ch%2)*0x80), 0x00); + */ + + //fill command + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x20+((ch%2)*0x80), ACP_REG_WR); // data1(#define ACP_AHD2_FHD_D0 0x10) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x21+((ch%2)*0x80), (reg_addr>>8)&0xFF); // data2(bank) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x22+((ch%2)*0x80), reg_addr&0xFF); // data3(address) + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x23+((ch%2)*0x80), reg_data); // data4(Don't care) + // Command Shot + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2) ); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+((ch%2)*0x80), 0x01); + msleep(200); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+((ch%2)*0x80), 0x00); + printk("ahd pelcod 16bit mode test\n"); + } + + //gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80), lcnt_bak); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80), lcntm_bak); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80), crc_bak); + + #if 0 // debuggin + printk(">>>>> CH:%d NORMAL, RX->TX : ", ch ); + printk("%02x ", ACP_REG_WR ); + printk("%02x ", (reg_addr>>8)&0xFF ); + printk("%02x ", reg_addr&0xFF ); + printk("%02x ", reg_data ); + printk("\n"); + #endif +} + +/******************************************************************************* +* Description : read acp data of ISP +* Argurments : ch(channel ID), reg_addr(high[1byte]:bank, low[1byte]:register) +* Return value : void +* Modify : +* warning : +*******************************************************************************/ +unsigned char acp_isp_read(unsigned char ch, unsigned int reg_addr) +{ + unsigned int data_3x50[8]; + unsigned char lcnt_bak, lcntm_bak, crc_bak; + unsigned char bank; + unsigned char addr; + int i; + + bank = (reg_addr>>8)&0xFF; + addr = reg_addr&0xFF; + + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + lcnt_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80)); + lcntm_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80)); + crc_bak = gpio_i2c_read(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80)); + //gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80), ACP_REG_RD); + + if(acp_mode_enable == 1) + { + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x10+(ch%2)*0x80, 0x61); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x10+1+(ch%2)*0x80, bank); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x10+2+(ch%2)*0x80, addr); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x10+3+(ch%2)*0x80, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x09+(ch%2)*0x80, 0x08); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0xFF, 0x02+((ch%4)/2)); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x20+(ch%2)*0x80, 0x61); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x20+1+(ch%2)*0x80, bank); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x20+2+(ch%2)*0x80, addr); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x20+3+(ch%2)*0x80, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+(ch%2)*0x80, 0x01); + } + msleep(300); + for(i=0;i<8;i++) + { + data_3x50[i] = gpio_i2c_read(jaguar1_i2c_addr[ch/4],0x50+i+((ch%2)*0x80)); + printk("acp_isp_read ch = %d, reg_addr = %x, reg_data = %x\n", ch,reg_addr, data_3x50[i]); + } + //gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x05+((ch%2)*0x80), lcnt_bak); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0A+((ch%2)*0x80), lcntm_bak); + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x60+((ch%2)*0x80), crc_bak); + + if(acp_mode_enable == 1) + { + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x09+((ch%2)*0x80), 0x10); + gpio_i2c_write( jaguar1_i2c_addr[ch/4], 0x09+((ch%2)*0x80), 0x00); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[ch/4], 0x0c+(ch%2)*0x80, 0x00); + } + return data_3x50[3]; +} + + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.h b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.h new file mode 100644 index 000000000000..a15cd3735479 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_protocol.h @@ -0,0 +1,201 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : coax_protocol.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_COAX_PROTOCOL_ +#define _JAGUAR1_COAX_PROTOCOL_ + +#include "jaguar1_common.h" + +#define BANK1 0x01 +#define BANK2 0x02 +#define BANK3 0x03 +#define BANKC 0x0C + +#define FW_SUCCESS 0 +#define FW_FAILURE -1 + +#define DBG_TX_INIT_PRINT 0 +#define DBG_TX_CMD_PRINT 0 +#define DBG_RX_INIT_PRINT 0 + +/* ACP command status */ +#define ACP_CAM_STAT 0x55 +#define ACP_REG_WR 0x60 +#define ACP_REG_RD 0x61 +#define ACP_MODE_ID 0x60 + +typedef enum NC_COAX_CMD_DEF +{ + COAX_CMD_UNKNOWN = 0, + COAX_CMD_IRIS_INC, + COAX_CMD_IRIS_DEC, + COAX_CMD_FOCUS_INC, + COAX_CMD_FOCUS_DEC, + COAX_CMD_ZOOM_INC, + COAX_CMD_ZOOM_DEC, + COAX_CMD_OSD_ON, + COAX_CMD_PTZ_UP, + COAX_CMD_PTZ_DOWN, + COAX_CMD_PTZ_LEFT, + COAX_CMD_PTZ_RIGHT, + COAX_CMD_OSD_ENTER, + COAX_CMD_SPECIAL_FW, + COAX_CMD_SPECIAL_CAMEQ, + COAX_CMD_SPECIAL_FPS, + COAX_CMD_SPECIAL_MOTION, + COAX_CMD_TVI_DOWNSTREAM_REQUEST, + + COAX_CMD_MAX, + +} NC_COAX_CMD_DEF; + +typedef struct _nc_acp_rw_data_ +{ + unsigned char opt; + unsigned char ch; + unsigned int addr; + unsigned char data; +}nc_acp_rw_data; + + +/*============================================================= + * Coaxial Test Structure[APP <-> DRV] + ==============================================================*/ +typedef struct NC_VD_COAX_TEST_STR{ + unsigned char ch; + unsigned char chip_num; + unsigned char bank; + unsigned char data_addr; + unsigned char param; + + unsigned char rx_src; //B5/6/7/8 0x7C + unsigned char rx_slice_lev; //B5/6/7/8 0x7D + unsigned char tx_baud; //B3/4 0x00/80 + unsigned char tx_pel_baud; //B3/4 0x02/82 + unsigned char tx_line_pos0; //B3/4 0x03/83 + unsigned char tx_line_pos1; //B3/4 0x04/84 + unsigned char tx_pel_line_pos0; //B3/4 0x07/87 + unsigned char tx_pel_line_pos1; //B3/4 0x08/88 + unsigned char tx_line_count; //B3/4 0x05/85 + unsigned char tx_line_count_max; //B3/4 0x0A/8A + unsigned char tx_mode; //B3/4 0x0B/8B + unsigned char tx_sync_pos0; //B3/4 0x0D/8D + unsigned char tx_sync_pos1; //B3/4 0x0E/8E + unsigned char tx_even; //B3/4 0x2F/AF + unsigned char tx_zero_length; //B3/4 0x0C/ +}NC_VD_COAX_TEST_STR; + +typedef struct NC_VD_COAX_BANK_DUMP_STR{ + unsigned char ch; + unsigned char vd_dev; + unsigned char bank; + + unsigned char rx_pelco_data[256]; + +}NC_VD_COAX_BANK_DUMP_STR; + +/*============================================================= + * Coaxial UP/Down Stream Initialize Structure[APP -> DRV] + ==============================================================*/ +typedef struct NC_VD_COAX_STR{ + char *name; + unsigned char ch; + unsigned char vd_dev; + unsigned char param; + NC_FORMAT_STANDARD format_standard; + NC_FORMAT_RESOLUTION format_resolution; + NC_FORMAT_FPS format_fps; + NC_VIVO_CH_FORMATDEF vivo_fmt; + NC_COAX_CMD_DEF cmd; + + unsigned char rx_pelco_data[8]; + unsigned char rx_data1[8]; + unsigned char rx_data2[8]; + unsigned char rx_data3[8]; + unsigned char rx_data4[8]; + unsigned char rx_data5[8]; + unsigned char rx_data6[8]; + +}NC_VD_COAX_STR; + +/*============================================================= + * COAX FW Upgrade + ==============================================================*/ +typedef struct __file_information +{ + unsigned int channel; // FirmUP Channel + unsigned int cp_mode; // Channel Format + unsigned char filename[64]; // + unsigned char filePullname[64+32]; // FirmUP FileNmae + unsigned int filesize; + unsigned int filechecksum; // (sum of file&0x0000FFFFF) + unsigned int currentpacketnum; // current packet sequnce number(0,1,2........) + unsigned int filepacketnum; // file packet number = (total size/128bytes), if remain exist, file packet number++ + unsigned char onepacketbuf[128+32]; + + unsigned int currentFileOffset; // Current file offset + unsigned int readsize; // currnet read size + + unsigned int receive_addr; + + unsigned int ispossiblefirmup[16]; // is it possible to update firmware? + int result; + + int appstatus[16]; // Application status + +} FIRMWARE_UP_FILE_INFO, *PFIRMWARE_UP_FILE_INFO; + +// Coaxial UP Stream Function +void coax_tx_init( void *p_param ); // Coax Tx : Initialize +void coax_tx_cmd_send( void *p_param ); // Coax Tx : Command Send + +void coax_tx_16bit_init( void *p_param ); +void coax_tx_16bit_cmd_send( void *p_param ); +void coax_tx_cvi_new_cmd_send( void *p_param ); + +// Coaxial Down Stream Function +void coax_rx_init( void *p_param ); // Coax Rx : Initialize +void coax_rx_data_get( void *p_param ); // Coax Rx : All Rx Buffer read +void coax_rx_buffer_clear( void *p_param ); // Coax Rx : Rx Buffer Clear +void coax_rx_deinit( void *p_param ); // Coax Rx : 3x63 Set[ 1 -> 0 ] +void coax_acp_rx_detect_get( void *p_param ); + +// Coaxial FW Update Function +void coax_fw_ready_header_check_from_isp_recv(void *p_param); +void coax_fw_ready_cmd_to_isp_send(void *p_param); // 1.1 FW Update Ready Command Send +void coax_fw_ready_cmd_ack_from_isp_recv(void *p_param); // 1.2 FW Update Ready ACK +void coax_fw_start_cmd_to_isp_send( void *p_param ); // 2.1 FW Update Start Command Send +void coax_fw_start_cmd_ack_from_isp_recv( void *p_param ); // 2.2 FW Update Start ACK +void coax_fw_one_packet_data_to_isp_send( void *p_param ); // 3.1 FW Update One Packet Data Send +void coax_fw_one_packet_data_ack_from_isp_recv( void *p_param ); // 3.2 FW Update One Packet Data ACK +void coax_fw_end_cmd_to_isp_send( void *p_param ); // 4.1 FW Update End Command Send +void coax_fw_end_cmd_ack_from_isp_recv( void *p_param ); // 4.2 FW Update End ACK +void coax_fw_revert_to_previous_fmt_set(void *p_param); + +// Coaxial Option +void coax_option_rt_nrt_mode_change_set(void *p_param); // RT, NRT Mode change + +// Coaxial Test Function +void coax_test_tx_init_read(NC_VD_COAX_TEST_STR *coax_tx_mode); // Coax Test : Tx Init Read +void coax_test_data_set(NC_VD_COAX_TEST_STR *coax_data); // Coax Test : 1byte Data write +void coax_test_data_get(NC_VD_COAX_TEST_STR *coax_data); // Coax Test : 1byte Data read +void coax_test_Bank_dump_get(NC_VD_COAX_BANK_DUMP_STR *coax_data); // Bank Dump +void acp_isp_write(unsigned char ch, unsigned int reg_addr, unsigned char reg_data); +unsigned char acp_isp_read(unsigned char ch, unsigned int reg_addr); + +#endif +/******************************************************************** + * End of file + ********************************************************************/ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_coax_table.h b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_table.h new file mode 100644 index 000000000000..14990ff2b141 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_coax_table.h @@ -0,0 +1,2907 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : coax_table.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_COAX_TABLE_ +#define _JAGUAR1_COAX_TABLE_ + + +#include "jaguar1_coax_protocol.h" + +#define EOD (-1) + +#define CHANGEDRIVER 1 + +/*============================================================= + * Coaxial UP/Down stream initialize structure + ==============================================================*/ +typedef struct NC_VD_COAX_Init_STR{ + char *name; + unsigned char ch; + unsigned char rx_src; //B5/6/7/8 0x7C + unsigned char rx_slice_lev; //B5/6/7/8 0x7D + unsigned char tx_bank; + unsigned char tx_cmd_addr; + unsigned char tx_shot_addr; + unsigned char tx_baud[6]; //B3/4 0x00/80 + unsigned char tx_pel_baud[6]; //B3/4 0x02/82 + unsigned char tx_line_pos0[6]; //B3/4 0x03/83 + unsigned char tx_line_pos1[6]; //B3/4 0x04/84 + unsigned char tx_pel_line_pos0[6]; //B3/4 0x07/87 + unsigned char tx_pel_line_pos1[6]; //B3/4 0x08/88 + unsigned char tx_line_count; //B3/4 0x05/85 + unsigned char tx_line_count_max; //B3/4 0x0A/8A + unsigned char tx_mode; //B3/4 0x0B/8B + unsigned char tx_sync_pos0[6]; //B3/4 0x0D/8D + unsigned char tx_sync_pos1[6]; //B3/4 0x0E/8E + unsigned char tx_even; //B3/4 0x2F/AF + unsigned char tx_zero_length; //B3/4 0x0C/ + + unsigned char rx_comm_on; // + unsigned char rx_area; // + unsigned char rx_signal_enhance; // + unsigned char rx_manual_duty; // + unsigned char rx_head_matching; // + unsigned char rx_data_rz; // + unsigned char rx_sz; // + + int shot_delay; + int reset_delay; +}NC_VD_COAX_Init_STR; + +/*============================================================= + * Coaxial UP/Down stream command structure + ==============================================================*/ +typedef struct NC_VD_ACP_CMDDEF_STR{ + char *name; + int ahd_16bit[16]; + int ahd_8bit[16]; + int ahd_4_5m[32]; + int cvi_cmd[32]; + int cvi_new_cmd[32]; + int cvi_checksum[16]; + int tvi_v1_0[16]; + int tvi_v2_0[16]; + int sd[16]; +}NC_VD_ACP_CMDDEF_STR; + +NC_VD_COAX_Init_STR coax_acp_16bit_init_lists[]= +{ + [ AHD20_720P_30P ] = { + .name = "AHD20_720P_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P ] = { + .name = "AHD20_720P_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_30P_EX ] = { + .name = "AHD20_720P_30P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P_EX ] = { + .name = "AHD20_720P_25P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_30P_EX_Btype ] = { + .name = "AHD20_720P_30P_EX_Btype", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P_EX_Btype ] = { + .name = "AHD20_720P_25P_EX_Btype", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ CVI_4M_25P ] = { + .name = "CVI_4M_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x04, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x09, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_4M_30P ] = { + .name = "CVI_4M_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x04, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x09, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_8M_15P ] = { + .name = "CVI_8M_15P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x04, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x09, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_8M_12_5P ] = { + .name = "CVI_8M_12_5P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x04, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x09, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + +}; + +NC_VD_COAX_Init_STR coax_init_lists[]= +{ + [ AHD20_SD_H960_2EX_Btype_NT ] = { + .name = "AHD20_SD_H960_2EX_Btype_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, // 0x0C + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_SD_H960_2EX_Btype_PAL ] = { + .name = "AHD20_SD_H960_2EX_Btype_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_SD_H960_NT ] = { + .name = "AHD20_SD_H960_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H960_PAL ] = { + .name = "AHD20_SD_H960_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H1280_NT ] = { + .name = "AHD20_SD_H1280_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 35, + }, + + [ AHD20_SD_H1280_PAL ] = { + .name = "AHD20_SD_H1280_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 35, + }, + + [ AHD20_SD_H1440_NT ] = { + .name = "AHD20_SD_H1440_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H1440_PAL ] = { + .name = "AHD20_SD_H1440_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H960_EX_NT ] = { + .name = "AHD20_SD_H960_EX_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H960_EX_PAL ] = { + .name = "AHD20_SD_H960_EX_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H960_2EX_NT ] = { + .name = "AHD20_SD_H960_2EX_NT", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_SD_H960_2EX_PAL ] = { + .name = "AHD20_SD_H960_2EX_PAL", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x20, + .tx_shot_addr = 0x0c, + .tx_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x48, 0x48, 0x48, 0x48, 0x48, 0x48 }, + .tx_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x06, + .tx_sync_pos0 = { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 }, + .tx_sync_pos1 = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }, + .tx_even = 0x01, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_960P_30P ] = { + .name = "AHD20_720P_960P_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + //.tx_baud = { 0x2D, 0x2D, 0x2D, 0x28, 0x28, 0x28 }, + .tx_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x08, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_720P_960P_25P ] = { + .name = "AHD20_720P_960P_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + //.tx_baud = { 0x2D, 0x2D, 0x2D, 0x28, 0x28, 0x28 }, + .tx_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x08, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_1080P_30P ] = { + .name = "AHD20_1080P_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + //.tx_baud = { 0x2D, 0x2D, 0x2D, 0x28, 0x28, 0x28 }, + .tx_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x08, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_1080P_25P ] = { + .name = "AHD20_1080P_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + //.tx_baud = { 0x2D, 0x2D, 0x2D, 0x28, 0x28, 0x28 }, + .tx_baud = { 0x26, 0x26, 0x26, 0x26, 0x26, 0x26 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x08, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_720P_60P ] = { + .name = "AHD20_720P_60P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x03, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_720P_50P ] = { + .name = "AHD20_720P_50P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x1A, 0x1A, 0x1A, 0x1A, 0x1A, 0x1A }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x03, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x16, 0x16, 0x16, 0x16, 0x16, 0x16 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD20_720P_30P ] = { + .name = "AHD20_720P_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x03, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P ] = { + .name = "AHD20_720P_25P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x15, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_30P_EX ] = { + .name = "AHD20_720P_30P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xb0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P_EX ] = { + .name = "AHD20_720P_25P_EX", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x03, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x35, 0x35, 0x35, 0x35, 0x35, 0x35 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_30P_EX_Btype ] = { + .name = "AHD20_720P_30P_EX_Btype", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD20_720P_25P_EX_Btype ] = { + .name = "AHD20_720P_25P_EX_Btype", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x30, 0x30, 0x30, 0x30, 0x30, 0x30 }, + .tx_pel_baud = { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, + .tx_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x0E, 0x0E, 0x0E, 0x0E, 0x0E, 0x0E }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xD2, 0xD2, 0xD2, 0xD2, 0xD2, 0xD2 }, + .tx_sync_pos1 = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ AHD30_4M_30P ] = { + .name = "AHD30_4M_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0E, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD30_4M_25P ] = { + .name = "AHD30_4M_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0E, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD30_4M_15P ] = { + .name = "AHD30_4M_15P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0E, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 70, + .reset_delay = 0, + }, + + [ AHD30_3M_30P ] = { + .name = "AHD30_3M_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD30_3M_25P ] = { + .name = "AHD30_3M_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ AHD30_3M_18P ] = { + .name = "AHD30_3M_18P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x03, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x60, + + .shot_delay = 55, + .reset_delay = 0, + }, + + [ AHD30_5M_12_5P ] = { + .name = "AHD30_5M_12_5P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0e, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x30, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ AHD30_5M_20P ] = { + .name = "AHD30_5M_20P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x38, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0e, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 55, + .reset_delay = 0, + }, + + [ AHD30_5_3M_20P ] = { + .name = "AHD30_5_3M_20P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x38, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x08, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 55, + .reset_delay = 0, + }, + + [ AHD30_8M_X_30P ] = { + .name = "AHD30_8M_X_30P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ AHD30_8M_X_25P ] = { + .name = "AHD30_8M_X_25P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ AHD30_8M_7_5P ] = { + .name = "AHD30_8M_7_5P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ AHD30_8M_12_5P ] = { + .name = "AHD30_8M_15P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ AHD30_8M_15P ] = { + .name = "AHD30_8M_15P", + .ch = 0, + .rx_src = 0x11, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x07, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x07, + .tx_mode = 0x10, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x81, + .rx_manual_duty = 0x2D, + .rx_head_matching = 0x55, + .rx_data_rz = 0x00, + .rx_sz = 0x70, + + .shot_delay = 90, + .reset_delay = 0, + }, + + [ TVI_FHD_30P ] = { + .name = "TVI_FHD_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0B, 0x00, 0x00, 0x00, 0x00, 0x0A }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x20 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ TVI_FHD_25P ] = { + .name = "TVI_FHD_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 40, + .reset_delay = 40, + }, + + [ TVI_HD_60P ] = { + .name = "TVI_HD_60P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 20, + .reset_delay = 20, + }, + + [ TVI_HD_50P ] = { + .name = "TVI_HD_50P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 20, + .reset_delay = 20, + }, + + [ TVI_HD_30P ] = { + .name = "TVI_HD_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ TVI_HD_25P ] = { + .name = "TVI_HD_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ TVI_HD_30P_EX ] = { + .name = "TVI_HD_30P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ TVI_HD_25P_EX ] = { + .name = "TVI_HD_25P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ TVI_HD_B_30P ] = { + .name = "TVI_HD_B_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0x52, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 40, + .reset_delay = 40, + }, + + [ TVI_HD_B_25P ] = { + .name = "TVI_HD_B_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0x52, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ TVI_HD_B_30P_EX ] = { + .name = "TVI_HD_B_30P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 35, + }, + + [ TVI_HD_B_25P_EX ] = { + .name = "TVI_HD_B_25P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 40, + .reset_delay = 40, + }, + + [ TVI_3M_18P ] = { + .name = "TVI_3M_18P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 55, + .reset_delay = 55, + }, + + [ TVI_5M_12_5P ] = { + .name = "TVI_5M_12_5P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 80, + .reset_delay = 80, + }, + + [ TVI_4M_30P ] = { + .name = "TVI_4M_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ TVI_4M_25P ] = { + .name = "TVI_4M_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x02, + .tx_cmd_addr = 0x10, + .tx_shot_addr = 0x09, + .tx_baud = { 0x34, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x01, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x02, + .tx_mode = 0x08, + .tx_sync_pos0 = { 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x06, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x3E, + .rx_head_matching = 0xAD, + .rx_data_rz = 0x8F, + .rx_sz = 0x60, + + .shot_delay = 30, + .reset_delay = 30, + }, + + [ CVI_HD_60P ] = { + .name = "CVI_HD_60P", + .ch = 0, + .rx_src = 0x01, // 1 + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 20, + .reset_delay = 20, + }, + + [ CVI_HD_50P ] = { + .name = "CVI_HD_50P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 ={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 20, + .reset_delay = 20, + }, + + [ CVI_HD_30P ] = { + .name = "CVI_HD_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x32, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 35, + }, + + [ CVI_HD_25P ] = { + .name = "CVI_HD_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x32, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 40, + .reset_delay = 40, + }, + + [ CVI_HD_30P_EX ] = { + .name = "CVI_HD_30P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x32, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 33, + }, + + [ CVI_HD_25P_EX ] = { + .name = "CVI_HD_25P_EX", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x32, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_FHD_30P ] = { + .name = "CVI_FHD_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x16, 0x16, 0x16, 0x16, 0x16, 0x16 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 }, + .tx_sync_pos1 = { 0x06, 0x06, 0x06, 0x06, 0x06, 0x06 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 35, + .reset_delay = 35, + }, + + [ CVI_FHD_25P ] = { + .name = "CVI_FHD_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x05, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x0c, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x00, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x8D, + .rx_sz = 0x60, + + .shot_delay = 40, + .reset_delay = 40, + }, + + [ CVI_4M_25P ] = { + .name = "CVI_4M_25P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x0f, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_4M_30P ] = { + .name = "CVI_4M_30P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x2b, 0x00, 0x00, 0x2b, 0x00, 0x00 }, + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x0f, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x1e, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x64, + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_8M_15P ] = { + .name = "CVI_8M_15P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x36, 0x00, 0x00, 0x00, 0x00, 0x00 }, //[0x35->0x37] + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x17, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x0f, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x01, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x50, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x58, //[0x54~0x5D] + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, + + [ CVI_8M_12_5P ] = { + .name = "CVI_8M_12_5P", + .ch = 0, + .rx_src = 0x01, + .rx_slice_lev = 0x80, + .tx_bank = 0x0C, + .tx_cmd_addr = 0x00, + .tx_shot_addr = 0x09, + .tx_baud = { 0x36, 0x00, 0x00, 0x00, 0x00, 0x00 }, //[0x35->0x39] + .tx_pel_baud = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos0 = { 0x17, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count = 0x0f, + .tx_pel_line_pos0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_pel_line_pos1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_line_count_max = 0x1e, + .tx_mode = 0x60, + .tx_sync_pos0 = { 0x50, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_sync_pos1 = { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 }, + .tx_even = 0x00, + .tx_zero_length = 0x10, + + .rx_comm_on = 0x01, + .rx_area = 0x05, + .rx_signal_enhance = 0x01, + .rx_manual_duty = 0x61, //[0x5E~0x64] + .rx_head_matching = 0xAB, + .rx_data_rz = 0x85, + .rx_sz = 0x60, + + .shot_delay = 25, + .reset_delay = 25, + }, +}; + + +NC_VD_ACP_CMDDEF_STR coax_cmd_lists[]= +{ + [ COAX_CMD_IRIS_INC ] = { + .name = "COAX_CMD_IRIS_INC", + .ahd_16bit = { 0x40, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x0f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x0f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc5, 0x80, EOD }, + .sd = { 0x40, 0x00, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_IRIS_DEC ] = { + .name = "COAX_CMD_IRIS_DEC", + .ahd_16bit = { 0x20, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x06, 0x00, 0x00, 0x00, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x0e, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc3, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x0e, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x80, EOD }, + .sd = { 0x20, 0x00, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_FOCUS_INC ] = { + .name = "COAX_CMD_FOCUS_INC", + .ahd_16bit = { 0x80, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x12, 0x00, 0x00, 0x00, 0x77, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x77, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc5, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x10, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc6, 0x80, EOD }, + .sd = { 0x80, 0x00, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_FOCUS_DEC ] = { + .name = "COAX_CMD_FOCUS_DEC", + .ahd_16bit = { 0x00, 0x01, 0x01, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x22, 0x00, 0x00, 0x00, 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x11, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc6, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x11, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc7, 0x80, EOD }, + .sd = { 0x00, 0x01, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_ZOOM_INC ] = { + .name = "COAX_CMD_ZOOM_INC", + .ahd_16bit = { 0x00, 0x02, 0x02, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x42, 0x00, 0x00, 0x00, 0x17, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x17, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x13, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc8, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x13, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc9, 0x80, EOD }, + .sd = { 0x00, 0x02, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_ZOOM_DEC ] = { + .name = "COAX_CMD_ZOOM_DEC", + .ahd_16bit = { 0x00, 0x04, 0x04, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x82, 0x00, 0x00, 0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x12, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc7, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x12, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc8, 0x80, EOD }, + .sd = { 0x00, 0x04, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_OSD_ON ] = { + .name = "COAX_CMD_OSD_ON", + .ahd_16bit = { 0x00, 0xc0, 0xc0, 0xfa, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x5F, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x91, 0x80, 0x00, 0x00, 0x0C, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0x10, 0x00, 0x00, 0xEC, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x0C, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x0f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x0f, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc5, 0x80, EOD }, + .sd = { 0x00, 0xC0, 0x00, 0xFA, EOD }, + }, + + [ COAX_CMD_PTZ_UP ] = { + .name = "COAX_CMD_PTZ_UP", + .ahd_16bit = { 0x00, 0x10, 0x10, 0x4c, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x10, 0x00, 0xf9, 0x00, 0xb2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0x20, 0x00, 0x00, 0xCC, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0xb2, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x06, 0x24, 0x80, 0x00, 0x00, 0x00, 0xdf, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x06, 0xff, 0x80, 0x00, 0x00, 0x00, 0xbb, 0x80, EOD }, + .sd = { 0x00, 0x10, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_PTZ_DOWN ] = { + .name = "COAX_CMD_PTZ_DOWN", + .ahd_16bit = { 0x00, 0x08, 0x08, 0x4c, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x32, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x20, 0x00, 0xf9, 0x00, 0x92, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0xA0, 0x00, 0x00, 0x2C, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x92, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x07, 0x24, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x07, 0xff, 0x80, 0x00, 0x00, 0x00, 0xbc, 0x80, EOD }, + .sd = { 0x00, 0x08, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_PTZ_LEFT ] = { + .name = "COAX_CMD_PTZ_LEFT", + .ahd_16bit = { 0x00, 0x20, 0x20, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x32, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x40, 0xf9, 0x00, 0x00, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0x60, 0x00, 0x00, 0xAC, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x09, 0x00, 0x80, 0x24, 0x00, 0x00, 0xe2, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x09, 0x00, 0x80, 0xff, 0x00, 0x00, 0xbe, 0x80, EOD }, + .sd = { 0x00, 0x20, 0x4C, 0x00, EOD }, + }, + + [ COAX_CMD_PTZ_RIGHT ] = { + .name = "COAX_CMD_PTZ_RIGHT", + .ahd_16bit = { 0x00, 0x40, 0x40, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x32, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x80, 0xf9, 0x00, 0x00, 0x62, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0xE0, 0x00, 0x00, 0x6C, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x62, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x08, 0x00, 0x80, 0x24, 0x00, 0x00, 0xe1, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x08, 0x00, 0x80, 0xff, 0x00, 0x00, 0xbd, 0x80, EOD }, + .sd = { 0x00, 0x40, 0x4C, 0x00, EOD }, + }, + + [ COAX_CMD_OSD_ENTER ] = { + .name = "COAX_CMD_OSD_ENTER", + .ahd_16bit = { 0x40, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0xa5, 0x80, 0x91, 0x10, 0x00, 0x00, 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x91, 0x10, 0x00, 0x00, 0xEC, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x17, 0x5f, 0x80, 0x00, 0x00, 0x00, 0x2b, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x17, 0x5f, 0x80, 0x00, 0x00, 0x00, 0x2c, 0x80, EOD }, + .sd = { 0x40, 0x00, 0x00, 0x00, EOD }, + }, + + [ COAX_CMD_SPECIAL_FW ] = { + .name = "COAX_CMD_SPECIAL_FW", + .ahd_16bit = { 0x00, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0x00, 0x03, 0x40, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x81, 0x92, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, EOD }, + .tvi_v1_0 = { 0x00, 0x03, 0x40, EOD }, + .tvi_v2_0 = { 0x00, EOD }, + .sd = { 0x00, EOD }, + }, + + [ COAX_CMD_SPECIAL_CAMEQ ] = { + .name = "COAX_CMD_SPECIAL_CAMEQ", + .ahd_16bit = { 0x00, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0x00, 0x03, 0x40, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x81, 0x92, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, EOD }, + .tvi_v1_0 = { 0x00, EOD }, + .tvi_v2_0 = { 0x00, EOD }, + .sd = { 0x00, EOD }, + }, + + [ COAX_CMD_SPECIAL_FPS ] = { + .name = "COAX_CMD_SPECIAL_FPS", + .ahd_16bit = { 0x00, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0x00, 0x03, 0x40, EOD}, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x81, 0x92, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, EOD }, + .tvi_v1_0 = { 0x00, EOD }, + .tvi_v2_0 = { 0x00, EOD }, + .sd = { 0x00, EOD }, + }, + + [ COAX_CMD_SPECIAL_MOTION ] = { + .name = "COAX_CMD_SPECIAL_MOTION", + .ahd_16bit = { 0x00, 0x00, 0x00, 0x00, EOD }, + .ahd_8bit = { 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, EOD }, + .ahd_4_5m = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, EOD }, + .cvi_cmd = { 0x00, 0x03, 0x40, EOD }, + .cvi_new_cmd = { 0xa5, 0x80, 0x0A, 0x00, 0x00, 0x00, 0x6f, 0xff, 0xff, 0xff, EOD }, + .cvi_checksum = { 0x81, 0x92, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, 0xc1, 0xff, EOD }, + .tvi_v1_0 = { 0x00, EOD }, + .tvi_v2_0 = { 0x00, EOD }, + .sd = { 0x00, EOD }, + }, + + [ COAX_CMD_TVI_DOWNSTREAM_REQUEST ] = { + .name = "COAX_CMD_SPECIAL_MOTION", + .ahd_16bit = { 0x00, EOD }, + .ahd_8bit = { 0x00, EOD }, + .ahd_4_5m = { 0x00, EOD }, + .cvi_cmd = { 0x00, EOD }, + .cvi_new_cmd = { 0x00, EOD }, + .cvi_checksum = { 0x00, EOD }, + .tvi_v1_0 = { 0xb5, 0x00, 0x87, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3c, 0x80, EOD }, + .tvi_v2_0 = { 0xb5, 0x01, 0x87, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3d, 0x80, EOD }, + .sd = { 0x00, EOD }, + }, + +}; + + + + +/******************************************************************** + * End of file + ********************************************************************/ + +#endif diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_common.h b/drivers/media/i2c/jaguar1_drv/jaguar1_common.h new file mode 100644 index 000000000000..e1f5c59a6aa9 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_common.h @@ -0,0 +1,454 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : common.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef __COMMON_H__ +#define __COMMON_H__ + +unsigned char jaguar1_I2CReadByte8(unsigned char devaddress, unsigned char address); +void jaguar1_I2CWriteByte8(unsigned char devaddress, unsigned char address, unsigned char data); +#define gpio_i2c_read jaguar1_I2CReadByte8 +#define gpio_i2c_write jaguar1_I2CWriteByte8 + +#define DRIVER_VER "1.1.7" + +#define JAGUAR1_MAX_CHAN_CNT 4 + +extern unsigned int jaguar1_i2c_addr[4]; + +#define HI_CHIPID_BASE 0x12050000 +#define HI_CHIPID0 IO_ADDRESS(HI_CHIPID_BASE + 0xEEC) +#define HI_CHIPID1 IO_ADDRESS(HI_CHIPID_BASE + 0xEE8) +#define HI_CHIPID2 IO_ADDRESS(HI_CHIPID_BASE + 0xEE4) +#define HI_CHIPID3 IO_ADDRESS(HI_CHIPID_BASE + 0xEE0) +#define HW_REG(reg) *((volatile unsigned int *)(reg)) + +#define _SET_BIT(data,bit) ((data)|=(1<<(bit))) +#define _CLE_BIT(data,bit) ((data)&=(~(1<<(bit)))) + +#define JAGUAR1_BANK_CHANGE(bank) gpio_i2c_write(jaguar1_i2c_addr[0], 0xFF, bank ); + +#define PORTA 0x00 +#define PORTB 0x01 +#define PORTC 0x02 +#define PORTD 0x03 +#define PORTAB 0x04 +#define PORTCD 0x05 + +#define FUNC_ON 0x01 +#define FUNC_OFF 0x00 + +#define BANK_0 0x00 +#define BANK_1 0x01 +#define BANK_2 0x02 +#define BANK_3 0x03 +#define BANK_4 0x04 +#define BANK_5 0x05 +#define BANK_A 0x0A +#define BANK_B 0x0B +#define BANK_11 0x11 +#define BANK_13 0x13 +#define BANK_20 0x20 +#define BANK_21 0x21 +#define BANK_22 0x22 + + +typedef struct _decoder_get_information_str +{ + unsigned char chip_id[4]; + unsigned char chip_rev[4]; + unsigned char chip_addr[4]; + + unsigned char Total_Port_Num; + unsigned char Total_Chip_Cnt; + +}decoder_get_information_str; + +typedef struct _decoder_dev_ch_info_s +{ + unsigned char ch; + unsigned char devnum; + unsigned char fmt_def; +}decoder_dev_ch_info_s; + + +typedef enum NC_FORMAT_FPS +{ + FMT_FPS_UNKNOWN = 0, + FMT_NT = 1, + FMT_PAL, + FMT_12_5P, + FMT_7_5P, + FMT_30P, + FMT_25P, + FMT_50P, + FMT_60P, + FMT_15P, + FMT_18P, + FMT_18_75P, + FMT_20P, + + FMT_FPS_MAX, + +} NC_FORMAT_FPS; + +//#define FMT_AUTO (-1) + +typedef enum NC_FORMAT_STANDARD +{ + FMT_STD_UNKNOWN = 0, + FMT_SD, + FMT_AHD20, + FMT_AHD30, + FMT_TVI, + FMT_CVI, + + FMT_AUTO, // FIXME + + FMT_STD_MAX, + +} NC_FORMAT_STANDARD; + + +typedef enum NC_FORMAT_RESOLUTION +{ + FMT_RESOL_UNKNOWN = 0, + FMT_SH720, + FMT_H960, + FMT_H1280, + FMT_H1440, + FMT_H960_EX, + FMT_H960_2EX, + FMT_H960_Btype_2EX, + FMT_720P, + FMT_720P_EX, + FMT_720P_Btype, + FMT_720P_Btype_EX, + FMT_1080P, + FMT_3M, + FMT_4M, + FMT_5M, + FMT_5_3M, + FMT_6M, + FMT_8M_X, + FMT_8M, + FMT_960P, + + FMT_H960_Btype_2EX_SP, + FMT_720P_Btype_EX_SP, + + FMT_RESOL_MAX, +} NC_FORMAT_RESOLUTION; + + +typedef enum NC_VIVO_CH_FORMATDEF +{ + NC_VIVO_CH_FORMATDEF_UNKNOWN = 0, + NC_VIVO_CH_FORMATDEF_AUTO, + + AHD20_SD_H960_NT, + AHD20_SD_H960_PAL, + AHD20_SD_SH720_NT, + AHD20_SD_SH720_PAL, + AHD20_SD_H1280_NT, + AHD20_SD_H1280_PAL, + AHD20_SD_H1440_NT, + AHD20_SD_H1440_PAL, + AHD20_SD_H960_EX_NT, + AHD20_SD_H960_EX_PAL, + AHD20_SD_H960_2EX_NT, + AHD20_SD_H960_2EX_PAL, + AHD20_SD_H960_2EX_Btype_NT, + AHD20_SD_H960_2EX_Btype_PAL, + AHD20_1080P_60P, // For Test + AHD20_1080P_50P, // For Test + AHD20_1080P_30P, + AHD20_1080P_25P, + AHD20_720P_60P, + AHD20_720P_50P, + AHD20_720P_30P, + AHD20_720P_25P, + AHD20_720P_30P_EX, + AHD20_720P_25P_EX, + AHD20_720P_30P_EX_Btype, + AHD20_720P_25P_EX_Btype, + AHD20_720P_960P_30P, + AHD20_720P_960P_25P, + + AHD30_4M_30P, + AHD30_4M_25P, + AHD30_4M_15P, + AHD30_3M_30P, + AHD30_3M_25P, + AHD30_3M_18P, + AHD30_5M_12_5P, + AHD30_5M_20P, + AHD30_5_3M_20P, + AHD30_6M_18P, + AHD30_6M_20P, + AHD30_8M_X_30P, + AHD30_8M_X_25P, + AHD30_8M_7_5P, + AHD30_8M_12_5P, + AHD30_8M_15P, + + TVI_FHD_30P, + TVI_FHD_25P, + TVI_HD_60P, + TVI_HD_50P, + TVI_HD_30P, + TVI_HD_25P, + TVI_HD_30P_EX, + TVI_HD_25P_EX, + TVI_HD_B_30P, + TVI_HD_B_25P, + TVI_HD_B_30P_EX, + TVI_HD_B_25P_EX, + TVI_3M_18P, + TVI_5M_12_5P, + TVI_4M_30P, + TVI_4M_25P, + TVI_4M_15P, + + CVI_FHD_30P, + CVI_FHD_25P, + CVI_HD_60P, + CVI_HD_50P, + CVI_HD_30P, + CVI_HD_25P, + CVI_HD_30P_EX, + CVI_HD_25P_EX, + CVI_4M_30P, + CVI_4M_25P, + CVI_8M_15P, + CVI_8M_12_5P, + + AHD20_SD_H960_2EX_Btype_SP_NT, + AHD20_SD_H960_2EX_Btype_SP_PAL, + + AHD20_720P_30P_EX_Btype_SP, + AHD20_720P_25P_EX_Btype_SP, + + NC_VIVO_CH_FORMATDEF_MAX, + +} NC_VIVO_CH_FORMATDEF; + +typedef enum NC_OUTPUT_MUX_MODE +{ + NC_MX_MUX1 = 0, + NC_MX_MUX2, + NC_MX_MUX4, +} NC_OUTPUT_MUX_MODE; + +typedef enum NC_OUTPUT_INTERFACE +{ + NC_OI_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */ + NC_OI_BT601, /* ITU-R BT.601 YUV4:2:2 */ + NC_OI_DIGITAL_CAMERA, /* digatal camera mode */ + NC_OI_BT1120_STANDARD, /* BT.1120 progressive mode */ + NC_OI_BT1120_INTERLEAVED, /* BT.1120 interstage mode */ +} NC_OUTPUT_INTERFACE; + +typedef enum NC_OUTPUT_EDGE +{ + NC_OE_SINGLE_UP = 0, /* single-edge mode and in rising edge */ + NC_OE_SINGLE_DOWN, /* single-edge mode and in falling edge */ + NC_OE_DOUBLE , +} NC_OUTPUT_EDGE; + + + +typedef enum NC_ANALOG_INPUT +{ + SINGLE_ENDED = 0, + DIFFERENTIAL, +} NC_ANALOG_INPUT; + +typedef enum NC_CABLE +{ + CABLE_A = 0, + CABLE_B, + CABLE_C, + CABLE_D, +} NC_CABLE; + +typedef enum NC_STAGE +{ + STAGE_0 = 0, + STAGE_1, + STAGE_2, + STAGE_3, + STAGE_4, + STAGE_5, +} NC_STAGE; + +typedef enum NC_JAGUAR1_EQ +{ + NC_EQ_SETTING_FMT_UNKNOWN = 0, + + AHD20_SD_H720_NT_SINGLE_ENDED, + AHD20_SD_H720_NT_DIFFERENTIAL, + AHD20_SD_H720_PAL_SINGLE_ENDED, + AHD20_SD_H720_PAL_DIFFERENTIAL, + + AHD20_SD_H960_2EX_Btype_NT_SINGLE_ENDED, + AHD20_SD_H960_2EX_Btype_NT_DIFFERENTIAL, + AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED, + AHD20_SD_H960_2EX_Btype_PAL_DIFFERENTIAL, + + AHD20_SD_H1440_NT_SINGLE_ENDED, + AHD20_SD_H1440_NT_DIFFERENTIAL, + AHD20_SD_H1440_PAL_SINGLE_ENDED, + AHD20_SD_H1440_PAL_DIFFERENTIAL, + + AHD20_1080P_30P_SINGLE_ENDED, + AHD20_1080P_30P_DIFFERENTIAL, + AHD20_1080P_25P_SINGLE_ENDED, + AHD20_1080P_25P_DIFFERENTIAL, + + AHD20_720P_60P_SINGLE_ENDED, + AHD20_720P_60P_DIFFERENTIAL, + AHD20_720P_50P_SINGLE_ENDED, + AHD20_720P_50P_DIFFERENTIAL, + + AHD20_720P_30P_SINGLE_ENDED, + AHD20_720P_30P_DIFFERENTIAL, + AHD20_720P_25P_SINGLE_ENDED, + AHD20_720P_25P_DIFFERENTIAL, + + AHD20_720P_30P_EX_SINGLE_ENDED, + AHD20_720P_30P_EX_DIFFERENTIAL, + AHD20_720P_25P_EX_SINGLE_ENDED, + AHD20_720P_25P_EX_DIFFERENTIAL, + + AHD20_720P_30P_EX_Btype_SINGLE_ENDED, + AHD20_720P_30P_EX_Btype_DIFFERENTIAL, + AHD20_720P_25P_EX_Btype_SINGLE_ENDED, + AHD20_720P_25P_EX_Btype_DIFFERENTIAL, + + AHD20_960P_30P_SINGLE_ENDED, + AHD20_960P_30P_DIFFERENTIAL, + AHD20_960P_25P_SINGLE_ENDED, + AHD20_960P_25P_DIFFERENTIAL, + + TVI_FHD_30P_SINGLE_ENDED, + TVI_FHD_30P_DIFFERENTIAL, + TVI_FHD_25P_SINGLE_ENDED, + TVI_FHD_25P_DIFFERENTIAL, + + TVI_HD_60P_SINGLE_ENDED, + TVI_HD_60P_DIFFERENTIAL, + TVI_HD_50P_SINGLE_ENDED, + TVI_HD_50P_DIFFERENTIAL, + + TVI_HD_30P_SINGLE_ENDED, + TVI_HD_30P_DIFFERENTIAL, + TVI_HD_25P_SINGLE_ENDED, + TVI_HD_25P_DIFFERENTIAL, + + TVI_HD_30P_EX_SINGLE_ENDED, + TVI_HD_30P_EX_DIFFERENTIAL, + TVI_HD_25P_EX_SINGLE_ENDED, + TVI_HD_25P_EX_DIFFERENTIAL, + + TVI_HD_B_30P_SINGLE_ENDED, + TVI_HD_B_30P_DIFFERENTIAL, + TVI_HD_B_25P_SINGLE_ENDED, + TVI_HD_B_25P_DIFFERENTIAL, + + TVI_HD_B_30P_EX_SINGLE_ENDED, + TVI_HD_B_30P_EX_DIFFERENTIAL, + TVI_HD_B_25P_EX_SINGLE_ENDED, + TVI_HD_B_25P_EX_DIFFERENTIAL, + + CVI_FHD_30P_SINGLE_ENDED, + CVI_FHD_30P_DIFFERENTIAL, + CVI_FHD_25P_SINGLE_ENDED, + CVI_FHD_25P_DIFFERENTIAL, + + CVI_HD_60P_SINGLE_ENDED, + CVI_HD_60P_DIFFERENTIAL, + CVI_HD_50P_SINGLE_ENDED, + CVI_HD_50P_DIFFERENTIAL, + + CVI_HD_30P_SINGLE_ENDED, + CVI_HD_30P_DIFFERENTIAL, + CVI_HD_25P_SINGLE_ENDED, + CVI_HD_25P_DIFFERENTIAL, + + CVI_HD_30P_EX_SINGLE_ENDED, + CVI_HD_30P_EX_DIFFERENTIAL, + CVI_HD_25P_EX_SINGLE_ENDED, + CVI_HD_25P_EX_DIFFERENTIAL, + + NC_EQ_SETTING_FMT_MAX, + + +}NC_JAGUAR1_EQ; + +typedef enum NC_D2S_OUTPUT_INTERFACE +{ + DISABLE = 0, + YUV_422, + YUV_420, + YUV_420_LEGACY, +} NC_D2S_OUTPUT_INTERFACE; + +typedef struct _NC_DEOCDER_SET_STR +{ + NC_VIVO_CH_FORMATDEF FmtDef; + NC_FORMAT_STANDARD fmt_std; + NC_FORMAT_RESOLUTION fmt_res; + NC_FORMAT_FPS fmt_fps; + NC_ANALOG_INPUT input; + NC_D2S_OUTPUT_INTERFACE interface; +}NC_DEOCDER_SET_STR; + +#define UNUSED(x) ((void)(x)) + +#if 0 +#define dbg_printk(...) _kernel_dbg_printk( __VA_ARGS__) + +static void _kernel_dbg_printk(const char* s, ...) +{ + unsigned char buffer[128]; + char *pS = buffer; + + va_list args; + va_start(args, s); + vsprintf(buffer, s, args); + va_end(args); + + + while(*pS) { if( *pS == '\n' ) *pS= ' '; pS++; } + + printk("\033[33m\033[1m [KERNEL] \033[0m:\033[32m\033[1m %s \033[0m\n", buffer); +} +#endif + + + + + + + + + + + + + + +#endif + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_drv.c b/drivers/media/i2c/jaguar1_drv/jaguar1_drv.c new file mode 100644 index 000000000000..324a8f577bd3 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_drv.c @@ -0,0 +1,918 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : jaguar1_drv.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "jaguar1_common.h" +#include "jaguar1_video.h" +#include "jaguar1_coax_protocol.h" +#include "jaguar1_motion.h" +#include "jaguar1_ioctl.h" +#include "jaguar1_video_eq.h" +#include "jaguar1_mipi.h" +#include "jaguar1_drv.h" +#ifdef FOR_IMX6 +#include "imx_mipi.h" +#endif +//#include "video_eq.h" //To do + +//#define STREAM_ON_DEFLAULT + +#define I2C_0 (0) +#define I2C_1 (1) +#define I2C_2 (2) +#define I2C_3 (3) + +#define JAGUAR1_4PORT_R0_ID 0xB0 +#define JAGUAR1_2PORT_R0_ID 0xA0 +#define JAGUAR1_1PORT_R0_ID 0xA2 +#define AFE_NVP6134E_R0_ID 0x80 + +#define JAGUAR1_4PORT_REV_ID 0x00 +#define JAGUAR1_2PORT_REV_ID 0x00 +#define JAGUAR1_1PORT_REV_ID 0x00 + +static int chip_id[4]; +static int rev_id[4]; +static int jaguar1_cnt; +unsigned int jaguar1_i2c_addr[4] = {0x60, 0x62, 0x64, 0x66}; +unsigned int jaguar1_mclk = 0; //0:756 1:594 2:378 3:1242 +module_param_named(jaguar1_mclk, jaguar1_mclk, uint, S_IRUGO); +unsigned int jaguar1_lane = 4; //2 or 4 +module_param_named(jaguar1_lane, jaguar1_lane, uint, S_IRUGO); +static unsigned int chn = 4; +module_param_named(jaguar1_chn, chn, uint, S_IRUGO); +static unsigned int init = 0; +module_param_named(jaguar1_init, init, uint, S_IRUGO); +static unsigned int fmt = 2; //0:960H;1:720P 2:1080P 3:960P 4:SH720 +module_param_named(jaguar1_fmt, fmt, uint, S_IRUGO); +static unsigned int ntpal = 0; +module_param_named(jaguar1_ntpal, ntpal, uint, S_IRUGO); + +static bool jaguar1_init_state; +struct semaphore jaguar1_lock; +struct i2c_client* jaguar1_client; +static struct i2c_board_info hi_info = +{ + I2C_BOARD_INFO("jaguar1", 0x60), +}; +decoder_get_information_str decoder_inform; + +unsigned int acp_mode_enable = 1; +module_param(acp_mode_enable, uint, S_IRUGO); + +static void vd_pattern_enable(void) +{ + gpio_i2c_write(0x60, 0xFF, 0x00); + gpio_i2c_write(0x60, 0x1C, 0x1A); + gpio_i2c_write(0x60, 0x1D, 0x1A); + gpio_i2c_write(0x60, 0x1E, 0x1A); + gpio_i2c_write(0x60, 0x1F, 0x1A); + + gpio_i2c_write(0x60, 0xFF, 0x05); + gpio_i2c_write(0x60, 0x6A, 0x80); + gpio_i2c_write(0x60, 0xFF, 0x06); + gpio_i2c_write(0x60, 0x6A, 0x80); + gpio_i2c_write(0x60, 0xFF, 0x07); + gpio_i2c_write(0x60, 0x6A, 0x80); + gpio_i2c_write(0x60, 0xFF, 0x08); + gpio_i2c_write(0x60, 0x6A, 0x80); +} + +/******************************************************************************* + * Description : Sample function - for select video format + * Argurments : int dev_num(i2c_address array's num) + * Return value : void + * Modify : + * warning : + *******************************************************************************/ +#if 0 +static void set_default_video_fmt(int dev_num) +{ +#if 0 // Activate this block if a default video-setting is required. + int i; + video_input_init video_val; + + /* default video datatype setting */ + mipi_datatype_set(VD_DATA_TYPE_YUV422); + + /* mipi_tx_initial */ + mipi_tx_init(dev_num); + + /* run default video format setting */ + for( i=0 ; i<4 ; i++) + { + video_val.ch = i; + + /* select video format, include struct'vd_vi_init_list' in jaguar1_video_table.h + * ex > AHD20_1080P_30P / AHD20_720P_25P_EX_Btype / AHD20_SD_H960_2EX_Btype_NT */ + video_val.format = AHD20_720P_30P_EX_Btype; + // select analog input type, SINGLE_ENDED or DIFFERENTIAL + video_val.input = SINGLE_ENDED; + // select decoder to soc interface + video_val.interface = YUV_422; + + // run video setting + vd_jaguar1_init_set(&video_val); + + // run video format setting for mipi/arbiter + mipi_video_format_set(&video_val); + set_imx_video_format(&video_val); + init_imx_mipi(i); + } + arb_init(dev_num); + disable_parallel(dev_num); +#endif +} +#endif + +/******************************************************************************* + * Description : Check ID + * Argurments : dec(slave address) + * Return value : Device ID + * Modify : + * warning : + *******************************************************************************/ +static void vd_set_all(video_init_all *param) +{ + int i, dev_num=0; + video_input_init video_val[4]; + +#if 0 + for(i=0 ; i<4 ; i++) + { + printk("[DRV || %s] ch%d / fmt:%d / input:%d / interface:%d\n",__func__ + , param->ch_param[i].ch + , param->ch_param[i].format + , param->ch_param[i].input + , param->ch_param[i].interface); + } +#endif + mipi_datatype_set(VD_DATA_TYPE_YUV422); // to do + mipi_tx_init(dev_num); + + for( i=0 ; i<4 ; i++) + { + video_val[i].ch = param->ch_param[i].ch; + video_val[i].format = param->ch_param[i].format; + video_val[i].input = param->ch_param[i].input; + if(ich_param[i].interface; + else + video_val[i].interface = DISABLE; + + vd_jaguar1_init_set(&video_val[i]); + mipi_video_format_set(&video_val[i]); +#ifdef FOR_IMX6 + set_imx_video_format(&video_val[i]); + if(video_val[i].interface == DISABLE) + { + printk("[DRV] Nothing selected [video ch : %d]\n", i); + } + else + { + init_imx_mipi(i); + } +#endif + } + arb_init(dev_num); + disable_parallel(dev_num); + vd_pattern_enable(); +} + +/******************************************************************************* + * Description : Check ID + * Argurments : dec(slave address) + * Return value : Device ID + * Modify : + * warning : + *******************************************************************************/ +static int check_id(unsigned int dec) +{ + int ret; + gpio_i2c_write(dec, 0xFF, 0x00); + ret = gpio_i2c_read(dec, 0xf4); + return ret; +} + +/******************************************************************************* + * Description : Get rev ID + * Argurments : dec(slave address) + * Return value : rev ID + * Modify : + * warning : + *******************************************************************************/ +static int check_rev(unsigned int dec) +{ + int ret; + gpio_i2c_write(dec, 0xFF, 0x00); + ret = gpio_i2c_read(dec, 0xf5); + return ret; +} + +/******************************************************************************* + * Description : Check decoder count + * Argurments : void + * Return value : (total chip count - 1) or -1(not found any chip) + * Modify : + * warning : + *******************************************************************************/ +static int check_decoder_count(void) +{ + int chip, i; + int ret = -1; + + for(chip=0;chip<4;chip++) + { + chip_id[chip] = check_id(jaguar1_i2c_addr[chip]); + rev_id[chip] = check_rev(jaguar1_i2c_addr[chip]); + if( (chip_id[chip] != JAGUAR1_4PORT_R0_ID ) && + (chip_id[chip] != JAGUAR1_2PORT_R0_ID) && + (chip_id[chip] != JAGUAR1_1PORT_R0_ID) && + (chip_id[chip] != AFE_NVP6134E_R0_ID) + ) + { + printk("Device ID Error... %x, Chip Count:[%d]\n", chip_id[chip], chip); + jaguar1_i2c_addr[chip] = 0xFF; + chip_id[chip] = 0xFF; + } + else + { + printk("Device (0x%x) ID OK... %x , Chip Count:[%d]\n", jaguar1_i2c_addr[chip], chip_id[chip], chip); + printk("Device (0x%x) REV %x\n", jaguar1_i2c_addr[chip], rev_id[chip]); + jaguar1_i2c_addr[jaguar1_cnt] = jaguar1_i2c_addr[chip]; + + if(jaguar1_cnt +#include +#include +#include +#include "jaguar1_common.h" + +extern struct i2c_client* jaguar1_client; + +void jaguar1_I2CWriteByte8(unsigned char chip_addr, unsigned char reg_addr, unsigned char value) +{ + int ret; + unsigned char buf[2]; + struct i2c_client* client = jaguar1_client; + + client->addr = chip_addr>>1; + + buf[0] = reg_addr; + buf[1] = value; + + ret = i2c_master_send(client, buf, 2); + udelay(300); +} + +unsigned char jaguar1_I2CReadByte8(unsigned char chip_addr, unsigned char reg_addr) +{ + struct i2c_client* client = jaguar1_client; + + client->addr = chip_addr>>1; + + return i2c_smbus_read_byte_data(client, reg_addr); +} diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_ioctl.h b/drivers/media/i2c/jaguar1_drv/jaguar1_ioctl.h new file mode 100644 index 000000000000..866faf10e350 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_ioctl.h @@ -0,0 +1,79 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __JAGUAR1_IOCTL_H__ +#define __JAGUAR1_IOCTL_H__ + +/*----------------------- Set All - for MIPI interface ---------------------*/ +#define IOC_VDEC_INIT_ALL 0xF0 + +/*----------------------- VIDEO Initialize ---------------------*/ +#define IOC_VDEC_INPUT_INIT 0x10 +#define IOC_VDEC_OUTPUT_SEQ_SET 0x11 +#define IOC_VDEC_VIDEO_EQ_SET 0x13 +#define IOC_VDEC_VIDEO_SW_RESET 0x14 +#define IOC_VDEC_SINGLE_DIFFERNTIAL_SET 0x15 +#define IOC_VDEC_VIDEO_EQ_CABLE_SET 0x16 +#define IOC_VDEC_VIDEO_EQ_ANALOG_INPUT_SET 0x17 +#define IOC_VDEC_VIDEO_GET_VIDEO_LOSS 0x18 + +/*----------------------- Coaxial protocol ---------------------*/ +// Coax UP Stream - 8bit +#define IOC_VDEC_COAX_TX_INIT 0xA0 +#define IOC_VDEC_COAX_TX_CMD_SEND 0xA1 + +// Coax UP Stream - 16bit only ACP 720P Support +#define IOC_VDEC_COAX_TX_16BIT_INIT 0xB4 +#define IOC_VDEC_COAX_TX_16BIT_CMD_SEND 0xB5 +#define IOC_VDEC_COAX_TX_CVI_NEW_CMD_SEND 0xB6 + +// Coax Down Stream +#define IOC_VDEC_COAX_RX_INIT 0xA2 +#define IOC_VDEC_COAX_RX_DATA_READ 0xA3 +#define IOC_VDEC_COAX_RX_BUF_CLEAR 0xA4 +#define IOC_VDEC_COAX_RX_DEINIT 0xA5 + +// Coax Test +#define IOC_VDEC_COAX_TEST_TX_INIT_DATA_READ 0xA6 +#define IOC_VDEC_COAX_TEST_DATA_SET 0xA7 +#define IOC_VDEC_COAX_TEST_DATA_READ 0xA8 + + +// Coax FW Update +#define IOC_VDEC_COAX_FW_ACP_HEADER_GET 0xA9 +#define IOC_VDEC_COAX_FW_READY_CMD_SET 0xAA +#define IOC_VDEC_COAX_FW_READY_ACK_GET 0xAB +#define IOC_VDEC_COAX_FW_START_CMD_SET 0xAC +#define IOC_VDEC_COAX_FW_START_ACK_GET 0xAD +#define IOC_VDEC_COAX_FW_SEND_DATA_SET 0xAE +#define IOC_VDEC_COAX_FW_SEND_ACK_GET 0xAF +#define IOC_VDEC_COAX_FW_END_CMD_SET 0xB0 +#define IOC_VDEC_COAX_FW_END_ACK_GET 0xB1 + +// Bank Dump Test +#define IOC_VDEC_COAX_BANK_DUMP_GET 0xB2 + +// ACP Option +#define IOC_VDEC_COAX_RT_NRT_MODE_CHANGE_SET 0xB3 +#define IOC_VDEC_COAX_RX_DETECTION_READ 0x12 +#define IOC_VDEC_ACP_WRITE 0xB7 + + +/*----------------------- MOTION -----------------*/ +#define IOC_VDEC_MOTION_SET 0x70 +#define IOC_VDEC_MOTION_PIXEL_SET 0x71 +#define IOC_VDEC_MOTION_PIXEL_GET 0x72 +#define IOC_VDEC_MOTION_TSEN_SET 0x73 +#define IOC_VDEC_MOTION_PSEN_SET 0x74 +#define IOC_VDEC_MOTION_ALL_PIXEL_SET 0x75 +#define IOC_VDEC_MOTION_DETECTION_GET 0x76 + +/*---------------------- GET CHIP ID FUNCTION ---------------------*/ +#define IOC_VDEC_GET_CHIP_ID 0x90 +#define IOC_VDEC_CH_SW_RESET 0x91 +#define IOC_VDEC_HAFC_GAIN12_CTRL 0x92 +#define IOC_VDEC_AFE_RESET 0x93 +#define IOC_VDEC_GET_DRIVERVER 0x94 + +#define IOC_VDEC_MANUAL_AGC_STABLE_ENABLE 0x82 +#define IOC_VDEC_MANUAL_AGC_STABLE_DISABLE 0x83 + +#endif diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.c b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.c new file mode 100644 index 000000000000..83047889ebf5 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.c @@ -0,0 +1,317 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2016 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : MIPI + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#include +#include +#include "jaguar1_common.h" +#include "jaguar1_mipi.h" +#include "jaguar1_mipi_table.h" + +static unsigned char mipi_dtype, arb_dtype, en_param; + + +/*------------------------------------------------------------------- + + Arbiter function + + -------------------------------------------------------------------*/ + +static void arb_scale_set(video_input_init *dev_ch_info, unsigned char val) +{ + int devnum = dev_ch_info->ch / 4; + unsigned char arb_scale = 0; + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x20); + + arb_scale = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x01); + arb_scale &= ~(0x3<<(dev_ch_info->ch*2)); + arb_scale |= val<<(dev_ch_info->ch*2); + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x01, arb_scale); +} + +void arb_enable(int dev_num) +{ + if((dev_num < 0) || (dev_num > 3)) + { + printk("[DRV] %s input channel Error (%d)\n",__func__, dev_num); + return; + } + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xff, 0x20); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x00, en_param); + printk("VDEC_ARBITER_INIT done 0x%X\n", en_param); +} + +void arb_disable(int dev_num) +{ + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xff, 0x20); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x00, 0x00); +} + +void arb_init(int dev_num) +{ + arb_disable(dev_num); + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xff, 0x20); + + // ARB RESET High + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0x01); + // MIPI Video type Init + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x0F, arb_dtype); + // ARB 32Bit Mode + if(2 == jaguar1_lane) + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x0D, 0x00); + else + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x0D, 0x01); + + // ARB RESET Low + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0x00); + + arb_enable(dev_num); +} + + +/*------------------------------------------------------------------- + + MIPI function + +-------------------------------------------------------------------*/ + +static void mipi_frame_opt_set(video_input_init *dev_ch_info, unsigned char val) +{ + int devnum = dev_ch_info->ch / 4; + unsigned char mipi_frame_opt; + + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0xFF, 0x21); + + switch(dev_ch_info->ch) + { + case 0 : + mipi_frame_opt = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x3E); + mipi_frame_opt = (mipi_frame_opt & 0xF0) | val; + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3E, mipi_frame_opt); + break; + case 1 : + mipi_frame_opt = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x3E); + mipi_frame_opt = (mipi_frame_opt & 0x0F) | val; + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3E, mipi_frame_opt); + break; + case 2 : + mipi_frame_opt = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x3F); + mipi_frame_opt = (mipi_frame_opt & 0xF0) | val; + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3F, mipi_frame_opt); + break; + case 3 : + mipi_frame_opt = gpio_i2c_read(jaguar1_i2c_addr[devnum], 0x3F); + mipi_frame_opt = (mipi_frame_opt & 0x0F) | val; + gpio_i2c_write(jaguar1_i2c_addr[devnum], 0x3F, mipi_frame_opt); + break; + } +} + +void mipi_video_format_set(video_input_init *dev_ch_info) +{ + mipi_vdfmt_set_s mipi_vd_fmt = (mipi_vdfmt_set_s)decoder_mipi_fmtdef[dev_ch_info->format]; + + if(dev_ch_info->interface != DISABLE) + { + en_param |= 0x11<<(dev_ch_info->ch); + } + + mipi_frame_opt_set(dev_ch_info, mipi_vd_fmt.mipi_frame_opt); + arb_scale_set(dev_ch_info, mipi_vd_fmt.arb_scale); +} + +int mipi_datatype_set(unsigned char data_type) +{ + int ret = 0; + + switch(data_type) + { + case VD_DATA_TYPE_YUV422 : + mipi_dtype = 0x1E; + arb_dtype = 0x00; + break; + case VD_DATA_TYPE_YUV420 : + mipi_dtype = 0x18; + arb_dtype = 0xAA; + break; + case VD_DATA_TYPE_LEGACY420 : + mipi_dtype = 0x1A; + arb_dtype = 0x55; + break; + default : + printk("[DRV]%s : invalid data type [0x%X]\n", __func__, data_type); + ret = -1; + break; + } + + return ret; +} + +void mipi_tx_init(int dev_num) +{ + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xFF, 0x21); + + pr_info("%s: mclk: %d\n", __func__, jaguar1_mclk); + switch(jaguar1_mclk) + { + case 3: + printk("[DRV] SET_MIPI_1242MHZ\n"); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0xB4); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x41, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x42, 0x03); + break; + // case 3: + // printk("[DRV]_MIPI_252MHZ_TEST_\n"); + // gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0xDC); + // gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x41, 0x20); + // gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x42, 0x05); + // break; + case 2: + printk("[DRV] SET_MIPI_378MHZ\n"); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0xDC); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x41, 0x20); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x42, 0x03); + break; + case 1: + printk("[DRV] SET_MIPI_594MHZ\n"); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0xCC); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x41, 0x10); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x42, 0x03); + break; + default: + printk("[DRV] SET_MIPI_756MHZ\n"); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x40, 0xDC); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x41, 0x10); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x42, 0x03); + break; + } + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x43, 0x43); + + switch(jaguar1_mclk) + { + case 3: // 1242MHz MIPI_CLK for FHD*4ch + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x11, 0x08); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x10, 0x13); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x12, 0x0B); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x13, 0x12); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x17, 0x02); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x18, 0x12); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x15, 0x07); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x14, 0x2D); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x16, 0x0B); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x19, 0x09); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1A, 0x15); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1B, 0x11); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1C, 0x0E); + break; + case 2: // 378MHz MIPI_CLK for low-clock test + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x11, 0x03); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x10, 0x07); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x12, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x13, 0x06); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x17, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x18, 0x0B); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x15, 0x02); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x14, 0x0E); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x16, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x19, 0x03); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1A, 0x07); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1B, 0x06); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1C, 0x05); + break; + case 1: // 594MHz MIPI_CLK for HD*4ch + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x11, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x10, 0x0A); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x12, 0x06); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x13, 0x09); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x17, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x18, 0x0D); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x15, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x14, 0x16); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x16, 0x05); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x19, 0x05); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1A, 0x0A); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1B, 0x08); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1C, 0x07); + break; + default: // 756MHz MIPI_CLK + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x11, 0x05); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x10, 0x0C); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x12, 0x07); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x13, 0x0B); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x17, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x18, 0x0E); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x15, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x14, 0x1C); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x16, 0x07); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x19, 0x06); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1A, 0x0D); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1B, 0x0B); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x1C, 0x09); + break; + } + + // MIPI setting + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x44, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x49, 0xF3); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x49, 0xF0); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x44, 0x02); + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x08, 0x40); + + // MIPI_TX_FRAME_CNT_EN + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x0F, 0x01); + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x38, mipi_dtype); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x39, mipi_dtype); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x3A, mipi_dtype); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x3B, mipi_dtype); + + // MIPI Enable + if(2 == jaguar1_lane) + { + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x07, 0x07); //two lanes test + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x2D, 0x00); + printk("NOTE >>> 2 lanes mode enabled\n"); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x07, 0x0F); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0x2D, 0x01); + } + + printk("[DRV]VDEC_MIPI_TX_INIT done\n"); +} + +void disable_parallel(int dev_num) +{ + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xFF, 0x01); + + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xC8, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xC9, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCA, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCB, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCC, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCD, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCE, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev_num], 0xCF, 0x00); + + printk("[DRV]Parallel block Disable\n"); +} + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.h b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.h new file mode 100644 index 000000000000..327376e4b82e --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : MIPI + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_CLOCK_ +#define _JAGUAR1_CLOCK_ + +#include "jaguar1_video.h" + +#define VD_DATA_TYPE_YUV422 (0x01) +#define VD_DATA_TYPE_YUV420 (0x02) +#define VD_DATA_TYPE_LEGACY420 (0x03) + +typedef struct _mipi_vdfmt_set_s{ + unsigned char arb_scale; + unsigned char mipi_frame_opt; +}mipi_vdfmt_set_s; + +extern unsigned int jaguar1_mclk; +extern unsigned int jaguar1_lane; + +void arb_init(int dev_num); +void arb_enable(int dev_num); +void arb_disable(int dev_num); +int mipi_datatype_set(unsigned char data_type); +void mipi_tx_init(int dev_num); +void mipi_video_format_set(video_input_init *dev_ch_info); +void disable_parallel(int dev_num); + +#endif diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_mipi_table.h b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi_table.h new file mode 100644 index 000000000000..a906eeeb2bc4 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_mipi_table.h @@ -0,0 +1,315 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : arb_mipi_table.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _ARB_MIPI_TABLE_H_ +#define _ARB_MIPI_TABLE_H_ + +#include "jaguar1_common.h" + +/* ----------------------------------------------------------------------------- + * arb_scale(20x01) : SD=2(1/4), HD=1(1/2), FHD=0(bypass) + * mipi_frame_opt(21x3E, 21x3F) : SD only [TBD] + *-----------------------------------------------------------------------------*/ + + +mipi_vdfmt_set_s decoder_mipi_fmtdef[ NC_VIVO_CH_FORMATDEF_MAX ] = +{ + [ AHD20_SD_H960_2EX_Btype_NT ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_2EX_Btype_PAL ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_SH720_NT] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_SH720_PAL] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_NT ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_PAL ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H1280_NT ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H1280_PAL ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H1440_NT ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H1440_PAL ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_EX_NT ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_EX_PAL ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_2EX_NT ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_SD_H960_2EX_PAL ] = { + .arb_scale = 0x02, + .mipi_frame_opt = 0x00, + }, + [ AHD20_1080P_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_1080P_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_60P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_50P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_30P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_25P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_30P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_25P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_30P_EX_Btype ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_25P_EX_Btype ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_960P_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD20_720P_960P_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_3M_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_3M_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_3M_18P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_4M_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_4M_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_4M_15P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_5M_20P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_5M_12_5P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_5_3M_20P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_6M_18P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_6M_20P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_8M_X_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_8M_X_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_8M_7_5P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_8M_12_5P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ AHD30_8M_15P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + + /* TVI */ + [ TVI_FHD_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_FHD_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_60P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_50P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_30P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_25P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_30P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_25P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_B_30P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_B_25P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_B_30P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_HD_B_25P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ TVI_3M_18P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_5M_12_5P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_4M_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ TVI_4M_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + + /* CVI */ + [ CVI_FHD_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_FHD_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_60P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_50P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_30P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_25P ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_30P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ CVI_HD_25P_EX ] = { + .arb_scale = 0x01, + .mipi_frame_opt = 0x00, + }, + [ CVI_4M_30P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_4M_25P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_8M_12_5P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, + [ CVI_8M_15P ] = { + .arb_scale = 0x00, + .mipi_frame_opt = 0x00, + }, +}; + +#endif /* VIDEO_DECODER_JAGUAR1_DRV_ARB_MIPI_TABLE_H_ */ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_motion.c b/drivers/media/i2c/jaguar1_drv/jaguar1_motion.c new file mode 100644 index 000000000000..08a1d5ffdac1 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_motion.c @@ -0,0 +1,262 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : motion.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#include +#include +#include "jaguar1_common.h" +#include "jaguar1_motion.h" + +/************************************************************************************** + * @desc + * JAGUAR1's + * + * @param_in (motion_mode *)p_param->channel FW Update channel + * + * @return void None + * + * ioctl : IOC_VDEC_MOTION_SET + ***************************************************************************************/ + +void motion_detection_get(motion_mode *motion_set) +{ + //BANK2_MOTION + unsigned char ReadVal = 0; + unsigned char ch_mask = 1; + unsigned char ch = motion_set->ch; + unsigned char ret = 0; + + ch_mask = ch_mask<devnum], 0xFF, 0x00); + ReadVal = gpio_i2c_read(jaguar1_i2c_addr[motion_set->devnum], 0xA1); + + ret = ReadVal&ch_mask; + motion_set->set_val = ret; + + // printk("motion_detection_get:: %x\n", motion_set->set_val); + +} + +void motion_onoff_set(motion_mode *motion_set) +{ + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_12_5P/*TVI_5M_20P*/) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); + + if(motion_set->fmtdef == TVI_3M_18P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); + } + else if(motion_set->fmtdef == TVI_5M_12_5P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x96); + } + + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); + + printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); + } + + if(motion_set->set_val<0 || motion_set->set_val>1) + { + printk("[DRV_Motion_OnOff]Error!! ch(%d) Setting Value Over:%x!! Only 0 or 1\n", motion_set->ch, motion_set->set_val); + return; + } + + switch(motion_set->set_val) + { + case FUNC_OFF : gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x00 + (0x07 * motion_set->ch)), 0x0D); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); + break; + case FUNC_ON : gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x00 + (0x07 * motion_set->ch)), 0x0C); + break; + } + + +} + +void motion_pixel_all_onoff_set(motion_mode *motion_set) +{ + int ii=0; + unsigned char addr = 0; + + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_12_5P/*TVI_5M_20P*/) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); + + if(motion_set->fmtdef == TVI_3M_18P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); + } + else if(motion_set->fmtdef == TVI_5M_12_5P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x96); + } + + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); + + printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); + } + + for(ii=0; ii<24; ii++) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x40 +(0x18 *motion_set->ch)) + ii, motion_set->set_val); + addr = (0x40 +(0x18 *motion_set->ch)) + ii; + } +} + +void motion_pixel_onoff_set(motion_mode *motion_set) +{ + unsigned char val = 0x80; + unsigned char ReadVal; + unsigned char on; + + unsigned char ch = motion_set->ch; + unsigned char SetPix = motion_set->set_val/8; + unsigned char SetVal = motion_set->set_val%8; + + val = val >> SetVal; + + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + + if(motion_set->fmtdef == TVI_3M_18P || motion_set->fmtdef == TVI_5M_12_5P || motion_set->fmtdef == TVI_5M_12_5P/*TVI_5M_20P*/) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x00 + (0x07 * motion_set->ch), 0x0C); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x02 + (0x07 * motion_set->ch), 0x23); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x11); + + if(motion_set->fmtdef == TVI_3M_18P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0x78); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x40); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x72); + } + else if(motion_set->fmtdef == TVI_5M_12_5P) + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x29 + (0x06 * motion_set->ch), 0xA2); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2A + (0x06 * motion_set->ch), 0x51); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2C + (0x06 * motion_set->ch), 0x96); + } + + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x2B + (0x06 * motion_set->ch), 0x6); + + printk("[DRV_Motion_OnOff] ch(%d) fmtdef(%d)\n", motion_set->ch, motion_set->fmtdef); + } + else + { + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0x28 + (0x06 * motion_set->ch), 0x00); + } + + ReadVal = gpio_i2c_read(jaguar1_i2c_addr[motion_set->devnum], (0x40 +(0x18 *ch)) + SetPix); + on = val&ReadVal; + if(on) + { + val = ~val; + val = val&ReadVal; + } + else + { + val = val|ReadVal; + } + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x40 +(0x18 *ch)) + SetPix, val); +} + +void motion_pixel_onoff_get(motion_mode *motion_set) +{ + unsigned char val = 0x80; + unsigned char ReadVal; + unsigned char on; + + unsigned char Ch = motion_set->ch; + unsigned char SetPix = motion_set->set_val/8; + unsigned char SetVal = motion_set->set_val%8; + + val = val >> SetVal; + + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + ReadVal = gpio_i2c_read(jaguar1_i2c_addr[motion_set->devnum], (0x40 +(0x18 *Ch)) + SetPix); + + on = val&ReadVal; + + if(on) + { + motion_set->set_val = 1; + } + else + { + motion_set->set_val = 0; + } +} + +void motion_tsen_set(motion_mode *motion_set) +{ + unsigned char ch = motion_set->ch; + unsigned char SetVal = motion_set->set_val; + + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x01 +(0x07 * ch)), SetVal); + printk("[DRV_Motion]ch(%d), TSEN Val(%x)\n", ch, SetVal); +} + +void motion_psen_set(motion_mode *motion_set) +{ + unsigned char msb_mask = 0xf0; + unsigned char lsb_mask = 0x07; + unsigned char ch = motion_set->ch; + unsigned char SetVal = motion_set->set_val; + unsigned char ReadVal; + + //BANK2_MOTION + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], 0xFF, 0x04); + ReadVal = gpio_i2c_read(jaguar1_i2c_addr[motion_set->devnum], (0x02 +(0x07 * ch))); + + msb_mask = msb_mask&ReadVal; + SetVal = lsb_mask&SetVal; + + SetVal = SetVal|msb_mask; + + gpio_i2c_write(jaguar1_i2c_addr[motion_set->devnum], (0x02 +(0x07 * ch)), SetVal); + printk("[DRV_Motion]ch(%d), readVal(%x), SetVal(%x)\n", ch, ReadVal, SetVal); +} + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_motion.h b/drivers/media/i2c/jaguar1_drv/jaguar1_motion.h new file mode 100644 index 000000000000..3b9d8b86503e --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_motion.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : motion.h + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _MOTION_H_ +#define _MOTION_H_ + +#include "jaguar1_common.h" + +typedef struct _motion_mode{ + unsigned char ch; + unsigned char devnum; + unsigned char set_val; + + unsigned char fmtdef; +}motion_mode; + +void motion_onoff_set(motion_mode *motion_set); +void motion_display_onoff_set(motion_mode *motion_set); +void motion_pixel_all_onoff_set(motion_mode *motion_set); +void motion_pixel_onoff_set(motion_mode *motion_set); +void motion_pixel_onoff_get(motion_mode *motion_set); +void motion_tsen_set(motion_mode *motion_set); +void motion_psen_set(motion_mode *motion_set); +void motion_detection_get(motion_mode *motion_set); + +#endif /* _MOTION_H_ */ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_reg_set_def.h b/drivers/media/i2c/jaguar1_drv/jaguar1_reg_set_def.h new file mode 100644 index 000000000000..a1de20b2bdd0 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_reg_set_def.h @@ -0,0 +1,268 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : coax_table.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_REGISTER_SET_DEFINE_ +#define _JAGUAR1_REGISTER_SET_DEFINE_ + +#include "jaguar1_video.h" + + +/*================================================================================================= + * + * REG_SET_BANKxADDR_StartBit_Size_RegName( Channel, Setting Value ) + * + *=================================================================================================*/ + + +// vd_jaguar1_init_set +#define REG_SET_0x00_0_8_EACH_SET(ch, val) vd_register_set ( 0 , 0x00 , 0x00 + ch , val , 0 , 8 ) + +// vd_jaguar1_single_differ_set +#define REG_SET_0x18_0_8_EX_CBAR_ON(ch, val) vd_register_set ( 0 , 0x00 , 0x18 + ch , val , 0 , 8 ) +#define REG_SET_5x00_0_8_CMP(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x00 , val , 0 , 8 ) +#define REG_SET_5x01_0_8_CML(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x01 , val , 0 , 8 ) +#define REG_SET_5x1D_0_8_AFE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x1d , val , 0 , 8 ) +#define REG_SET_5x92_0_8_PWM(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x92 , val , 0 , 8 ) + +// vd_vo_port_y_c_merge_set +#define REG_SET_1xEC_0_8_yc_merge(ch, val) vd_register_set ( 0 , 0x01 , 0xec + ch , val , 0 , 8 ) + +// vd_vo_mux_mode_set +#define REG_SET_1xC8_0_8_out_sel(ch, val) vd_register_set ( 0 , 0x01 , 0xc8 + ch , val , 0 , 8 ) + +// vd_vo_manual_mode_set + + +// vd_vi_manual_set_seq1 +#define REG_SET_1x7C_0_1_clk_auto_1(ch, val) vd_register_set ( 0 , 0x01 , 0x7c , val , 0 , 1 ) +#define REG_SET_1x7C_1_1_clk_auto_2(ch, val) vd_register_set ( 0 , 0x01 , 0x7c , val , 1 , 1 ) +#define REG_SET_1x7C_2_1_clk_auto_3(ch, val) vd_register_set ( 0 , 0x01 , 0x7c , val , 2 , 1 ) +#define REG_SET_1x7C_3_1_clk_auto_4(ch, val) vd_register_set ( 0 , 0x01 , 0x7c , val , 3 , 1 ) + +#define REG_SET_5x32_0_8_NOVIDEO_DET_A(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x32 , val , 0 , 8 ) +#define REG_SET_5xB9_0_8_HAFC_LPF_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xb9 , val , 0 , 8 ) +#define REG_SET_9x44_0_8_FSC_EXT_EN(ch, val) vd_register_set ( 0 , 0x09 , 0x44 + ch , val , 0 , 8 ) +#define REG_SET_5x6E_0_8_VBLK_END_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x6e , val , 0 , 8 ) +#define REG_SET_5x6F_0_8_VBLK_END_EXT(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x6f , val , 0 , 8 ) + +// afe_reg +#define REG_SET_5x00_0_8_A_CMP_PW_MODE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x00 , val , 0 , 8 ) +#define REG_SET_5x02_0_8_A_CMP_TIMEUNIT(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x02 , val , 0 , 8 ) +#define REG_SET_5x1E_0_8_VAFEMD(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x1e , val , 0 , 8 ) +#define REG_SET_5x58_0_8_VAFE1_EQ_BAND_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x58 , val , 0 , 8 ) +#define REG_SET_5x59_0_8_LPF_BYPASS(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x59 , val , 0 , 8 ) +#define REG_SET_5x5A_0_8_VAFE_IMP_CNT(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x5a , val , 0 , 8 ) +#define REG_SET_5x5B_0_8_VAFE_DUTY(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x5b , val , 0 , 8 ) +#define REG_SET_5x5C_0_8_VAFE_B_LPF_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x5c , val , 0 , 8 ) +#define REG_SET_5x94_0_8_PWM_DELAY_H(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x94 , val , 0 , 8 ) +#define REG_SET_5x95_0_8_PWM_DELAY_L(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x95 , val , 0 , 8 ) +#define REG_SET_5x65_0_8_VAFE_CML_SPEED(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x65 , val , 0 , 8 ) + + +// vd_vi_format_set_seq3 +#define REG_SET_0x10_0_8_VD_FMT(ch, val) vd_register_set ( 0 , 0x00 , 0x10 + ch , val , 0 , 8 ) +#define REG_SET_0x0C_0_8_SPL_MODE(ch, val) vd_register_set ( 0 , 0x00 , 0x0c + ch , val , 0 , 8 ) +#define REG_SET_0x04_0_8_SD_MODE(ch, val) vd_register_set ( 0 , 0x00 , 0x04 + ch , val , 0 , 8 ) +#define REG_SET_0x08_0_8_AHD_MODE(ch, val) vd_register_set ( 0 , 0x00 , 0x08 + ch , val , 0 , 8 ) +#define REG_SET_5x69_0_1_SD_FREQ_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x69 , val , 0 , 1 ) +#define REG_SET_5x62_0_8_SYNC_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x62 , val , 0 , 8 ) + + +// vd_vi_chroma_set_seq4 +#define REG_SET_0x5C_0_8_PAL_CM_OFF(ch, val) vd_register_set ( 0 , 0x00 , 0x5c + ch , val , 0 , 8 ) +#define REG_SET_5x28_0_8_S_POINT(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x28 , val , 0 , 8 ) +#define REG_SET_5x25_0_8_FSC_LOCK_MODE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x25 , val , 0 , 8 ) +#define REG_SET_5x90_0_8_COMB_MODE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x90 , val , 0 , 8 ) + + +// vd_vi_h_timing_set_seq5 +#define REG_SET_0x68_0_8_H_DLY_LSB(ch, val) vd_register_set ( 0 , 0x00 , 0x68 + ch , val , 0 , 8 ) +#define REG_SET_0x6c_0_8_H_DLY_MSB(ch, val) vd_register_set ( 0 , 0x00 , 0x6c + ch , val , 0 , 8 ) +#define REG_SET_0x60_0_8_Y_DLY(ch, val) vd_register_set ( 0 , 0x00 , 0x60 + ch , val , 0 , 8 ) +#define REG_SET_0x78_0_8_V_BLK_END_A(ch, val) vd_register_set ( 0 , 0x00 , 0x78 + ch , val , 0 , 8 ) +#define REG_SET_5x38_4_1_H_MASK_ON(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x38 , val , 4 , 1 ) +#define REG_SET_5x38_0_4_H_MASK_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x38 , val , 0 , 4 ) +#define REG_SET_0x64_0_8_V_BLK_END_B(ch, val) vd_register_set ( 0 , 0x00 , 0x64 + ch , val , 0 , 8 ) +#define REG_SET_0x14_4_1_FLD_INV(ch, val) vd_register_set ( 0 , 0x00 , 0x14 + ch , val , 4 , 1 ) +#define REG_SET_5x64_0_8_MEM_RDP(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x64 , val , 0 , 8 ) +#define REG_SET_5x47_0_8_SYNC_RS(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x47 , val , 0 , 8 ) +#define REG_SET_5xA9_0_8_V_BLK_END_B(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xa9 , val , 0 , 8 ) + + +// vd_vi_h_scaler_mode_set_seq6 +#define REG_SET_5x53_2_2_LINEMEM_MD(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x53 , val , 2 , 2 ) +#define REG_SET_9x96_0_8_H_DOWN_SCALER(ch, val) vd_register_set ( 0 , 0x09 , 0x96 + (0x20 * ch) , val , 0 , 8 ) +#define REG_SET_9x97_0_8_H_SCALER_MODE(ch, val) vd_register_set ( 0 , 0x09 , 0x97 + (0x20 * ch) , val , 0 , 8 ) +#define REG_SET_9x98_0_8_REF_BASE_LSB(ch, val) vd_register_set ( 0 , 0x09 , 0x98 + (0x20 * ch) , val , 0 , 8 ) +#define REG_SET_9x99_0_8_REF_BASE_MSB(ch, val) vd_register_set ( 0 , 0x09 , 0x99 + (0x20 * ch) , val , 0 , 8 ) +#define REG_SET_9x9E_0_8_H_SCALER_OUTPUT_H_ACTIVE(ch, val) vd_register_set ( 0 , 0x09 , 0x9e + (0x20 * ch) , val , 0 , 8 ) + + +//vd_vi_hpll_set_seq7 +#define REG_SET_5x50_0_8_HPLL_MASK_ON(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x50 , val , 0 , 8 ) +#define REG_SET_5xB8_0_8_HAFC_OP_MD(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xb8 , val , 0 , 8 ) +#define REG_SET_5xBB_0_8_HAFC_BYP_TH_E(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xbb , val , 0 , 8 ) +#define REG_SET_5xB7_0_8_HAFC_BYP_TH_S(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xb7 , val , 0 , 8 ) + +// vd_vi_color_set_seq8 +#define REG_SET_0x20_0_8_BRIGHTNESS(ch, val) vd_register_set ( 0 , 0x00 , 0x20 + ch , val , 0 , 8 ) +#define REG_SET_0x24_0_8_CONTARST(ch, val) vd_register_set ( 0 , 0x00 , 0x24 + ch , val , 0 , 8 ) +#define REG_SET_0x28_0_8_BLACK_LEVEL(ch, val) vd_register_set ( 0 , 0x00 , 0x28 + ch , val , 0 , 8 ) +#define REG_SET_0x58_0_8_SATURATION_A(ch, val) vd_register_set ( 0 , 0x00 , 0x58 + ch , val , 0 , 8 ) +#define REG_SET_0x40_0_8_HUE(ch, val) vd_register_set ( 0 , 0x00 , 0x40 + ch , val , 0 , 8 ) +#define REG_SET_0x44_0_8_U_GAIN(ch, val) vd_register_set ( 0 , 0x00 , 0x44 + ch , val , 0 , 8 ) +#define REG_SET_0x48_0_8_V_GAIN(ch, val) vd_register_set ( 0 , 0x00 , 0x48 + ch , val , 0 , 8 ) +#define REG_SET_0x4C_0_8_U_OFFSET(ch, val) vd_register_set ( 0 , 0x00 , 0x4c + ch , val , 0 , 8 ) +#define REG_SET_0x50_0_8_V_OFFSET(ch, val) vd_register_set ( 0 , 0x00 , 0x50 + ch , val , 0 , 8 ) +#define REG_SET_5x2B_0_8_SATURATION_B(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x2b , val , 0 , 8 ) +#define REG_SET_5x24_0_8_BURSET_DEC_A(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x24 , val , 0 , 8 ) +#define REG_SET_5x5F_0_8_BURSET_DEC_B(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x5f , val , 0 , 8 ) +#define REG_SET_5xD1_0_8_BURSET_DEC_C(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xd1 , val , 0 , 8 ) +#define REG_SET_9x44_0_8_FSC_EXT_EN(ch, val) vd_register_set ( 0 , 0x09 , 0x44 + ch , val , 0 , 8 ) +#define REG_SET_9x50_0_8_FSC_EXT_VAL_7_0(ch, val) vd_register_set ( 0 , 0x09 , 0x50 + (ch*4) , val , 0 , 8 ) +#define REG_SET_9x51_0_8_FSC_EXT_VAL_15_8(ch, val) vd_register_set ( 0 , 0x09 , 0x51 + (ch*4) , val , 0 , 8 ) +#define REG_SET_9x52_0_8_FSC_EXT_VAL_23_16(ch, val) vd_register_set ( 0 , 0x09 , 0x52 + (ch*4) , val , 0 , 8 ) +#define REG_SET_9x53_0_8_FSC_EXT_VAL_31_24(ch, val) vd_register_set ( 0 , 0x09 , 0x53 + (ch*4) , val , 0 , 8 ) +#define REG_SET_5x26_0_8_FSC_LOCK_SENSE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x26 , val , 0 , 8 ) +#define REG_SET_5xB8_0_8_HPLL_MASK_END(ch, val) vd_register_set ( 0 , 0x05 + ch , 0xb8 , val , 0 , 8 ) +#define REG_SET_9x40_0_8_FSC_DET_MODE(ch, val) vd_register_set ( 0 , 0x09 , 0x40 + ch , val , 0 , 8 ) + +// vd_vi_clock_set_seq9 +#define REG_SET_1x84_0_8_CLK_ADC(ch, val) vd_register_set ( 0 , 0x01 , 0x84 + ch , val , 0 , 8 ) +#define REG_SET_1x88_0_8_CLK_PRE(ch, val) vd_register_set ( 0 , 0x01 , 0x88 + ch , val , 0 , 8 ) +#define REG_SET_1x8c_0_8_CLK_POST(ch, val) vd_register_set ( 0 , 0x01 , 0x8c + ch , val , 0 , 8 ) + +#define REG_SET_5x01_0_8_CML_MODE(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x01 , val , 0 , 8 ) +#define REG_SET_5x05_0_8_AGC_OP(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x05 , val , 0 , 8 ) +#define REG_SET_5x1D_0_8_G_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x1D , val , 0 , 8 ) + + +// vd_jaguar1_sw_reset +#define REG_SET_1x81_0_1_VPLL_RST(ch, val) vd_register_set ( 0 , 0x01 , 0x81 , val , 0 , 1 ) +#define REG_SET_1x80_0_1_VPLL_C(ch, val) vd_register_set ( 0 , 0x01 , 0x80 , val , 0 , 1 ) + + +// __eq_base_set_value +#define REG_SET_5x65_0_8_EQ_BYPASS(ch, val) vd_register_set ( 0, 0x05 + ch, 0x65 , val, 0, 8 ) +#define REG_SET_5x58_0_8_EQ_BAND_SEL(ch, val) vd_register_set ( 0, 0x05 + ch, 0x58 , val, 0, 8 ) +#define REG_SET_5x5C_0_8_EQ_GAIN_SEL(ch, val) vd_register_set ( 0 , 0x05 + ch , 0x5c , val , 0 , 8 ) +#define REG_SET_Ax3D_0_8_EQ_DEQ_A_ON(ch, val) vd_register_set ( 0, 0x0a + ((ch%4)/2), 0x3d + (ch%2 * 0x80), val, 0 , 8 ) +#define REG_SET_Ax3C_0_8_EQ_DEQ_A_SEL(ch, val) vd_register_set ( 0 , 0x0a + ((ch%4)/2) , 0x3c + (ch%2 * 0x80), val , 0 , 8 ) +#define REG_SET_9x80_0_8_EQ_DEQ_B_SEL(ch, val) vd_register_set ( 0 , 0x09 , 0x80 + (ch * 0x20) , val , 0 , 8 ) + + +// __eq_coeff_set_value +#define REG_SET_Ax30_0_8_EQ_DEQ_A_01(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x30 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax31_0_8_EQ_DEQ_A_02(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x31 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax32_0_8_EQ_DEQ_A_03(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x32 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax33_0_8_EQ_DEQ_A_04(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x33 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax34_0_8_EQ_DEQ_A_05(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x34 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax35_0_8_EQ_DEQ_A_06(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x35 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax36_0_8_EQ_DEQ_A_07(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x36 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax37_0_8_EQ_DEQ_A_08(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x37 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax38_0_8_EQ_DEQ_A_09(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x38 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax39_0_8_EQ_DEQ_A_10(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x39 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax3A_0_8_EQ_DEQ_A_11(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x3a + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax3B_0_8_EQ_DEQ_A_12(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x3b + (ch%2 * 0x80) , val , 0 , 8 ) + + +// __eq_color_set_value +#define REG_SET_0x24_0_8_EQ_COLOR_CONTRAST(ch, val) vd_register_set( 0, 0x00 , 0x24 + ch , val , 0 , 8 ) +#define REG_SET_0x30_0_8_EQ_COLOR_H_PEAKING_1(ch, val) vd_register_set( 0, 0x00 , 0x30 + ch , val , 0 , 8 ) +#define REG_SET_0x34_0_8_EQ_COLOR_H_PEAKING_2(ch, val) vd_register_set( 0, 0x00 , 0x34 + ch , val , 0 , 8 ) +#define REG_SET_0x40_0_8_EQ_COLOR_HUE(ch, val) vd_register_set( 0, 0x00 , 0x40 + ch , val , 0 , 8 ) +#define REG_SET_0x44_0_8_EQ_COLOR_U_GAIN(ch, val) vd_register_set( 0, 0x00 , 0x44 + ch , val , 0 , 8 ) +#define REG_SET_0x48_0_8_EQ_COLOR_V_GAIN(ch, val) vd_register_set( 0, 0x00 , 0x48 + ch , val , 0 , 8 ) +#define REG_SET_0x4C_0_8_EQ_COLOR_U_OFFSET(ch, val) vd_register_set( 0, 0x00 , 0x4c + ch , val , 0 , 8 ) +#define REG_SET_0x50_0_8_EQ_COLOR_V_OFFSET(ch, val) vd_register_set( 0, 0x00 , 0x50 + ch , val , 0 , 8 ) +#define REG_SET_0x28_0_8_EQ_COLOR_BLACK_LEVEL(ch, val) vd_register_set( 0, 0x00 , 0x28 + ch , val , 0 , 8 ) +#define REG_SET_5x31_0_8_EQ_COLOR_C_FILTER(ch, val) vd_register_set( 0, 0x05 + ch , 0x31 , val , 0 , 8 ) +#define REG_SET_5x27_0_8_EQ_COLOR_ACC_REF(ch, val) vd_register_set( 0, 0x05 + ch , 0x27 , val , 0 , 8 ) +#define REG_SET_5x28_0_8_EQ_COLOR_CTI_DELAY(ch, val) vd_register_set( 0, 0x05 + ch , 0x28 , val , 0 , 8 ) +#define REG_SET_5x2b_0_8_EQ_COLOR_SUB_SATURATION(ch, val) vd_register_set( 0, 0x05 + ch , 0x2b , val , 0 , 8 ) +#define REG_SET_5x24_0_8_EQ_COLOR_BURST_DEC_A(ch, val) vd_register_set( 0, 0x05 + ch , 0x24 , val , 0 , 8 ) +#define REG_SET_5x5F_0_8_EQ_COLOR_BURST_DEC_B(ch, val) vd_register_set( 0, 0x05 + ch , 0x5f , val , 0 , 8 ) +#define REG_SET_5xD1_0_8_EQ_COLOR_BURST_DEC_C(ch, val) vd_register_set( 0, 0x05 + ch , 0xd1 , val , 0 , 8 ) +#define REG_SET_5xD5_0_8_EQ_COLOR_C_OPTION(ch, val) vd_register_set( 0, 0x05 + ch , 0xd5 , val , 0 , 8 ) +#define REG_SET_Ax25_0_8_EQ_COLOR_Y_FILTER_B(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x25 + (ch%2 * 0x80) , val , 0 , 8 ) +#define REG_SET_Ax27_0_8_EQ_COLOR_Y_FILTER_B_SEL(ch, val) vd_register_set( 0, 0x0a + ((ch%4)/2) , 0x27 + (ch%2 * 0x80) , val , 0 , 8 ) + + +// __eq_clk_set_value +#define REG_SET_1x84_0_8_EQ_CLOCK_ADC_CLK(ch, val) vd_register_set( 0, 0x01 , 0x84 + ch , val , 0 , 8 ) +#define REG_SET_1x88_0_8_EQ_CLOCK_PRE_CLK(ch, val) vd_register_set( 0, 0x01 , 0x88 + ch , val , 0 , 8 ) +#define REG_SET_1x8C_0_8_EQ_CLOCK_POST_CLK(ch, val) vd_register_set( 0, 0x01 , 0x8C + ch , val , 0 , 8 ) + + +// eq_timing_b_set_value +#define REG_SET_9x96_0_8_EQ_TIMING_B_HSCALER_1(ch, val) vd_register_set( 0, 0x09 , 0x96 + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x97_0_8_EQ_TIMING_B_HSCALER_2(ch, val) vd_register_set( 0, 0x09 , 0x97 + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x98_0_8_EQ_TIMING_B_HSCALER_3(ch, val) vd_register_set( 0, 0x09 , 0x98 + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x99_0_8_EQ_TIMING_B_HSCALER_4(ch, val) vd_register_set( 0, 0x09 , 0x99 + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x9A_0_8_EQ_TIMING_B_HSCALER_5(ch, val) vd_register_set( 0, 0x09 , 0x9a + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x9B_0_8_EQ_TIMING_B_HSCALER_6(ch, val) vd_register_set( 0, 0x09 , 0x9b + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x9C_0_8_EQ_TIMING_B_HSCALER_7(ch, val) vd_register_set( 0, 0x09 , 0x9c + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x9D_0_8_EQ_TIMING_B_HSCALER_8(ch, val) vd_register_set( 0, 0x09 , 0x9d + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x9E_0_8_EQ_TIMING_B_HSCALER_9(ch, val) vd_register_set( 0, 0x09 , 0x9e + (ch * 0x20) , val , 0 , 8 ) +#define REG_SET_9x40_0_8_EQ_TIMING_B_PN_AUTO(ch, val) vd_register_set( 0, 0x09 , 0x40 + ch , val , 0 , 8 ) +#define REG_SET_5x90_0_8_EQ_TIMINING_B_COMB_MODE(ch, val) vd_register_set( 0, 0x05 + ch , 0x90 , val , 0 , 8 ) +#define REG_SET_5xB9_0_8_EQ_TIMING_B_HPLL_OP_A(ch, val) vd_register_set( 0, 0x05 + ch , 0xb9 , val , 0 , 8 ) +#define REG_SET_5x57_0_8_EQ_TIMING_B_MEM_PATH(ch, val) vd_register_set( 0, 0x05 + ch , 0x57 , val , 0 , 8 ) +#define REG_SET_5x25_0_8_EQ_TIMING_B_FSC_LOCK_SPD(ch, val) vd_register_set( 0, 0x05 + ch , 0x25 , val , 0 , 8 ) +#define REG_SET_0x04_0_8_EQ_TIMING_B_SD_MD(ch, val) vd_register_set( 0, 0x00 , 0x04 + ch , val , 0 , 8 ) +#define REG_SET_0x08_0_8_EQ_TIMING_B_AHD_MD(ch, val) vd_register_set( 0, 0x00 , 0x08 + ch , val , 0 , 8 ) +#define REG_SET_0x0C_0_8_EQ_TIMING_B_SPECIAL_MD(ch, val) vd_register_set( 0, 0x00 , 0x0c + ch , val , 0 , 8 ) +#define REG_SET_0x78_0_8_EQ_TIMING_B_VBLK_END(ch, val) vd_register_set( 0, 0x00 , 0x78 + ch , val , 0 , 8 ) + + +#define REG_SET_5x53_2_2_EQ_SD_LINE_MEM_MD(ch, val) vd_register_set( 0, 0x05 + ch , 0x53 , val , 2 , 2 ) +#define REG_SET_0x14_4_1_EQ_SD_FLD_INV(ch, val) vd_register_set( 0, 0x00 , 0x14 + ch , val , 4 , 1 ) +#define REG_SET_5x2F_7_1_EQ_SD_AUTO(ch, val) vd_register_set( 0, 0x05 + ch , 0x2f , val , 7 , 1 ) +#define REG_SET_0x10_0_8_EQ_VIDEO_FORMAT(ch, val) vd_register_set( 0, 0x00 , 0x10 + ch , val , 0 , 8 ) +#define REG_SET_5x64_0_8_EQ_MEM_RDP(ch, val) vd_register_set( 0, 0x05 + ch , 0x64 + ch , val , 0 , 8 ) +#define REG_SET_5x69_0_1_EQ_SD_FREQ_SEL(ch, val) vd_register_set( 0, 0x05 + ch , 0x69 , val , 0 , 1 ) + +#define REG_SET_0x68_0_8_EQ_TIMING_A_H_DELAY_A(ch, val) vd_register_set( 0, 0x00 , 0x68 + ch , val , 0 , 8 ) +#define REG_SET_5x38_0_8_EQ_TIMING_A_H_DELAY_B(ch, val) vd_register_set( 0, 0x05 + ch , 0x38 , val , 0 , 8 ) +#define REG_SET_0x6C_0_4_EQ_TIMING_A_H_DELAY_C(ch, val) vd_register_set( 0, 0x00 , 0x6C + ch , val , 0 , 4 ) +#define REG_SET_0x64_0_8_EQ_TIMING_A_Y_DELAY(ch, val) vd_register_set( 0, 0x00 , 0x64 + ch , val , 0 , 8 ) + +// ADD +#define REG_SET_0x7C_0_8_HZOOM(ch, val) vd_register_set( 0, 0x00 , 0x7c + ch , val , 0 , 8 ) +#define REG_SET_5x31_0_8_EQ_C_FILTER(ch, val) vd_register_set( 0, 0x05 + ch , 0x31 , val , 0 , 8 ) +#define REG_SET_0x5c_0_8_EQ_PAL_CM_OFF(ch, val) vd_register_set( 0, 0x00 , 0x5c + ch , val , 0 , 8 ) + +#define REG_SET_5x1D_0_8_EQ_AFE_G_SEL(ch, val) vd_register_set( 0, 0x05 + ch , 0x1d , val , 0 , 8 ) +#define REG_SET_5x01_0_8_EQ_AFE_CTR_CLP(ch, val) vd_register_set( 0, 0x05 + ch , 0x01 , val , 0 , 8 ) +#define REG_SET_5x05_0_8_EQ_D_AGC_OPTION(ch, val) vd_register_set( 0, 0x05 + ch , 0x05 , val , 0 , 8 ) + +#define REG_SET_0x70_0_8_V_DELAY(ch, val) vd_register_set( 0, 0x00 , 0x70 + ch , val , 0 , 8 ) + +#define REG_SET_0x14_0_8_FLD_INV_CHID(ch, val) vd_register_set( 0, 0x00, 0x14 + ch, val + ch, 0, 8) +#define REG_SET_0x34_0_8_Y_FIR_MODE(ch, val) vd_register_set( 0, 0x00, 0x34 + ch, val, 0, 8) +#define REG_SET_1xA0_0_8_TM_CLK_EN_SET(ch, val) vd_register_set( 0, 0x01, 0xA0 + ch, val, 0, 8 ) +#define REG_SET_1xCC_0_8_VPORT_OCLK_SEL_VPORT_OVCLK_DLY_SEL(ch, val) vd_register_set( 0, 0x01, 0xCC + ch, val, 0, 8 ) +#define REG_SET_5x21_0_8_CONT_SUB(ch, val) vd_register_set( 0, 0x05 + ch, 0x21, val, 0, 8 ) +#define REG_SET_5x55_0_8_C_MEM_CLK_SEL(ch, val) vd_register_set( 0, 0x05 + ch, 0x55, val, 0, 8 ) +#define REG_SET_5x56_0_8_FREQ_MEM_CLK_SEL(ch, val) vd_register_set( 0, 0x05 + ch, 0x56, val, 0, 8 ) +#define REG_SET_5x57_0_8_LINE_MEM_CLK_INV(ch, val) vd_register_set( 0, 0x05 + ch, 0x57, val, 0, 8 ) +#define REG_SET_5xB5_0_8_HAFC_MASK_SEL(ch, val) vd_register_set( 0, 0x05 + ch, 0xB5, val, 0, 8) +#define REG_SET_5xB8_0_8_HAFC_HCOEFF_SEL(ch, val) vd_register_set( 0, 0x05 + ch, 0xB8, val, 0, 8) + +/******************************************************************** + * End of file + ********************************************************************/ + +#endif diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_v4l2.c b/drivers/media/i2c/jaguar1_drv/jaguar1_v4l2.c new file mode 100644 index 000000000000..55ae5ddc3d81 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_v4l2.c @@ -0,0 +1,959 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * jaguar1 driver + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "jaguar1_common.h" +#include "jaguar1_video.h" +#include "jaguar1_coax_protocol.h" +#include "jaguar1_motion.h" +#include "jaguar1_ioctl.h" +#include "jaguar1_video_eq.h" +#include "jaguar1_mipi.h" +#include "jaguar1_drv.h" + +#define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x0) + +#ifndef V4L2_CID_DIGITAL_GAIN +#define V4L2_CID_DIGITAL_GAIN V4L2_CID_GAIN +#endif + +#define JAGUAR1_XVCLK_FREQ 24000000 +#define JAGUAR1_LINK_FREQ 320000000 +#define JAGUAR1_LANES 4 +#define JAGUAR1_BITS_PER_SAMPLE 8 + +/* pixel rate = link frequency * 2 * lanes / BITS_PER_SAMPLE */ +#define JAGUAR1_PIXEL_RATE \ + (JAGUAR1_LINK_FREQ * 2 / JAGUAR1_BITS_PER_SAMPLE * JAGUAR1_LANES) + +#define OF_CAMERA_PINCTRL_STATE_DEFAULT "rockchip,camera_default" +#define OF_CAMERA_PINCTRL_STATE_SLEEP "rockchip,camera_sleep" + +#define OF_CAMERA_MODULE_REGULATORS "rockchip,regulator-names" +#define OF_CAMERA_MODULE_REGULATOR_VOLTAGES "rockchip,regulator-voltages" + +#define JAGUAR1_NAME "jaguar1" + +/* #define FORCE_720P */ + +struct jaguar1_gpio { + int pltfrm_gpio; + const char *label; + enum of_gpio_flags active_low; +}; + +struct jaguar1_regulator { + struct regulator *regulator; + u32 min_uV; + u32 max_uV; +}; + +struct jaguar1_regulators { + u32 cnt; + struct jaguar1_regulator *regulator; +}; + +struct jaguar1_pixfmt { + u32 code; +}; + +struct jaguar1_framesize { + u16 width; + u16 height; + enum NC_VIVO_CH_FORMATDEF fmt_idx; +}; + +struct jaguar1 { + struct i2c_client *client; + struct clk *xvclk; + struct gpio_desc *rst_gpio; + struct gpio_desc *rst2_gpio; + struct gpio_desc *pd_gpio; + struct gpio_desc *pd2_gpio; + struct gpio_desc *pwd_gpio; + struct gpio_desc *pwd2_gpio; + + struct pinctrl *pinctrl; + struct pinctrl_state *pins_default; + struct pinctrl_state *pins_sleep; + + struct v4l2_subdev subdev; + struct media_pad pad; + struct v4l2_ctrl_handler ctrl_handler; + struct mutex mutex; + bool power_on; + struct jaguar1_regulators regulators; + + u32 module_index; + const char *module_facing; + const char *module_name; + const char *len_name; + + struct v4l2_mbus_framefmt format; + const struct jaguar1_framesize *frame_size; + int streaming; +}; + +#define to_jaguar1(sd) container_of(sd, struct jaguar1, subdev) + +static const struct jaguar1_framesize jaguar1_framesizes[] = { +#ifdef FORCE_720P + { + .width = 1280, + .height = 720, + .fmt_idx = AHD20_720P_25P, + } +#elif defined CONFIG_VIDEO_ROCKCHIP_USBACM_CONTROL + { + .width = 2560, + .height = 1440, + .fmt_idx = AHD20_720P_25P, + } +#else + { + .width = 1280, + .height = 720, + .fmt_idx = AHD20_720P_25P, + }, + { + .width = 1920, + .height = 1080, + .fmt_idx = AHD20_1080P_25P, + }, + { + .width = 2560, + .height = 1440, + .fmt_idx = AHD20_720P_25P, + } +#endif +}; + +static const struct jaguar1_pixfmt jaguar1_formats[] = { + { + .code = MEDIA_BUS_FMT_YUYV8_2X8 + }, +}; + +static const s64 link_freq_menu_items[] = { + JAGUAR1_LINK_FREQ +}; +static int __jaguar1_power_on(struct jaguar1 *jaguar1) +{ + u32 i; + int ret; + struct jaguar1_regulator *regulator; + struct device *dev = &jaguar1->client->dev; + + if (!IS_ERR_OR_NULL(jaguar1->pins_default)) { + ret = pinctrl_select_state(jaguar1->pinctrl, + jaguar1->pins_default); + if (ret < 0) + dev_err(dev, "could not set pins. ret=%d\n", ret); + } + + ret = clk_prepare_enable(jaguar1->xvclk); + if (ret < 0) { + dev_err(dev, "Failed to enable xvclk\n"); + return ret; + } + + if (jaguar1->regulators.regulator) { + for (i = 0; i < jaguar1->regulators.cnt; i++) { + regulator = jaguar1->regulators.regulator + i; + if (IS_ERR(regulator->regulator)) + continue; + regulator_set_voltage( + regulator->regulator, + regulator->min_uV, + regulator->max_uV); + if (regulator_enable(regulator->regulator)) { + dev_err(dev, + "regulator_enable failed!\n"); + goto disable_clk; + } + } + } + usleep_range(3000, 5000); + + if (!IS_ERR(jaguar1->pwd_gpio)) { + gpiod_direction_output(jaguar1->pwd_gpio, 1); + usleep_range(3000, 5000); + } + + if (!IS_ERR(jaguar1->pwd2_gpio)) { + gpiod_direction_output(jaguar1->pwd2_gpio, 1); + usleep_range(3000, 5000); + } + + if (!IS_ERR(jaguar1->pd_gpio)) { + gpiod_direction_output(jaguar1->pd_gpio, 1); + usleep_range(1500, 2000); + } + + if (!IS_ERR(jaguar1->pd2_gpio)) { + gpiod_direction_output(jaguar1->pd2_gpio, 1); + usleep_range(1500, 2000); + } + + if (!IS_ERR(jaguar1->rst_gpio)) { + gpiod_direction_output(jaguar1->rst_gpio, 0); + usleep_range(1500, 2000); + gpiod_direction_output(jaguar1->rst_gpio, 1); + } + + if (!IS_ERR(jaguar1->rst2_gpio)) { + gpiod_direction_output(jaguar1->rst2_gpio, 0); + usleep_range(1500, 2000); + gpiod_direction_output(jaguar1->rst2_gpio, 1); + } + + return 0; + +disable_clk: + clk_disable_unprepare(jaguar1->xvclk); + + return ret; +} + +static void __jaguar1_power_off(struct jaguar1 *jaguar1) +{ + u32 i; + int ret; + struct jaguar1_regulator *regulator; + struct device *dev = &jaguar1->client->dev; + + if (!IS_ERR(jaguar1->pd_gpio)) + gpiod_direction_output(jaguar1->pd_gpio, 0); + + if (!IS_ERR(jaguar1->pd2_gpio)) + gpiod_direction_output(jaguar1->pd2_gpio, 0); + + clk_disable_unprepare(jaguar1->xvclk); + + if (!IS_ERR(jaguar1->rst_gpio)) + gpiod_direction_output(jaguar1->rst_gpio, 0); + + if (!IS_ERR(jaguar1->rst2_gpio)) + gpiod_direction_output(jaguar1->rst2_gpio, 0); + + if (!IS_ERR(jaguar1->pwd_gpio)) + gpiod_direction_output(jaguar1->pwd_gpio, 0); + + if (!IS_ERR(jaguar1->pwd2_gpio)) + gpiod_direction_output(jaguar1->pwd2_gpio, 0); + + if (!IS_ERR_OR_NULL(jaguar1->pins_sleep)) { + ret = pinctrl_select_state(jaguar1->pinctrl, + jaguar1->pins_sleep); + if (ret < 0) + dev_err(dev, "could not set pins\n"); + } + + if (jaguar1->regulators.regulator) { + for (i = 0; i < jaguar1->regulators.cnt; i++) { + regulator = jaguar1->regulators.regulator + i; + if (IS_ERR(regulator->regulator)) + continue; + regulator_disable(regulator->regulator); + } + } +} + +static int jaguar1_power(struct v4l2_subdev *sd, int on) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + int ret = 0; + + dev_dbg(&client->dev, "%s: on %d\n", __func__, on); + mutex_lock(&jaguar1->mutex); + + /* If the power state is not modified - no work to do. */ + if (jaguar1->power_on == !!on) + goto exit; + + if (on) { + ret = __jaguar1_power_on(jaguar1); + if (ret < 0) + goto exit; + + jaguar1->power_on = true; + } else { + __jaguar1_power_off(jaguar1); + jaguar1->power_on = false; + } + +exit: + mutex_unlock(&jaguar1->mutex); + + return ret; +} + +static int jaguar1_initialize_controls(struct jaguar1 *jaguar1) +{ + struct v4l2_ctrl_handler *handler; + struct v4l2_ctrl *ctrl; + int ret; + + handler = &jaguar1->ctrl_handler; + ret = v4l2_ctrl_handler_init(handler, 2); + if (ret) + return ret; + handler->lock = &jaguar1->mutex; + + ctrl = v4l2_ctrl_new_int_menu(handler, NULL, V4L2_CID_LINK_FREQ, + 0, 0, link_freq_menu_items); + if (ctrl) + ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; + + v4l2_ctrl_new_std(handler, NULL, V4L2_CID_PIXEL_RATE, + 0, JAGUAR1_PIXEL_RATE, 1, JAGUAR1_PIXEL_RATE); + + if (handler->error) { + ret = handler->error; + dev_err(&jaguar1->client->dev, + "Failed to init controls(%d)\n", ret); + goto err_free_handler; + } + + jaguar1->subdev.ctrl_handler = handler; + + return 0; + +err_free_handler: + v4l2_ctrl_handler_free(handler); + + return ret; +} +static void jaguar1_get_default_format(struct v4l2_mbus_framefmt *format) +{ + format->width = jaguar1_framesizes[0].width; + format->height = jaguar1_framesizes[0].height; + format->colorspace = V4L2_COLORSPACE_SRGB; + format->code = jaguar1_formats[0].code; + format->field = V4L2_FIELD_NONE; +} + +static int jaguar1_stream(struct v4l2_subdev *sd, int on) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + video_init_all video_init; + enum NC_VIVO_CH_FORMATDEF fmt_idx; + int ch; + + dev_dbg(&client->dev, "%s: on %d\n", __func__, on); + mutex_lock(&jaguar1->mutex); + on = !!on; + + if (jaguar1->streaming == on) + goto unlock; + + if (on) { + jaguar1_set_mclk(JAGUAR1_MCLK_1242MHZ); + fmt_idx = jaguar1->frame_size->fmt_idx; + for (ch = 0; ch < 4; ch++) { + video_init.ch_param[ch].ch = ch; + video_init.ch_param[ch].format = fmt_idx; + video_init.ch_param[ch].input = SINGLE_ENDED; + video_init.ch_param[ch].interface = YUV_422; + } + jaguar1_start(&video_init); + } else { + jaguar1_stop(); + } + + jaguar1->streaming = on; + +unlock: + mutex_unlock(&jaguar1->mutex); + + return 0; +} + +static int jaguar1_enum_mbus_code(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_mbus_code_enum *code) +{ + if (code->index >= ARRAY_SIZE(jaguar1_formats)) + return -EINVAL; + + code->code = jaguar1_formats[code->index].code; + + return 0; +} + +static int jaguar1_enum_frame_sizes(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_frame_size_enum *fse) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + int i = ARRAY_SIZE(jaguar1_formats); + + dev_dbg(&client->dev, "%s:\n", __func__); + + if (fse->index >= ARRAY_SIZE(jaguar1_framesizes)) + return -EINVAL; + + while (--i) + if (fse->code == jaguar1_formats[i].code) + break; + + fse->code = jaguar1_formats[i].code; + + fse->min_width = jaguar1_framesizes[fse->index].width; + fse->max_width = fse->min_width; + fse->max_height = jaguar1_framesizes[fse->index].height; + fse->min_height = fse->max_height; + + return 0; +} + +static int jaguar1_g_mbus_config(struct v4l2_subdev *sd, + struct v4l2_mbus_config *cfg) +{ + cfg->type = V4L2_MBUS_CSI2; + cfg->flags = V4L2_MBUS_CSI2_4_LANE | + V4L2_MBUS_CSI2_CHANNELS; + + return 0; +} + +static int jaguar1_get_fmt(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_format *fmt) +{ + struct i2c_client *client = v4l2_get_subdevdata(sd); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + + if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { +#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API + struct v4l2_mbus_framefmt *mf; + + mf = v4l2_subdev_get_try_format(sd, cfg, 0); + mutex_lock(&jaguar1->mutex); + fmt->format = *mf; + mutex_unlock(&jaguar1->mutex); + return 0; +#else + return -ENOTTY; +#endif + } + + mutex_lock(&jaguar1->mutex); + fmt->format = jaguar1->format; + mutex_unlock(&jaguar1->mutex); + + dev_dbg(&client->dev, "%s: %x %dx%d\n", __func__, + jaguar1->format.code, jaguar1->format.width, + jaguar1->format.height); + + return 0; +} + +static void __jaguar1_try_frame_size(struct v4l2_mbus_framefmt *mf, + const struct jaguar1_framesize **size) +{ + const struct jaguar1_framesize *fsize = &jaguar1_framesizes[0]; + const struct jaguar1_framesize *match = NULL; + int i = ARRAY_SIZE(jaguar1_framesizes); + unsigned int min_err = UINT_MAX; + + while (i--) { + unsigned int err = abs(fsize->width - mf->width) + + abs(fsize->height - mf->height); + if (err < min_err) { + min_err = err; + match = fsize; + } + fsize++; + } + + if (!match) + match = &jaguar1_framesizes[0]; + + mf->width = match->width; + mf->height = match->height; + + if (size) + *size = match; +} + +static int jaguar1_set_fmt(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_format *fmt) +{ + int index = ARRAY_SIZE(jaguar1_formats); + struct v4l2_mbus_framefmt *mf = &fmt->format; + const struct jaguar1_framesize *size = NULL; + struct jaguar1 *jaguar1 = to_jaguar1(sd); + int ret = 0; + + __jaguar1_try_frame_size(mf, &size); + + while (--index >= 0) + if (jaguar1_formats[index].code == mf->code) + break; + + if (index < 0) + return -EINVAL; + + mf->colorspace = V4L2_COLORSPACE_SRGB; + mf->code = jaguar1_formats[index].code; + mf->field = V4L2_FIELD_NONE; + + mutex_lock(&jaguar1->mutex); + + if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { +#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API + mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad); + *mf = fmt->format; +#else + return -ENOTTY; +#endif + } else { + if (jaguar1->streaming) { + mutex_unlock(&jaguar1->mutex); + return -EBUSY; + } + + jaguar1->frame_size = size; + jaguar1->format = fmt->format; + } + + mutex_unlock(&jaguar1->mutex); + return ret; +} + +static void jaguar1_get_module_inf(struct jaguar1 *jaguar1, + struct rkmodule_inf *inf) +{ + memset(inf, 0, sizeof(*inf)); + strlcpy(inf->base.sensor, JAGUAR1_NAME, sizeof(inf->base.sensor)); + strlcpy(inf->base.module, jaguar1->module_name, + sizeof(inf->base.module)); + strlcpy(inf->base.lens, jaguar1->len_name, sizeof(inf->base.lens)); +} + +static long jaguar1_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) +{ + struct jaguar1 *jaguar1 = to_jaguar1(sd); + long ret = 0; + + switch (cmd) { + case RKMODULE_GET_MODULE_INFO: + jaguar1_get_module_inf(jaguar1, (struct rkmodule_inf *)arg); + break; + default: + ret = -ENOTTY; + break; + } + + return ret; +} + +#ifdef CONFIG_COMPAT +static long jaguar1_compat_ioctl32(struct v4l2_subdev *sd, + unsigned int cmd, unsigned long arg) +{ + void __user *up = compat_ptr(arg); + struct rkmodule_inf *inf; + struct rkmodule_awb_cfg *cfg; + long ret; + + switch (cmd) { + case RKMODULE_GET_MODULE_INFO: + inf = kzalloc(sizeof(*inf), GFP_KERNEL); + if (!inf) { + ret = -ENOMEM; + return ret; + } + + ret = jaguar1_ioctl(sd, cmd, inf); + if (!ret) + ret = copy_to_user(up, inf, sizeof(*inf)); + kfree(inf); + break; + case RKMODULE_AWB_CFG: + cfg = kzalloc(sizeof(*cfg), GFP_KERNEL); + if (!cfg) { + ret = -ENOMEM; + return ret; + } + + ret = copy_from_user(cfg, up, sizeof(*cfg)); + if (!ret) + ret = jaguar1_ioctl(sd, cmd, cfg); + kfree(cfg); + break; + default: + ret = -ENOIOCTLCMD; + break; + } + + return ret; +} +#endif + +static int jaguar1_runtime_resume(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + + return __jaguar1_power_on(jaguar1); +} + +static int jaguar1_runtime_suspend(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + + __jaguar1_power_off(jaguar1); + + return 0; +} + +static const struct dev_pm_ops jaguar1_pm_ops = { + SET_RUNTIME_PM_OPS(jaguar1_runtime_suspend, + jaguar1_runtime_resume, NULL) +}; + +static const struct v4l2_subdev_video_ops jaguar1_video_ops = { + .s_stream = jaguar1_stream, + .g_mbus_config = jaguar1_g_mbus_config, +}; + +static const struct v4l2_subdev_pad_ops jaguar1_subdev_pad_ops = { + .enum_mbus_code = jaguar1_enum_mbus_code, + .enum_frame_size = jaguar1_enum_frame_sizes, + .get_fmt = jaguar1_get_fmt, + .set_fmt = jaguar1_set_fmt, +}; + +static const struct v4l2_subdev_core_ops jaguar1_core_ops = { + .s_power = jaguar1_power, + .ioctl = jaguar1_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl32 = jaguar1_compat_ioctl32, +#endif +}; + +static const struct v4l2_subdev_ops jaguar1_subdev_ops = { + .core = &jaguar1_core_ops, + .video = &jaguar1_video_ops, + .pad = &jaguar1_subdev_pad_ops, +}; + +static int jaguar1_analyze_dts(struct jaguar1 *jaguar1) +{ + int ret; + int elem_size, elem_index; + const char *str = ""; + struct property *prop; + struct jaguar1_regulator *regulator; + struct device *dev = &jaguar1->client->dev; + struct device_node *np = of_node_get(dev->of_node); + + jaguar1->xvclk = devm_clk_get(dev, "xvclk"); + if (IS_ERR(jaguar1->xvclk)) { + dev_err(dev, "Failed to get xvclk\n"); + return -EINVAL; + } + ret = clk_set_rate(jaguar1->xvclk, JAGUAR1_XVCLK_FREQ); + if (ret < 0) { + dev_err(dev, "Failed to set xvclk rate (24MHz)\n"); + return ret; + } + if (clk_get_rate(jaguar1->xvclk) != JAGUAR1_XVCLK_FREQ) + dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n"); + + jaguar1->pinctrl = devm_pinctrl_get(dev); + if (!IS_ERR(jaguar1->pinctrl)) { + jaguar1->pins_default = + pinctrl_lookup_state(jaguar1->pinctrl, + OF_CAMERA_PINCTRL_STATE_DEFAULT); + if (IS_ERR(jaguar1->pins_default)) + dev_err(dev, "could not get default pinstate\n"); + + jaguar1->pins_sleep = + pinctrl_lookup_state(jaguar1->pinctrl, + OF_CAMERA_PINCTRL_STATE_SLEEP); + if (IS_ERR(jaguar1->pins_sleep)) + dev_err(dev, "could not get sleep pinstate\n"); + } else { + dev_err(dev, "no pinctrl\n"); + } + + elem_size = of_property_count_elems_of_size( + np, + OF_CAMERA_MODULE_REGULATOR_VOLTAGES, + sizeof(u32)); + prop = of_find_property( + np, + OF_CAMERA_MODULE_REGULATORS, + NULL); + if (elem_size > 0 && !IS_ERR_OR_NULL(prop)) { + jaguar1->regulators.regulator = + devm_kzalloc(&jaguar1->client->dev, + elem_size * sizeof(struct jaguar1_regulator), + GFP_KERNEL); + if (!jaguar1->regulators.regulator) + dev_err(dev, "could not malloc jaguar1_regulator\n"); + + jaguar1->regulators.cnt = elem_size; + + str = NULL; + elem_index = 0; + regulator = jaguar1->regulators.regulator; + if (regulator) { + do { + str = of_prop_next_string(prop, str); + if (!str) { + dev_err(dev, "%s is not match %s in dts\n", + OF_CAMERA_MODULE_REGULATORS, + OF_CAMERA_MODULE_REGULATOR_VOLTAGES); + break; + } + regulator->regulator = + devm_regulator_get_optional(dev, str); + if (IS_ERR(regulator->regulator)) + dev_err(dev, "devm_regulator_get %s failed\n", + str); + of_property_read_u32_index( + np, + OF_CAMERA_MODULE_REGULATOR_VOLTAGES, + elem_index++, + ®ulator->min_uV); + regulator->max_uV = regulator->min_uV; + regulator++; + } while (--elem_size); + } + } + + jaguar1->pd_gpio = devm_gpiod_get(dev, "pd", GPIOD_OUT_LOW); + if (IS_ERR(jaguar1->pd_gpio)) + dev_warn(dev, "can not find pd-gpios, error %ld\n", + PTR_ERR(jaguar1->pd_gpio)); + + jaguar1->pd2_gpio = devm_gpiod_get(dev, "pd2", GPIOD_OUT_LOW); + if (IS_ERR(jaguar1->pd2_gpio)) + dev_warn(dev, "can not find pd2-gpios, error %ld\n", + PTR_ERR(jaguar1->pd2_gpio)); + + jaguar1->rst_gpio = devm_gpiod_get(dev, "rst", GPIOD_OUT_LOW); + if (IS_ERR(jaguar1->rst_gpio)) + dev_warn(dev, "can not find rst-gpios, error %ld\n", + PTR_ERR(jaguar1->rst_gpio)); + + jaguar1->rst2_gpio = devm_gpiod_get(dev, "rst2", GPIOD_OUT_LOW); + if (IS_ERR(jaguar1->rst2_gpio)) + dev_warn(dev, "can not find rst2-gpios, error %ld\n", + PTR_ERR(jaguar1->rst2_gpio)); + + jaguar1->pwd_gpio = devm_gpiod_get(dev, "pwd", GPIOD_OUT_HIGH); + if (IS_ERR(jaguar1->pwd_gpio)) + dev_warn(dev, "can not find pwd-gpios, error %ld\n", + PTR_ERR(jaguar1->pwd_gpio)); + + jaguar1->pwd2_gpio = devm_gpiod_get(dev, "pwd2", GPIOD_OUT_HIGH); + if (IS_ERR(jaguar1->pwd2_gpio)) + dev_warn(dev, "can not find pwd2-gpios, error %ld\n", + PTR_ERR(jaguar1->pwd2_gpio)); + + return 0; +} + +static int jaguar1_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct device *dev = &client->dev; + struct device_node *node = dev->of_node; + struct jaguar1 *jaguar1; + struct v4l2_subdev *sd; + __maybe_unused char facing[2]; + int ret; + + dev_info(dev, "driver version: %02x.%02x.%02x", + DRIVER_VERSION >> 16, + (DRIVER_VERSION & 0xff00) >> 8, + DRIVER_VERSION & 0x00ff); + + jaguar1 = devm_kzalloc(dev, sizeof(*jaguar1), GFP_KERNEL); + if (!jaguar1) + return -ENOMEM; + + ret = of_property_read_u32(node, RKMODULE_CAMERA_MODULE_INDEX, + &jaguar1->module_index); + ret |= of_property_read_string(node, RKMODULE_CAMERA_MODULE_FACING, + &jaguar1->module_facing); + ret |= of_property_read_string(node, RKMODULE_CAMERA_MODULE_NAME, + &jaguar1->module_name); + ret |= of_property_read_string(node, RKMODULE_CAMERA_LENS_NAME, + &jaguar1->len_name); + if (ret) { + dev_err(dev, "could not get %s!\n", RKMODULE_CAMERA_LENS_NAME); + return -EINVAL; + } + + jaguar1->client = client; + + ret = jaguar1_analyze_dts(jaguar1); + if (ret) { + dev_err(dev, "Failed to analyze dts\n"); + return ret; + } + + mutex_init(&jaguar1->mutex); + jaguar1_get_default_format(&jaguar1->format); + jaguar1->frame_size = &jaguar1_framesizes[0]; + + sd = &jaguar1->subdev; + v4l2_i2c_subdev_init(sd, client, &jaguar1_subdev_ops); + ret = jaguar1_initialize_controls(jaguar1); + + __jaguar1_power_on(jaguar1); + ret = jaguar1_init(i2c_adapter_id(client->adapter)); + if (ret) { + dev_err(dev, "Failed to init jaguar1\n"); + __jaguar1_power_off(jaguar1); + mutex_destroy(&jaguar1->mutex); + + return ret; + } + +#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API + sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; +#endif + +#if defined(CONFIG_VIDEO_ROCKCHIP_USBACM_CONTROL) + __jaguar1_power_off(jaguar1); + mutex_destroy(&jaguar1->mutex); + + return 0; +#endif + +#if defined(CONFIG_MEDIA_CONTROLLER) + jaguar1->pad.flags = MEDIA_PAD_FL_SOURCE; + sd->entity.function = MEDIA_ENT_F_CAM_SENSOR; + ret = media_entity_pads_init(&sd->entity, 1, &jaguar1->pad); + if (ret < 0) + goto err_power_off; +#endif + + memset(facing, 0, sizeof(facing)); + if (strcmp(jaguar1->module_facing, "back") == 0) + facing[0] = 'b'; + else + facing[0] = 'f'; + + snprintf(sd->name, sizeof(sd->name), "m%02d_%s_%s %s", + jaguar1->module_index, facing, + JAGUAR1_NAME, dev_name(sd->dev)); + + ret = v4l2_async_register_subdev_sensor_common(sd); + if (ret) { + dev_err(dev, "v4l2 async register subdev failed\n"); + goto err_clean_entity; + } + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + pm_runtime_idle(dev); + + return 0; + +err_power_off: + __jaguar1_power_off(jaguar1); +err_clean_entity: +#if defined(CONFIG_MEDIA_CONTROLLER) + media_entity_cleanup(&sd->entity); +#endif + mutex_destroy(&jaguar1->mutex); + + return ret; +} + +static int jaguar1_remove(struct i2c_client *client) +{ + struct v4l2_subdev *sd = i2c_get_clientdata(client); + struct jaguar1 *jaguar1 = to_jaguar1(sd); + + jaguar1_exit(); + v4l2_ctrl_handler_free(&jaguar1->ctrl_handler); + mutex_destroy(&jaguar1->mutex); + + pm_runtime_disable(&client->dev); + if (!pm_runtime_status_suspended(&client->dev)) + __jaguar1_power_off(jaguar1); + pm_runtime_set_suspended(&client->dev); + + return 0; +} + +#if IS_ENABLED(CONFIG_OF) +static const struct of_device_id jaguar1_of_match[] = { + { .compatible = "jaguar1-v4l2" }, + {}, +}; +MODULE_DEVICE_TABLE(of, jaguar1_of_match); +#endif + +static const struct i2c_device_id jaguar1_match_id[] = { + { "jaguar1-v4l2", 0 }, + { }, +}; + +static struct i2c_driver jaguar1_i2c_driver = { + .driver = { + .name = JAGUAR1_NAME, + .pm = &jaguar1_pm_ops, + .of_match_table = of_match_ptr(jaguar1_of_match), + }, + .probe = &jaguar1_probe, + .remove = &jaguar1_remove, + .id_table = jaguar1_match_id, +}; + +static int __init sensor_mod_init(void) +{ + return i2c_add_driver(&jaguar1_i2c_driver); +} + +static void __exit sensor_mod_exit(void) +{ + i2c_del_driver(&jaguar1_i2c_driver); +} + +device_initcall_sync(sensor_mod_init); +module_exit(sensor_mod_exit); + +MODULE_DESCRIPTION("jaguar1 sensor driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_video.c b/drivers/media/i2c/jaguar1_drv/jaguar1_video.c new file mode 100644 index 000000000000..e5ba86abf682 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_video.c @@ -0,0 +1,945 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_input.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#include +#include +#include "jaguar1_common.h" +#include "jaguar1_video.h" +#include "jaguar1_video_eq.h" +#include "jaguar1_video_table.h" +#include "jaguar1_coax_protocol.h" +#include "jaguar1_reg_set_def.h" + + +static unsigned char cur_bank = 0xff; +static int print_flag = 0; + +/************************************************************************************** + * Jaguar1 Video Input initialize value get from table + ***************************************************************************************/ +static NC_VD_VI_Init_STR *__NC_VD_VI_Init_Val_Get( NC_VIVO_CH_FORMATDEF def ) +{ + NC_VD_VI_Init_STR *pRet = &vd_vi_init_list[def]; + if( pRet == NULL ) + { + printk("[DRV]vd_vi_init_list Not Supported format Yet!!!(%d)\n",def); + } + return pRet; +} + +static NC_VD_VO_Init_STR *__NC_VD_VO_Init_Val_Get( NC_VIVO_CH_FORMATDEF def ) +{ + NC_VD_VO_Init_STR *pRet = &vd_vo_init_list[def]; + if( pRet == NULL ) + { + printk("[DRV]vd_vo_init_list Not Supported format Yet!!!(%d)\n",def); + } + return pRet; +} + +/************************************************************************************** + * Jaguar1 Register Setting Function + * + * + ***************************************************************************************/ +void reg_val_print_flag_set( int set ) +{ + print_flag = set; +} + +static int reg_val_print_flag_get( void ) +{ + return print_flag; +} + +void current_bank_set( unsigned char bank ) +{ + cur_bank = bank; +} + +unsigned char current_bank_get( void ) +{ + return cur_bank; +} + +void vd_register_set( int dev, unsigned char bank, unsigned char addr, unsigned char val, int pos, int size ) +{ + unsigned char ReadVal = 0x00; + unsigned char Mask = 0x00; + unsigned char rstbit = 0x01; + unsigned char WriteVal = val; + unsigned char cur_bank = 0x00; + int ii =0; + + if( 8 < (pos + size) ) + { + printk("vd_register_set Error!!dev[%d] Bank[0x%02X] Addr[0x%02X] pos[%d] size[%d]\n", dev, bank, addr, pos, size); + } + + // Current Bank Get + cur_bank = current_bank_get(); + if( cur_bank != bank ) + { + JAGUAR1_BANK_CHANGE(bank); + current_bank_set(bank); + } + + // If Data Size 8 Bit, Register Read Skip + if( !(pos == 0 && size == 8) ) + { + for(ii=0; ii 0x%02X\n", current_bank_get(), addr, WriteVal); + +} + +/************************************************************************************** + * Jaguar1 Video Input Setting Function + * + * + ***************************************************************************************/ +static void vd_vi_manual_set_seq1( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*==================================================================== + * Bank 1x7c + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | CLK_AUTO_4 | CLK_AUTO_3 | CLK_AUTO_2 | CLK_AUTO_1 | + *====================================================================*/ + /*==================================================================== + * Bank 0x14 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | FLD_INV_x | CHID_VIN_x | + *====================================================================*/ + /*==================================================================== + * Bank 0x14 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | FLD_INV_x | CHID_VIN_x | + *====================================================================*/ + /*==================================================================== + * Bank 5x32 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | FLD_DET_MODE | | | NOVID_DET_A | + *====================================================================*/ + /*==================================================================== + * Bank 13x30 ~ 33 - SK_ing + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | |det_en |det_en |det_en |det_en |det_en |det_en | + *====================================================================*/ + /*==================================================================== + * Bank 9x44 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | | | |FSC_EXT_EN_1 | + *====================================================================*/ + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + unsigned char val_13x30; + unsigned char val_13x31; + unsigned char val_13x32; + + if(ch == 0) + REG_SET_1x7C_0_1_clk_auto_1( ch, 0x0 ); + else if(ch ==1) + REG_SET_1x7C_1_1_clk_auto_2( ch, 0x0 ); + else if(ch ==2) + REG_SET_1x7C_2_1_clk_auto_3( ch, 0x0 ); + else if(ch ==3) + REG_SET_1x7C_3_1_clk_auto_4( ch, 0x0 ); + else + printk("[DRV]Clock Auto Set Fail!!:: %x\n", ch); + + REG_SET_5x32_0_8_NOVIDEO_DET_A( ch, 0x10 ); + REG_SET_5xB9_0_8_HAFC_LPF_SEL( ch, 0xb2 ); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xFF, 0x13); + val_13x30 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x30); + val_13x31 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x31); + val_13x32 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x32); + + val_13x30 &= (~(1 << (ch + 4)) & (~(1 << ch))); + val_13x31 &= (~(1 << (ch + 4)) & (~(1 << ch))); + val_13x32 &= (~(1 << ch)); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x30, val_13x30); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x31, val_13x31); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x32, val_13x32); + + REG_SET_9x44_0_8_FSC_EXT_EN( ch, 0x00 ); + REG_SET_5x6E_0_8_VBLK_END_SEL( ch, param->vblk_end_sel ); + REG_SET_5x6F_0_8_VBLK_END_EXT( ch, param->vblk_end_ext ); + +} + +static void vd_vi_vafe_set_seq2( unsigned char dev, unsigned char ch ) +{ + REG_SET_5x00_0_8_A_CMP_PW_MODE( ch, 0xd0 ); + REG_SET_5x02_0_8_A_CMP_TIMEUNIT( ch, 0x0c ); + REG_SET_5x1E_0_8_VAFEMD( ch, 0x00 ); + REG_SET_5x58_0_8_VAFE1_EQ_BAND_SEL( ch, 0x00 ); + REG_SET_5x59_0_8_LPF_BYPASS( ch, 0x00 ); + REG_SET_5x5A_0_8_VAFE_IMP_CNT( ch, 0x00 ); + REG_SET_5x5B_0_8_VAFE_DUTY( ch, 0x41 ); + REG_SET_5x5C_0_8_VAFE_B_LPF_SEL( ch, 0x78 ); + REG_SET_5x94_0_8_PWM_DELAY_H( ch, 0x00 ); + REG_SET_5x95_0_8_PWM_DELAY_L( ch, 0x00 ); + REG_SET_5x65_0_8_VAFE_CML_SPEED( ch, 0x80 ); + +} + +static void vd_vi_format_set_seq3( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 0x10 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | BSF_MODE_1 | VIDEO_FORMAT_1 | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x0c + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | SPECIAL_MODE | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x04 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | SD_MD | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x08 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | AHD_MD | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x69 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| NO_VIDEO_OFF | | OUTPUT PATTERN_ON | MEM_EN | | | | SD_FREQ_SEL | + *============================================================================================*/ + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + if(ch>3) + { + printk("[DRV] %s CHID Error\n", __func__); + return; + } + + REG_SET_0x10_0_8_VD_FMT( ch, param->video_format ); + REG_SET_0x0C_0_8_SPL_MODE( ch, param->spl_mode ); + REG_SET_0x04_0_8_SD_MODE( ch, param->sd_mode ); + REG_SET_0x08_0_8_AHD_MODE( ch, param->ahd_mode ); + REG_SET_5x69_0_1_SD_FREQ_SEL( ch, param->sd_freq_sel ); + REG_SET_5x62_0_8_SYNC_SEL( ch, param->sync_sel ); + +} + +static void vd_vi_chroma_set_seq4( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 0x5c + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| PAL_CM_OFF | | | COLOROFF | C_KILL | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x28 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| CTI_CORE_MODE | S_POINT | CTI_DELAY_SEL | | | | | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x25 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| FSC_LOCK_MODE | FSC_LOCK_SPD | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x90 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| C_LH_SEL_1 | | YL_SEL_1 | COMB_MODE_1 | + *============================================================================================*/ + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + if(ch>3) + { + printk("[DRV] %s CHID Error\n", __func__); + return; + } + + REG_SET_0x5C_0_8_PAL_CM_OFF( ch, param->pal_cm_off ); + REG_SET_5x28_0_8_S_POINT( ch, param->s_point ); + REG_SET_5x25_0_8_FSC_LOCK_MODE( ch, param->fsc_lock_mode ); + REG_SET_5x90_0_8_COMB_MODE( ch, param->comb_mode ); + +} + +static void vd_vi_h_timing_set_seq5( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 0x68 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| H_DELAY | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x60 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | Y_DELAY | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x78 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| VBLK_END | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x38 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | MASK_ON | MASK_SEL1 (Bank0 0x8E[3:0) | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x64 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| DF_CDELAY | DF_YDELAY | + *============================================================================================*/ + /*============================================================================================ + * Bank 0x14 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | FLD_INV | CHID_VIN | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x64 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | MEM_RDP_01 | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x47 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| CONTROL_MODES | + *============================================================================================*/ + /*============================================================================================ + * Bank 5xa9 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| SIGNED_ADV_STP_DELAY1 | ADV_STP_DELAY1 | + *============================================================================================*/ + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + if(ch>3) + { + printk("[DRV] %s CHID Error\n", __func__); + return; + } + + REG_SET_0x68_0_8_H_DLY_LSB( ch, param->h_delay_lsb ); + REG_SET_0x6c_0_8_H_DLY_MSB( ch, param->h_dly_msb); + REG_SET_0x60_0_8_Y_DLY( ch, param->y_delay ); + REG_SET_0x78_0_8_V_BLK_END_A( ch, param->v_blk_end_a ); + + REG_SET_5x38_4_1_H_MASK_ON( ch, param->h_mask_on ); + REG_SET_5x38_0_4_H_MASK_SEL( ch, param->h_mask_sel ); + + REG_SET_0x64_0_8_V_BLK_END_B( ch, param->v_blk_end_b ); + REG_SET_0x14_4_1_FLD_INV( ch, param->fld_inv ); + + REG_SET_5x64_0_8_MEM_RDP( ch, param->mem_rdp ); + REG_SET_5x47_0_8_SYNC_RS( ch, param->sync_rs ); + REG_SET_5xA9_0_8_V_BLK_END_B( ch, param->v_blk_end_b ); + +} + +static void vd_vi_h_scaler_mode_set_seq6( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 5x53 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | PROTECTION_OFF | BT_601_SEL | LINEMEM_MD | | C_DITHER_ON | + *============================================================================================*/ + /*============================================================================================ + * Bank 9x96 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | CH1_H_DOWN_SCALER_EN | | | CH1_H_SCALER_TRS_SEL | CH1_H_SCALER_ENABLE | + *============================================================================================*/ + /*============================================================================================ + * Bank 9x97 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| CH1_H_SCALER_MODE | CH1_H_SCALER_RD_MODE | CH1_H_SCALER_AUTO_H_REF | CH1_H_SCALER_AUTO | + *============================================================================================*/ + /*============================================================================================ + * Bank 9x98 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| CH1_H_SCALER_H_REF_BASE[7:0] | + * Bank 9x99 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| CH1_H_SCALER_H_REF_BASE[15:8] | + *============================================================================================*/ + + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + if(ch>3) + { + printk("[DRV] %s CHID Error\n", __func__); + return; + } + + REG_SET_5x53_2_2_LINEMEM_MD( ch, param->line_mem_mode ); + + REG_SET_9x96_0_8_H_DOWN_SCALER( ch, param->h_down_scaler ); + REG_SET_9x97_0_8_H_SCALER_MODE( ch, param->h_scaler_mode ); + REG_SET_9x98_0_8_REF_BASE_LSB( ch, param->ref_base_lsb ); + REG_SET_9x99_0_8_REF_BASE_MSB( ch, param->ref_base_msb ); + REG_SET_9x9E_0_8_H_SCALER_OUTPUT_H_ACTIVE( ch, param->h_scaler_active ); +} + +static void vd_vi_hpll_set_seq7( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 5x50 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | NCO_GDF_COEFF_IV | | NCO_GDF_COEFF_OFF | Y_TEMP_SEL(5T,15T) | HPLL_MASK_ON | CONT_SUB | + *============================================================================================*/ + /*============================================================================================ + * Bank 5xb8 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| HAFC_BYPASS | HAFC_HCOEFF_SEL | HAFC_OP_MD | + *============================================================================================*/ + /*============================================================================================ + * Bank 5xbb + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| HPLL_MASK_END | + *============================================================================================*/ + /*============================================================================================ + * Bank 5xbb + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| HAFC_BYP_TH_S(write) | + *============================================================================================*/ + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + if(ch>3) + { + printk("[DRV] %s CHID Error\n", __func__); + return; + } + + REG_SET_5x50_0_8_HPLL_MASK_ON( ch, param->hpll_mask_on ); + REG_SET_5xB8_0_8_HAFC_OP_MD( ch, param->hafc_op_md ); + REG_SET_5xBB_0_8_HAFC_BYP_TH_E( ch, param->hafc_byp_th_e ); + REG_SET_5xB7_0_8_HAFC_BYP_TH_S( ch, param->hafc_byp_th_s ); + +} + +static void vd_vi_color_set_seq8( unsigned char dev, unsigned char ch, void *p_param, NC_VIVO_CH_FORMATDEF fmt ) +{ + /*============================================================================================ + * gpio_i2c_write(jaguar1_i2c_addr[dev], 0x22 + (ch*4), 0x0B ); // Raptor3 + * Bank 0x5c + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| PAL_CM_OFF | | | COLOROFF | C_KILL | + *============================================================================================*/ + /*============================================================================================ + * Bank 5x26 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| FSC_LOCK_SENSE | + *============================================================================================*/ + /*============================================================================================ + * Bank 5xb8 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| HAFC_BYPASS | HAFC_HCOEFF_SEL | HAFC_OP_MD | + *============================================================================================*/ + /*============================================================================================ + * Bank 9x40 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| FSC_DET_ | FSC_DET_ | FSC_DET_ | FSC_DET_ | FSC_DET_ | FSC_DET_ | | FSC_RST_ | + *| AUTO_RST1 | UNLIM1 | AUTO1 | PRESET1 | MODE1 | REFER_AUTO1 | | STRB1 | + *============================================================================================*/ + + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + REG_SET_0x20_0_8_BRIGHTNESS( ch, param->brightnees ); + REG_SET_0x24_0_8_CONTARST( ch, param->contrast ); + REG_SET_0x28_0_8_BLACK_LEVEL( ch, param->black_level ); + REG_SET_0x58_0_8_SATURATION_A( ch, param->saturation_a ); + REG_SET_0x40_0_8_HUE( ch, param->hue ); + REG_SET_0x44_0_8_U_GAIN( ch, param->u_gain ); + REG_SET_0x48_0_8_V_GAIN( ch, param->v_gain ); + REG_SET_0x4C_0_8_U_OFFSET( ch, param->u_offset ); + REG_SET_0x50_0_8_V_OFFSET( ch, param->v_offset ); + REG_SET_5x2B_0_8_SATURATION_B( ch, param->saturation_b ); + REG_SET_5x24_0_8_BURSET_DEC_A( ch, param->burst_dec_a ); + REG_SET_5x5F_0_8_BURSET_DEC_B( ch, param->burst_dec_b ); + REG_SET_5xD1_0_8_BURSET_DEC_C( ch, param->burst_dec_c ); + + REG_SET_9x44_0_8_FSC_EXT_EN( ch, 0x00 ); + REG_SET_9x50_0_8_FSC_EXT_VAL_7_0( ch, 0x30 ); + REG_SET_9x51_0_8_FSC_EXT_VAL_15_8( ch, 0x6f ); + REG_SET_9x52_0_8_FSC_EXT_VAL_23_16( ch, 0x67 ); + REG_SET_9x53_0_8_FSC_EXT_VAL_31_24( ch, 0x48 ); + + if(fmt == TVI_5M_12_5P) + { + REG_SET_5x26_0_8_FSC_LOCK_SENSE( ch, 0x20 ); + } + else + REG_SET_5x26_0_8_FSC_LOCK_SENSE( ch, 0x40 ); + + if(fmt == AHD20_SD_H960_2EX_Btype_NT || fmt == AHD20_SD_H960_2EX_Btype_PAL) + { + REG_SET_5xB8_0_8_HPLL_MASK_END( ch, 0xb8 ); + REG_SET_9x40_0_8_FSC_DET_MODE( ch, 0x00); + } + else + { + REG_SET_5xB8_0_8_HPLL_MASK_END( ch, 0x39 ); + REG_SET_9x40_0_8_FSC_DET_MODE( ch, 0x00 ); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x05 + ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xb5, 0x80); // HPLL Locking Ref. Range + } + +} + +static void vd_vi_clock_set_seq9( unsigned char dev, unsigned char ch, void *p_param ) +{ + /*============================================================================================ + * Bank 1x84 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| VADC_CLK1_DLY_SEL | VADC_CLK1_SEL | + *============================================================================================*/ + /*============================================================================================ + * Bank 1x88 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | | | DEC_PRECLK | + * Bank 1x8c + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | | | DEC_POSTCLK | + *============================================================================================*/ + /*============================================================================================ + * ADC -> PRE -> POST -> VCLK + * ADC_CLK 1x84[3:0] + * 0 ~ 3 : 37.125 MHz + * 4 ~ 5 : 74.25 MHz + * 8 ~ 9 : 148.5 MHz + * Pre_Clock 1x88 / Post Clock 1x8C + * 0 : 37.125 + * 1 : 74.25 + * 2 : 148.5 + * VCLK 1xCC[7:4] + * 4 ~ 5 : 74.25 MHz + * 6 ~ 7 : 148.5 MHz + *============================================================================================*/ + + NC_VD_VI_Init_STR *param = (NC_VD_VI_Init_STR*)p_param; + + REG_SET_1x84_0_8_CLK_ADC( ch, param->clk_adc ); + REG_SET_1x88_0_8_CLK_PRE( ch, param->clk_pre ); + REG_SET_1x8c_0_8_CLK_POST( ch, param->clk_post ); + + REG_SET_5x01_0_8_CML_MODE( ch, param->cml_mode ); + REG_SET_5x05_0_8_AGC_OP( ch, param->agc_op ); + REG_SET_5x1D_0_8_G_SEL( ch, param->g_sel ); + +} + +//================================================================================================================== + +/************************************************************************************** + * Jaguar1 Video Output Setting Function + * + * + ***************************************************************************************/ +void vd_vo_seq_set( unsigned char dev, unsigned char ch, void *p_param ) +{ + /* + * BT656 or BT1120 Set????... + * */ + NC_VD_VO_Init_STR *param = (NC_VD_VO_Init_STR*)p_param; + + // BANK 1 + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xFF, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xc0 + (ch * 0x02), param->port_seq_ch01[ch]); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xc1 + (ch * 0x02), param->port_seq_ch23[ch]); + +} + +static void vd_vo_output_seq_set( unsigned char dev, unsigned char port, unsigned char out_ch ) +{ + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xFF, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xc0 + (port * 0x02), out_ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xc1 + (port * 0x02), out_ch); +} + +static void vd_vo_port_y_c_merge_set( unsigned char dev, unsigned char ch, void *p_param) +{ + NC_VD_VO_Init_STR *param = (NC_VD_VO_Init_STR*)p_param; + + /*============================================================================================ + * Address: 1xec + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | | | | MUX_YC_MERGE1 | + *============================================================================================*/ + REG_SET_1xEC_0_8_yc_merge( ch, param->mux_yc_merge ); + +} + +static void vd_vo_port_ch_id_set( unsigned char dev, unsigned char ch, void *p_param ) +{ + NC_VD_VO_Init_STR *param = (NC_VD_VO_Init_STR*)p_param; + unsigned char val_0x14 = 0x00; + + /*============================================================================================ + * Address: 0x14 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | FLD_INV_1 | CHID_VIN1 | + *============================================================================================*/ + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xFF, 0x00); + val_0x14 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x14 + ch); + val_0x14 = val_0x14 & 0x10; + val_0x14 = val_0x14 | param->chid_vin; + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x14 + ch, val_0x14); + +} + +static void vd_vo_mux_mode_set( unsigned char dev, unsigned char ch, void *p_param ) +{ + NC_VD_VO_Init_STR *param = (NC_VD_VO_Init_STR*)p_param; + + /*============================================================================================ + * Address: 1xc8 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | VCLK_1_EN | VDO_1_EN | VPORT_1_CH_OUT_SEL | + *============================================================================================*/ + REG_SET_1xC8_0_8_out_sel( ch , param->vport_out_sel ); + +} + +static void vd_vo_manual_mode_set(unsigned char dev, unsigned char ch, void *p_param ) +{ + //NC_VD_VO_Init_STR *param = (NC_VD_VO_Init_STR*)p_param; + + unsigned char val_0x30; + unsigned char val_0x31; + unsigned char val_0x32; + + /*============================================================================================ + * Address: 13x30 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | | | NOVIDEO_VFC_INIT_EN[3:0] | | | | + *============================================================================================*/ + /*============================================================================================ + * Address: 13x31 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | AHD_8M_det_en | AHD_5M_det_en | AHD_4M_det_en | AHD_3M_det_en | AHD_2M_det_en | AHD_1M_det_en | + *============================================================================================*/ + /*============================================================================================ + * Address: 13x32 + *| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | + *| | | CVI_8M_det_en | CVI_5M_det_en | CVI_4M_det_en | CVI_3M_det_en | CVI_2M_det_en | CVI_1M_det_en | + *============================================================================================*/ + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xFF, 0x13); + val_0x30 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x30); + val_0x31 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x31); + val_0x32 = gpio_i2c_read(jaguar1_i2c_addr[dev], 0x32); + + val_0x30 &= (~(1 << (ch + 4)) & (~(1 << ch))); + val_0x31 &= (~(1 << (ch + 4)) & (~(1 << ch))); + val_0x32 &= (~(1 << ch)); + + // 0x00 Set Test + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x30, val_0x30); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x31, val_0x31); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x32, val_0x32); + +} + +static void vd_jaguar1_single_differ_set( unsigned char dev, unsigned char ch, int input ) +{ + REG_SET_0x18_0_8_EX_CBAR_ON( ch, 0x13 ); + + if( input == DIFFERENTIAL ) + { + REG_SET_5x00_0_8_CMP( ch, 0xd0 ); + REG_SET_5x01_0_8_CML( ch, 0x2c ); + REG_SET_5x1D_0_8_AFE( ch, 0x8c ); + REG_SET_5x92_0_8_PWM( ch, 0x00 ); + } + else if( input == SINGLE_ENDED ) + { + REG_SET_5x00_0_8_CMP( ch, 0xd0 ); + REG_SET_5x01_0_8_CML( ch, 0xa2 ); + //REG_SET_5x1D_0_8_AFE( ch, 0x00 ); + REG_SET_5x92_0_8_PWM( ch, 0x00 ); + } + else + { + printk("Jaguar1 Analog Input Setting Fail !!!\n"); + } + +} + +static void vd_jaguar1_960p_30P_test_set( unsigned char dev, unsigned char ch ) +{ + printk("[drv]vd_jaguar1_960p_30P_test_set >>> ch%d!!\n", ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x68 + ch, 0x4E); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x69 + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6a + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6b + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x04 + ch, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x08 + ch, 0x02); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0c + ch, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x18 + ch, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x64 + ch, 0x06); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x84 + ch, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x88 + ch, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x8c + ch, 0x02); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x05 + ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6e, 0x10); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6f, 0x82); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x76, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x77, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x78, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x79, 0x11); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xB5, 0x80); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x11); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x00 + ( ch * 0x20 ), 0x0f); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x01 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x02 + ( ch * 0x20 ), 0x9d); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x03 + ( ch * 0x20 ), 0x05); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x04 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x05 + ( ch * 0x20 ), 0x08); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x06 + ( ch * 0x20 ), 0xca); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0a + ( ch * 0x20 ), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0b + ( ch * 0x20 ), 0xc0); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0c + ( ch * 0x20 ), 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0d + ( ch * 0x20 ), 0x4b); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x10 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x11 + ( ch * 0x20 ), 0x96); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x12 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x13 + ( ch * 0x20 ), 0x82); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x14 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x15 + ( ch * 0x20 ), 0x30); + +} + +static void vd_jaguar1_960p_25P_test_set( unsigned char dev, unsigned char ch ) +{ + printk("[drv]vd_jaguar1_960p_25P_test_set >>> ch%d!!\n", ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x68 + ch, 0x59); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x69 + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6a + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6b + ch, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x04 + ch, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x08 + ch, 0x03); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0c + ch, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x18 + ch, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x64 + ch, 0x06); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x84 + ch, 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x88 + ch, 0x01); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x8c + ch, 0x02); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x05 + ch); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6e, 0x10); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x6f, 0x82); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x76, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x77, 0x80); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x78, 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x79, 0x11); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xB5, 0x80); + + // Only AHD20_720P_960P_25P + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x09); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x53 + (ch * 0x04), 0x52); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x52 + (ch * 0x04), 0xd2); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x51 + (ch * 0x04), 0x1c); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x50 + (ch * 0x04), 0x10); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x44 + ch, 0x01); + + gpio_i2c_write(jaguar1_i2c_addr[dev], 0xff, 0x11); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x00 + ( ch * 0x20 ), 0x0f); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x01 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x02 + ( ch * 0x20 ), 0x97); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x03 + ( ch * 0x20 ), 0x05); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x04 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x05 + ( ch * 0x20 ), 0x0a); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x06 + ( ch * 0x20 ), 0x8c); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0a + ( ch * 0x20 ), 0x03); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0b + ( ch * 0x20 ), 0xc0); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0c + ( ch * 0x20 ), 0x04); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x0d + ( ch * 0x20 ), 0x4c); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x10 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x11 + ( ch * 0x20 ), 0x96); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x12 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x13 + ( ch * 0x20 ), 0x82); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x14 + ( ch * 0x20 ), 0x00); + gpio_i2c_write(jaguar1_i2c_addr[dev], 0x15 + ( ch * 0x20 ), 0x30); + +} + +/***************************************************************************************************************************************** + * Jaguar1 Video ioctl function + * video vi_vo initialize + * + ******************************************************************************************************************************************/ +void vd_jaguar1_vo_ch_seq_set( void *p_param) +{ + video_output_init *vo_seq = (video_output_init*)p_param; + unsigned char dev = 0; + unsigned char port = vo_seq->port; + unsigned char out_ch = vo_seq->out_ch; + + vd_vo_output_seq_set( dev, port, out_ch ); +} + +void vd_jaguar1_init_set( void *p_param ) +{ + video_input_init *video_init = (video_input_init*)p_param; + unsigned char ch = video_init->ch % 4; + unsigned char fmt = video_init->format; + int analog_input = video_init->input; + + video_equalizer_info_s eq_set; + NC_VD_COAX_STR coax_init; + NC_VD_VI_Init_STR *vi_param; + NC_VD_VO_Init_STR *vo_param; + + int dev = ch / 4 ; //{0x64, 0x60, 0x62, 0x66}// + + vi_param = __NC_VD_VI_Init_Val_Get(fmt); + vo_param = __NC_VD_VO_Init_Val_Get(AHD20_1080P_30P); + + // Each_Mode_Set + REG_SET_0x00_0_8_EACH_SET(ch, 0x10); + /*===================================================== + * vd_Analog Input Setting + *=====================================================*/ + vd_jaguar1_single_differ_set(dev, ch, analog_input); + + /*===================================================== + * vd_vo Setting + *=====================================================*/ + vd_vo_port_y_c_merge_set( dev, ch, vo_param ); + vd_vo_mux_mode_set( dev, ch, vo_param ); + vd_vo_manual_mode_set(dev, ch, vo_param); + + /*===================================================== + * vd_vi Setting + *=====================================================*/ + + vd_vi_manual_set_seq1( dev, ch, vi_param ); + vd_vi_vafe_set_seq2( dev, ch ); + vd_vi_format_set_seq3( dev, ch, vi_param ); + vd_vi_chroma_set_seq4( dev, ch, vi_param ); + vd_vi_h_timing_set_seq5( dev, ch, vi_param ); + vd_vi_h_scaler_mode_set_seq6( dev, ch, vi_param ); + + vd_vi_hpll_set_seq7( dev, ch, vi_param ); + vd_vi_color_set_seq8( dev, ch, vi_param, fmt); + vd_vo_port_ch_id_set( dev, ch, vo_param ); + vd_vi_clock_set_seq9( dev, ch, vi_param ); + + /*===================================================== + * AHD 1280x960P Test + * + *=====================================================*/ + if( fmt == AHD20_720P_960P_30P ) + { + vd_jaguar1_960p_30P_test_set( 0, ch); + current_bank_set(0xFF); + } + else if( fmt == AHD20_720P_960P_25P) + { + vd_jaguar1_960p_25P_test_set( 0, ch); + current_bank_set(0xFF); + } + else if( fmt == AHD20_SD_H960_2EX_Btype_PAL ) + { + REG_SET_0x70_0_8_V_DELAY( ch, 0x3F ); + } + else if( fmt == AHD20_SD_SH720_PAL || fmt == AHD20_SD_SH720_NT || fmt == AHD20_SD_H1440_PAL || fmt == AHD20_SD_H1440_NT ) + { + REG_SET_0x14_0_8_FLD_INV_CHID(ch, 0x00); + REG_SET_0x34_0_8_Y_FIR_MODE(ch, 0x00); + REG_SET_1xCC_0_8_VPORT_OCLK_SEL_VPORT_OVCLK_DLY_SEL(ch, 0x40); + REG_SET_1xA0_0_8_TM_CLK_EN_SET(ch, 0x10); + REG_SET_5x21_0_8_CONT_SUB(ch, 0x24); + REG_SET_5x55_0_8_C_MEM_CLK_SEL(ch, 0x00); + REG_SET_5x56_0_8_FREQ_MEM_CLK_SEL(ch, 0x00); + REG_SET_5x57_0_8_LINE_MEM_CLK_INV(ch, 0x00); + REG_SET_5xB5_0_8_HAFC_MASK_SEL(ch, 0x00); + REG_SET_5xB8_0_8_HAFC_HCOEFF_SEL(ch, 0x39); + REG_SET_0x7C_0_8_HZOOM(ch, 0x8F); + } + else + printk("\n"); + + printk("[drv_vi]ch::%d >>> fmt::%s\n", ch, vi_param->name); + + /*===================================================== + * EQ Stage 0 Setting + * + *=====================================================*/ +#if 1 + eq_set.Ch = ch; + eq_set.FmtDef = fmt; + eq_set.Cable = CABLE_A; + eq_set.Input = SINGLE_ENDED; + eq_set.stage = STAGE_0; + video_input_eq_val_set( &eq_set ); +#endif + + printk("[drv_vi]ch::%d >>> fmt::%s\n", ch, vi_param->name); + current_bank_set(0xFF); + + /*===================================================== + * Coaxial Initialize + * + *=====================================================*/ + coax_init.ch = ch; + coax_init.vivo_fmt = fmt; + coax_init.vd_dev = dev; + coax_tx_init( &coax_init ); + if(acp_mode_enable == 0) + coax_tx_16bit_init( &coax_init ); + coax_rx_init( &coax_init ); + +} + +void vd_jaguar1_get_novideo( video_video_loss_s *vidloss ) +{ + gpio_i2c_write(jaguar1_i2c_addr[vidloss->devnum], 0xFF, 0x00); + vidloss->videoloss = gpio_i2c_read(jaguar1_i2c_addr[vidloss->devnum], 0xA0); +} + +void vd_jaguar1_sw_reset( void *p_param ) +{ + //video_input_init *sw_rst = (video_input_init*)p_param; + + REG_SET_1x81_0_1_VPLL_RST( 0, 0x1 ); + REG_SET_1x80_0_1_VPLL_C( 0, 0x1 ); + REG_SET_1x80_0_1_VPLL_C( 0, 0x0 ); + REG_SET_1x81_0_1_VPLL_RST( 0, 0x0 ); + printk("[drv]jaguar1_sw_reset complete!!\n"); +} + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_video.h b/drivers/media/i2c/jaguar1_drv/jaguar1_video.h new file mode 100644 index 000000000000..777037de5ad3 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_video.h @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_input.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_VIDEO_ +#define _JAGUAR1_VIDEO_ + +#include "jaguar1_common.h" + + +/* =============================================== + * APP -> DRV + * =============================================== */ +typedef struct _video_input_init{ + unsigned char ch; + unsigned char format; + unsigned char dist; + unsigned char input; + unsigned char val; + unsigned char interface; +}video_input_init; + +typedef struct _video_init_all{ + video_input_init ch_param[4]; +}video_init_all; + +typedef struct _video_output_init{ + unsigned char format; + unsigned char port; + unsigned char out_ch; + unsigned char interface; +}video_output_init; + +typedef struct _video_video_loss_s{ + unsigned char devnum; + unsigned char videoloss; + unsigned char reserve2; +} video_video_loss_s; + +extern unsigned int acp_mode_enable; + +void vd_jaguar1_init_set( void *p_param); +void vd_jaguar1_vo_ch_seq_set( void *p_param); +void vd_jaguar1_eq_set( void *p_param ); +void vd_jaguar1_sw_reset( void *p_param ); +void vd_jaguar1_get_novideo( video_video_loss_s *vidloss ); + +void current_bank_set( unsigned char bank ); +unsigned char current_bank_get( void ); +void vd_register_set( int dev, unsigned char bank, unsigned char addr, unsigned char val, int pos, int size ); +void reg_val_print_flag_set( int set ); + +void vd_vo_seq_set( unsigned char dev, unsigned char ch, void *p_param ); +#endif +/******************************************************************** + * End of file + ********************************************************************/ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.c b/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.c new file mode 100644 index 000000000000..5f9fe91e1296 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.c @@ -0,0 +1,260 @@ +// SPDX-License-Identifier: GPL-2.0 +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_auto_detect.c + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#include +#include + +#include "jaguar1_common.h" +#include "jaguar1_video_eq.h" +#include "jaguar1_cableA_video_eq_table.h" +#include "jaguar1_reg_set_def.h" +#include "jaguar1_video.h" + +//extern unsigned int jaguar1_i2c_addr[4]; + + +static NC_JAGUAR1_EQ NC_VD_EQ_FindFormatDef( NC_VIVO_CH_FORMATDEF format_standard, NC_ANALOG_INPUT analog_input ) +{ + int ii; + + for(ii=0;iivideo_fmt == format_standard ) + if( pFmt->analog_input == analog_input ) + return ii; + } + + printk("NC_VD_EQ_FindFormatDef UNKNOWN format!!!\n"); + + return NC_EQ_SETTING_FMT_UNKNOWN; +} + +static void __eq_base_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_base_s *pbase ) +{ + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_5x65_0_8_EQ_BYPASS( ch, pbase->eq_bypass[dist] ); + REG_SET_5x58_0_8_EQ_BAND_SEL( ch, pbase->eq_band_sel[dist] ); + REG_SET_5x5C_0_8_EQ_GAIN_SEL( ch, pbase->eq_gain_sel[dist] ); + REG_SET_Ax3D_0_8_EQ_DEQ_A_ON( ch, pbase->deq_a_on[dist] ); + REG_SET_Ax3C_0_8_EQ_DEQ_A_SEL( ch, pbase->deq_a_sel[dist] ); + +} + +static void __eq_coeff_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_coeff_s *pcoeff ) +{ + + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_Ax30_0_8_EQ_DEQ_A_01( ch, pcoeff->deqA_01[dist] ); + REG_SET_Ax31_0_8_EQ_DEQ_A_02( ch, pcoeff->deqA_02[dist] ); + REG_SET_Ax32_0_8_EQ_DEQ_A_03( ch, pcoeff->deqA_03[dist] ); + REG_SET_Ax33_0_8_EQ_DEQ_A_04( ch, pcoeff->deqA_04[dist] ); + REG_SET_Ax34_0_8_EQ_DEQ_A_05( ch, pcoeff->deqA_05[dist] ); + REG_SET_Ax35_0_8_EQ_DEQ_A_06( ch, pcoeff->deqA_06[dist] ); + REG_SET_Ax36_0_8_EQ_DEQ_A_07( ch, pcoeff->deqA_07[dist] ); + REG_SET_Ax37_0_8_EQ_DEQ_A_08( ch, pcoeff->deqA_08[dist] ); + REG_SET_Ax38_0_8_EQ_DEQ_A_09( ch, pcoeff->deqA_09[dist] ); + REG_SET_Ax39_0_8_EQ_DEQ_A_10( ch, pcoeff->deqA_10[dist] ); + REG_SET_Ax3A_0_8_EQ_DEQ_A_11( ch, pcoeff->deqA_11[dist] ); + REG_SET_Ax3B_0_8_EQ_DEQ_A_12( ch, pcoeff->deqA_12[dist] ); + +} + +static void __eq_color_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_color_s *pcolor ) +{ + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_0x24_0_8_EQ_COLOR_CONTRAST( ch, pcolor->contrast[dist] ); + REG_SET_0x30_0_8_EQ_COLOR_H_PEAKING_1( ch, pcolor->y_peaking_mode[dist] ); + REG_SET_0x34_0_8_EQ_COLOR_H_PEAKING_2( ch, pcolor->y_fir_mode[dist] ); + + + REG_SET_5x31_0_8_EQ_COLOR_C_FILTER( ch, pcolor->c_filter[dist] ); + + + REG_SET_0x5c_0_8_EQ_PAL_CM_OFF( ch, pcolor->pal_cm_off[dist] ); + + REG_SET_0x40_0_8_EQ_COLOR_HUE( ch, pcolor->hue[dist] ); + REG_SET_0x44_0_8_EQ_COLOR_U_GAIN( ch, pcolor->u_gain[dist] ); + REG_SET_0x48_0_8_EQ_COLOR_V_GAIN( ch, pcolor->v_gain[dist] ); + REG_SET_0x4C_0_8_EQ_COLOR_U_OFFSET( ch, pcolor->u_offset[dist] ); + REG_SET_0x50_0_8_EQ_COLOR_V_OFFSET( ch, pcolor->v_offset[dist] ); + REG_SET_0x28_0_8_EQ_COLOR_BLACK_LEVEL( ch, pcolor->black_level[dist] ); + + REG_SET_5x27_0_8_EQ_COLOR_ACC_REF( ch, pcolor->acc_ref[dist] ); + REG_SET_5x28_0_8_EQ_COLOR_CTI_DELAY( ch, pcolor->cti_delay[dist] ); + REG_SET_5x2b_0_8_EQ_COLOR_SUB_SATURATION( ch, pcolor->saturation_b[dist] ); + REG_SET_5x24_0_8_EQ_COLOR_BURST_DEC_A( ch, pcolor->burst_dec_a[dist] ); + REG_SET_5x5F_0_8_EQ_COLOR_BURST_DEC_B( ch, pcolor->burst_dec_b[dist] ); + REG_SET_5xD1_0_8_EQ_COLOR_BURST_DEC_C( ch, pcolor->burst_dec_c[dist] ); + REG_SET_5xD5_0_8_EQ_COLOR_C_OPTION( ch, pcolor->c_option[dist] ); + REG_SET_Ax25_0_8_EQ_COLOR_Y_FILTER_B( ch, pcolor->y_filter_b[dist] ); + REG_SET_Ax27_0_8_EQ_COLOR_Y_FILTER_B_SEL( ch, pcolor->y_filter_b_sel[dist] ); + +} + +static void __eq_timing_a_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_timing_a_s *ptiming_a ) +{ + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_0x68_0_8_EQ_TIMING_A_H_DELAY_A(ch, ptiming_a->h_delay_a[dist] ); + REG_SET_5x38_0_8_EQ_TIMING_A_H_DELAY_B(ch, ptiming_a->h_delay_b[dist] ); + REG_SET_0x6C_0_4_EQ_TIMING_A_H_DELAY_C(ch, ptiming_a->h_delay_c[dist] ); + + REG_SET_0x64_0_8_EQ_TIMING_A_Y_DELAY(ch , ptiming_a->y_delay[dist] ); + +} + +static void __eq_clk_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_clk_s *pclk ) +{ + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_1x84_0_8_EQ_CLOCK_ADC_CLK( ch, pclk->clk_adc[dist] ); + REG_SET_1x88_0_8_EQ_CLOCK_PRE_CLK( ch, pclk->clk_adc_pre[dist] ); + REG_SET_1x8C_0_8_EQ_CLOCK_POST_CLK( ch, pclk->clk_adc_post[dist] ); + +} +static void __eq_timing_b_set_value( video_equalizer_info_s *pvin_eq_set, video_equalizer_timing_b_s *ptiming_b ) +{ + unsigned char ch = pvin_eq_set->Ch; + unsigned char dist = pvin_eq_set->stage; + + REG_SET_9x96_0_8_EQ_TIMING_B_HSCALER_1( ch, ptiming_b->h_scaler1[dist] ); + REG_SET_9x97_0_8_EQ_TIMING_B_HSCALER_2( ch, ptiming_b->h_scaler2[dist] ); + REG_SET_9x98_0_8_EQ_TIMING_B_HSCALER_3( ch, ptiming_b->h_scaler3[dist] ); + REG_SET_9x99_0_8_EQ_TIMING_B_HSCALER_4( ch, ptiming_b->h_scaler4[dist] ); + REG_SET_9x9A_0_8_EQ_TIMING_B_HSCALER_5( ch, ptiming_b->h_scaler5[dist] ); + REG_SET_9x9B_0_8_EQ_TIMING_B_HSCALER_6( ch, ptiming_b->h_scaler6[dist] ); + REG_SET_9x9C_0_8_EQ_TIMING_B_HSCALER_7( ch, ptiming_b->h_scaler7[dist] ); + REG_SET_9x9D_0_8_EQ_TIMING_B_HSCALER_8( ch, ptiming_b->h_scaler8[dist] ); + REG_SET_9x9E_0_8_EQ_TIMING_B_HSCALER_9( ch, ptiming_b->h_scaler9[dist] ); + REG_SET_9x40_0_8_EQ_TIMING_B_PN_AUTO( ch, ptiming_b->pn_auto[dist] ); + REG_SET_5x90_0_8_EQ_TIMINING_B_COMB_MODE( ch, ptiming_b->comb_mode[dist] ); + REG_SET_5xB9_0_8_EQ_TIMING_B_HPLL_OP_A( ch, ptiming_b->h_pll_op_a[dist] ); + REG_SET_5x57_0_8_EQ_TIMING_B_MEM_PATH( ch, ptiming_b->mem_path[dist] ); + REG_SET_5x25_0_8_EQ_TIMING_B_FSC_LOCK_SPD( ch, ptiming_b->fsc_lock_speed[dist] ); + + REG_SET_0x04_0_8_EQ_TIMING_B_SD_MD( ch, ptiming_b->sd_mode[dist] ); + REG_SET_0x08_0_8_EQ_TIMING_B_AHD_MD( ch, ptiming_b->ahd_mode[dist] ); + REG_SET_0x0C_0_8_EQ_TIMING_B_SPECIAL_MD( ch, ptiming_b->spl_mode[dist] ); + REG_SET_0x78_0_8_EQ_TIMING_B_VBLK_END( ch, ptiming_b->vblk_end[dist] ); + + REG_SET_5x1D_0_8_EQ_AFE_G_SEL( ch, ptiming_b->afe_g_sel[dist] ); + REG_SET_5x01_0_8_EQ_AFE_CTR_CLP( ch, ptiming_b->afe_ctr_clp[dist] ); + REG_SET_5x05_0_8_EQ_D_AGC_OPTION( ch, ptiming_b->d_agc_option[dist] ); + +} + +void video_input_eq_val_set(video_equalizer_info_s *pvin_eq_set) +{ + NC_JAGUAR1_EQ eq_fmt; + unsigned char ch = pvin_eq_set->Ch; + int fmt = pvin_eq_set->FmtDef; + int input = pvin_eq_set->Input; + int cable = pvin_eq_set->Cable; + /* int stage = pvin_eq_set->stage; */ + _jaguar1_video_eq_value_table_s eq_value; + + // printk("[drv_eq]ch%d >> fmt(%d) cable(%d) stage(%d) input(%d)\n", ch, fmt, cable, stage, input); + eq_fmt = NC_VD_EQ_FindFormatDef( fmt, input ); + + if( cable == CABLE_A ) + eq_value = (_jaguar1_video_eq_value_table_s)equalizer_value_fmtdef_cableA[eq_fmt]; + else if( cable == CABLE_B ) + eq_value = (_jaguar1_video_eq_value_table_s)equalizer_value_fmtdef_cableA[eq_fmt]; + else if( cable == CABLE_C ) + eq_value = (_jaguar1_video_eq_value_table_s)equalizer_value_fmtdef_cableA[eq_fmt]; + else if( cable == CABLE_D ) + eq_value = (_jaguar1_video_eq_value_table_s)equalizer_value_fmtdef_cableA[eq_fmt]; + else + eq_value = (_jaguar1_video_eq_value_table_s)equalizer_value_fmtdef_cableA[eq_fmt]; + + if( eq_value.name == NULL ) + { + printk("[drv_eq]Error - Unknown EQ Table!!\n"); + return; + } + else + { + /* set_eq_value */ + __eq_base_set_value( pvin_eq_set, &eq_value.eq_base ); + __eq_coeff_set_value( pvin_eq_set, &eq_value.eq_coeff ); + __eq_color_set_value( pvin_eq_set, &eq_value.eq_color); + __eq_timing_a_set_value( pvin_eq_set, &eq_value.eq_timing_a ); + __eq_clk_set_value( pvin_eq_set, &eq_value.eq_clk ); + __eq_timing_b_set_value( pvin_eq_set, &eq_value.eq_timing_b ); + + if( AHD20_SD_H960_2EX_Btype_NT_SINGLE_ENDED || AHD20_SD_H960_2EX_Btype_NT_DIFFERENTIAL ) + { + + } + else if( AHD20_SD_H960_2EX_Btype_PAL_SINGLE_ENDED || AHD20_SD_H960_2EX_Btype_PAL_DIFFERENTIAL ) + { + + } + else + { + + } + printk("[drv_eq]ch::%d >>> fmt::%s\n", ch, eq_value.name); + } +} + + +void video_input_eq_cable_set(video_equalizer_info_s *pvin_eq_set) +{ + unsigned char ch = pvin_eq_set->Ch; + int cable = pvin_eq_set->Cable; + + printk("[DRV]video_input_eq_cable_set::ch(%d) cable(%d)\n", ch, cable ); +} + +void video_input_eq_analog_input_set(video_equalizer_info_s *pvin_eq_set) +{ + unsigned char ch = pvin_eq_set->Ch; + int input = pvin_eq_set->Input; + + REG_SET_0x18_0_8_EX_CBAR_ON( ch, 0x13 ); + + if( input == DIFFERENTIAL ) + { + REG_SET_5x00_0_8_CMP( ch, 0xd0 ); + REG_SET_5x01_0_8_CML( ch, 0x2c ); + REG_SET_5x1D_0_8_AFE( ch, 0x8c ); + REG_SET_5x92_0_8_PWM( ch, 0x00 ); + } + else if( input == SINGLE_ENDED ) + { + REG_SET_5x00_0_8_CMP( ch, 0xd0 ); + REG_SET_5x01_0_8_CML( ch, 0xa2 ); + // REG_SET_5x1D_0_8_AFE( ch, 0x00 ); + REG_SET_5x92_0_8_PWM( ch, 0x00 ); + } + else + { + printk("Jaguar1 Analog Input Setting Fail !!!\n"); + } + + printk("[DRV]video_input_eq_analog_input_set::ch(%d) input(%d)\n", ch, input ); +} + diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.h b/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.h new file mode 100644 index 000000000000..331b7cf5a529 --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_video_eq.h @@ -0,0 +1,170 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : video_eq.h + * Description : + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_VIDEO_EQ_H_ +#define _JAGUAR1_VIDEO_EQ_H_ + +#include "jaguar1_common.h" + +typedef struct _video_equalizer_hsync_stage_s{ + unsigned int hsync_stage[6]; +}video_equalizer_hsync_stage_s; + +typedef struct _video_equalizer_agc_stage_s{ + unsigned int agc_stage[6]; +}video_equalizer_agc_stage_s; + +typedef struct _video_equalizer_distance_table_s{ + video_equalizer_hsync_stage_s hsync_stage; + video_equalizer_agc_stage_s agc_stage; +} video_equalizer_distance_table_s; + + +typedef struct _video_equalizer_base_s{ + unsigned char eq_bypass[11]; // B5x01 + unsigned char eq_band_sel[11]; // B5x58 + unsigned char eq_gain_sel[11]; // B5x5C + + unsigned char deq_a_on[11]; // BAx3d + unsigned char deq_a_sel[11]; // BAx3C + +} video_equalizer_base_s; + +typedef struct _video_equalizer_coeff_s{ + + unsigned char deqA_01[11]; // BankA 0x30 + unsigned char deqA_02[11]; // BankA 0x31 + unsigned char deqA_03[11]; // BankA 0x32 + unsigned char deqA_04[11]; // BankA 0x33 + unsigned char deqA_05[11]; // BankA 0x34 + unsigned char deqA_06[11]; // BankA 0x35 + unsigned char deqA_07[11]; // BankA 0x36 + unsigned char deqA_08[11]; // BankA 0x37 + unsigned char deqA_09[11]; // BankA 0x38 + unsigned char deqA_10[11]; // BankA 0x39 + unsigned char deqA_11[11]; // BankA 0x3A + unsigned char deqA_12[11]; // BankA 0x3B + +} video_equalizer_coeff_s; + +typedef struct _video_equalizer_color_s{ + unsigned char contrast[11]; // Bank0 0x10 + unsigned char y_peaking_mode[11]; // Bank0 0x18 + unsigned char y_fir_mode [11]; + unsigned char c_filter[11]; // Bank0 0x21 + unsigned char pal_cm_off[11]; // Bank0 0x21 + unsigned char hue[11]; // Bank0 0x40 + unsigned char u_gain[11]; // Bank0 0x44 + unsigned char v_gain[11]; // Bank0 0x48 + unsigned char u_offset[11]; // Bank0 0x4c + unsigned char v_offset[11]; // Bank0 0x50 + + unsigned char black_level[11]; // Bank5 0x20 + unsigned char acc_ref[11]; // Bank5 0x27 + + unsigned char cti_delay[11]; // Bank5 0x28 + unsigned char saturation_b[11]; // Bank5 0x2B + unsigned char burst_dec_a[11]; // Bank5 0x24 + unsigned char burst_dec_b[11]; // Bank5 0x5F + unsigned char burst_dec_c[11]; // Bank5 0xD1 + unsigned char c_option[11]; // Bank5 0xD5 + + unsigned char y_filter_b[11]; // BankA 0x25 + unsigned char y_filter_b_sel[11]; // BankA 0x27 + +} video_equalizer_color_s; + +typedef struct _video_equalizer_timing_a_s{ + unsigned char h_delay_a[11]; // Bank0 0x58 + unsigned char h_delay_b[11]; // Bank0 0x89 + unsigned char h_delay_c[11]; // Bank0 0x8E + unsigned char y_delay[11]; // Bank0 0xA0 + +} video_equalizer_timing_a_s; + +typedef struct _video_equalizer_clk_s{ + unsigned char clk_adc_pre[11]; // Bank1 0x84 + unsigned char clk_adc_post[11]; // Bank1 0x8C + unsigned char clk_adc[11]; // Bank1 0x8C + +} video_equalizer_clk_s; + +typedef struct _video_equalizer_timing_b_s{ + unsigned char h_scaler1[11]; // B9x96 + ch*0x20 + unsigned char h_scaler2[11]; // B9x97 + ch*0x20 + unsigned char h_scaler3[11]; // B9x98 + ch*0x20 + unsigned char h_scaler4[11]; // B9x99 + ch*0x20 + unsigned char h_scaler5[11]; // B9x9a + ch*0x20 + unsigned char h_scaler6[11]; // B9x9b + ch*0x20 + unsigned char h_scaler7[11]; // B9x9c + ch*0x20 + unsigned char h_scaler8[11]; // B9x9d + ch*0x20 + unsigned char h_scaler9[11]; // B9x9e + ch*0x20 + + unsigned char pn_auto[11]; // B9x40 + ch + + unsigned char comb_mode[11]; // B5x90 + unsigned char h_pll_op_a[11]; // B5xB9 + unsigned char mem_path[11]; // B5x57 + unsigned char fsc_lock_speed[11]; //B5x25 + + unsigned char ahd_mode[11]; + unsigned char sd_mode[11]; + unsigned char spl_mode[11]; + unsigned char vblk_end[11]; + unsigned char afe_g_sel[11]; + unsigned char afe_ctr_clp[11]; + unsigned char d_agc_option[11]; +} video_equalizer_timing_b_s; + + +typedef struct _video_equalizer_value_table_s{ + video_equalizer_base_s eq_base; + video_equalizer_coeff_s eq_coeff; + video_equalizer_color_s eq_color; + + video_equalizer_timing_a_s eq_timing_a; + video_equalizer_clk_s eq_clk; + video_equalizer_timing_b_s eq_timing_b; + +} video_equalizer_value_table_s; + +typedef struct _jaguar1_video_eq_value_table_s{ + char *name; + NC_VIVO_CH_FORMATDEF video_fmt; + NC_ANALOG_INPUT analog_input; + video_equalizer_base_s eq_base; + video_equalizer_coeff_s eq_coeff; + video_equalizer_color_s eq_color; + + video_equalizer_timing_a_s eq_timing_a; + video_equalizer_clk_s eq_clk; + video_equalizer_timing_b_s eq_timing_b; + +} _jaguar1_video_eq_value_table_s; + +typedef struct _video_equalizer_info{ + unsigned char Ch; + unsigned char devnum; + unsigned char stage; + unsigned char FmtDef; + unsigned char Cable; + unsigned char Input; +} video_equalizer_info_s; + +void video_input_eq_val_set(video_equalizer_info_s *pvin_eq_set); +void video_input_eq_cable_set(video_equalizer_info_s *pvin_eq_set); +void video_input_eq_analog_input_set(video_equalizer_info_s *pvin_eq_set); + +#endif /* _JAGUAR1_VIDEO_EQ_H_ */ diff --git a/drivers/media/i2c/jaguar1_drv/jaguar1_video_table.h b/drivers/media/i2c/jaguar1_drv/jaguar1_video_table.h new file mode 100644 index 000000000000..78b6e7ffe51b --- /dev/null +++ b/drivers/media/i2c/jaguar1_drv/jaguar1_video_table.h @@ -0,0 +1,3913 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/******************************************************************************** + * + * Copyright (C) 2017 NEXTCHIP Inc. All rights reserved. + * Module : Jaguar1 Device Driver + * Description : coax_table.h + * Author : + * Date : + * Version : Version 1.0 + * + ******************************************************************************** + * History : + * + * + ********************************************************************************/ +#ifndef _JAGUAR1_VIDEO_TABLE_ +#define _JAGUAR1_VIDEO_TABLE_ + +#include "jaguar1_video.h" + +#define EOD (-1) + +/*============================================================= + * Video Initialize Structure + ==============================================================*/ +typedef struct NC_VD_VI_Init_STR{ + char *name; + + // decoder_afe_fmtdef + unsigned char powerdown; + unsigned char gain; + unsigned char spd; + unsigned char ctrlreg; + unsigned char ctrlibs; + unsigned char adcspd; + unsigned char clplevel; + unsigned char eq_band; + unsigned char lpf_front_band; + unsigned char clpmode; + unsigned char f_lpf_bypass; + unsigned char clproff; + unsigned char b_lpf_bypass; + unsigned char duty; + unsigned char ref_vol; + unsigned char lpf_back_band; + unsigned char clk_sel; + unsigned char eq_gainsel; + + // decoder_color_fmtdef + unsigned char brightnees; //B0 0x0c/0x0d/0x0e/0x0f + unsigned char contrast; //B0 0x10/0x11/0x12/0x13 + unsigned char hue; //B0 0x40/0x41/0x42/0x43 + unsigned char u_gain; //B0 0x44/0x45/0x46/0x47 + unsigned char v_gain; //B0 0x48/0x49/0x4a/0x4b + unsigned char u_offset; //B0 0x4c/0x4d/0x4e/0x4f + unsigned char v_offset; //B0 0x50/0x51/0x52/0x53 + unsigned char saturation_a; //B0 0x3c/0x3d/0x3e/0x3f + unsigned char saturation_b; //B5/6/7/8 0x2b + unsigned char black_level; //B5/6/7/8 0x20 + unsigned char burst_dec_a; //B5/6/7/8 0x24 + unsigned char burst_dec_b; //B5/6/7/8 0x5f + unsigned char burst_dec_c; //B5/6/7/8 0xd1 + unsigned char new_wpd_sel; //B5/6/7/8 0x75 [0] + + // decoder_basic_vfmt_fmtdef + unsigned char video_format; //B0 0x08/0x09/0x0a/0x0b + unsigned char sd_mode; //B0 0x81/0x82/0x83/0x84 + unsigned char ahd_mode; + unsigned char spl_mode; //B0 0x85/0x86/0x87/0x88 + unsigned char sd_freq_sel; //B5/6/7/8 0x69[0] + + // decoder_basic_chroma_fmtdef + unsigned char pal_cm_off; //B0 0x21/0x25/0x29/0x2d + unsigned char s_point; //B5/6/7/8 0x28 + unsigned char fsc_lock_mode; //B5/6/7/8 0x25 + unsigned char comb_mode; //B5/6/7/8 0x90 + + // decoder_basic_timing_fmtdef + unsigned char sync_rs; //B5/6/7/8 0x47 + unsigned char h_delay_lsb; //B0 0x58/0x59/0x5a/0x5b + unsigned char h_mask_on; //B0 0x89/0x8a/0x8b/0x8c + unsigned char h_mask_sel; //B0 0x8e/0x8f/0x90/0x91 + unsigned char mem_rdp; //B5/6/7/8 0x64 + unsigned char v_blk_end_b; //B5/6/7/8 0xA9 + unsigned char y_delay; //B0 0xA0/0xA1/0xA2/0xA3 + unsigned char fld_inv; //B0 0x54[4]/[5]/[6]/[7] + unsigned char v_blk_end_a; //B0 0x64/0x65/0x66/0x67 + + // decoder_basic_hscaler_fmtdef + unsigned char h_down_scaler; //B9 0x96/0xb6/0xd6/0xf6 + unsigned char h_scaler_mode; //B9 0x97/0xb7/0xd7/0xf7 + unsigned char ref_base_lsb; //B9 0x98/0xb8/0xd8/0xf8 + unsigned char ref_base_msb; //B9 0x99/0xb9/0xd9/0xf9 + unsigned char line_mem_mode; //B0 0x34/0x35/0x36/0x37 + + // decoder_basic_hpll_fmtdef + unsigned char hpll_mask_on; //B5/6/7/8 0x50 + unsigned char hafc_byp_th_e; //B5/6/7/8 0xbb + unsigned char hafc_byp_th_s; //B5/6/7/8 0xb7 + unsigned char hafc_op_md; //B5/6/7/8 0xb8 + + // clock + unsigned char clk_adc; + unsigned char clk_pre; + unsigned char clk_post; + + // Reserved + unsigned char h_dly_msb;; + unsigned char vblk_end_sel; + unsigned char vblk_end_ext; + unsigned char h_scaler_active; + unsigned char cml_mode; + unsigned char agc_op; + unsigned char g_sel; + unsigned char sync_sel; + unsigned char reserved9; + unsigned char reserved10; + +}NC_VD_VI_Init_STR; + + +typedef struct NC_VD_VO_Init_STR{ + char *name; + unsigned char vport_oclk_sel; // 1xcc[6:4] + unsigned char mux_yc_merge; // 1xec[0] + unsigned char port_seq_ch01[4]; // 1xc0[7:0] + unsigned char port_seq_ch23[4]; // 1xc1[7:0] + unsigned char chid_vin; // 0x14[4:0] + unsigned char vport_out_sel; // 1xc8[5:0] 0x30 [low bit 0 1mux, 2 2mux, 8 4mux] + + unsigned char manual_ahd; // 13x31[5:0] + unsigned char manual_cvi; // 13x32[5:0] + unsigned char manual_tvi; // 13x33[5:0] + +}NC_VD_VO_Init_STR; + + +/*====================================================== + * This is a variable structure added in Jaguar1. + *======================================================= */ +typedef struct NC_VD_Jaguar1_Init_STR{ + char *name; + + unsigned char vadc_clk_sel; + unsigned char vafe_clp_level; + unsigned char vafe_f_lpf_sel; + unsigned char clp_mode_sel; + unsigned char vafe_duty; // 0x66 > 5x5b + + unsigned char novid_det_b; + unsigned char h_dly_msb; + unsigned char vblk_end; + + unsigned char vport_oclk_sel; + unsigned char new_c_peak_mode; + unsigned char auto_gnos_mode; + unsigned char y_temp_sel; + unsigned char no_mem_path; + + unsigned char a_cmp_pw_mode; + unsigned char eoh_rst_dly; + + unsigned char hafc_lpf_sel; + + unsigned char tm_clk_sel; // 1xa0 + +}NC_VD_Jaguar1_Init_STR; + + +/*============================================================= + * Video Initialize Table + ==============================================================*/ + +NC_VD_VI_Init_STR vd_vi_init_list[]= +{ + /* ===================================================== + * SD + * =====================================================*/ + [ AHD20_SD_H960_NT ] = { + + }, + + [ AHD20_SD_H960_PAL ] = { + + }, + + [ AHD20_SD_SH720_NT ] = { + .name = "AHD20_SD_SH720_NT", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x00, + + .video_format = 0xa0, + .sd_mode = 0x04, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0xd0, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0x04, + .h_delay_lsb = 0x80, + .h_mask_on = 0x1, + .h_mask_sel = 0xd, + .mem_rdp = 0x01, + .v_blk_end_b = 0x1c, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x00, + + .hpll_mask_on = 0x80, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x06, + .clk_pre = 0x07, + .clk_post = 0x01, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_SD_SH720_PAL ] = { + .name = "AHD20_SD_SH720_PAL", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x00, + .v_gain = 0x00, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x30, + + .video_format = 0xdd, + .sd_mode = 0x05, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x02, + .s_point = 0xd0, + .fsc_lock_mode = 0xcc, + .comb_mode = 0x0d, + + .sync_rs = 0x04, + .h_delay_lsb = 0xa0, + .h_mask_on = 0x1, + .h_mask_sel = 0xd, + .mem_rdp = 0x01, + .v_blk_end_b = 0x0a, + .y_delay = 0x10, + .fld_inv = 0x1, + .v_blk_end_a = 0x00, + + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0x80, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0xB9, + + .clk_adc = 0x06, + .clk_pre = 0x07, + .clk_post = 0x01, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_SD_H1280_NT ] = { + + }, + + [ AHD20_SD_H1280_PAL ] = { + + }, + + [ AHD20_SD_H1440_NT ] = { + .name = "AHD20_SD_H1440_NT", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x00, + .video_format = 0xa0, + .sd_mode = 0x04, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + .pal_cm_off = 0x82, + .s_point = 0xd0, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + .sync_rs = 0x04, + .h_delay_lsb = 0x80, + .h_mask_on = 0x1, + .h_mask_sel = 0xd, + .mem_rdp = 0x01, + .v_blk_end_b = 0x1c, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x00, + .hpll_mask_on = 0x80, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + .clk_adc = 0x06, + .clk_pre = 0x07, + .clk_post = 0x01, + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_SD_H1440_PAL ] = { + .name = "AHD20_SD_H1440_PAL", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x00, + .v_gain = 0x00, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x30, + .video_format = 0xdd, + .sd_mode = 0x05, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + .pal_cm_off = 0x02, + .s_point = 0xd0, + .fsc_lock_mode = 0xcc, + .comb_mode = 0x0d, + .sync_rs = 0x04, + .h_delay_lsb = 0xa0, + .h_mask_on = 0x1, + .h_mask_sel = 0xd, + .mem_rdp = 0x01, + .v_blk_end_b = 0x0a, + .y_delay = 0x10, + .fld_inv = 0x1, + .v_blk_end_a = 0x00, + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + .hpll_mask_on = 0x80, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0xB9, + .clk_adc = 0x06, + .clk_pre = 0x07, + .clk_post = 0x01, + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_SD_H960_EX_NT ] = { + + }, + + [ AHD20_SD_H960_EX_PAL ] = { + + }, + + [ AHD20_SD_H960_2EX_NT ] = { + + }, + + [ AHD20_SD_H960_2EX_PAL ] = { + + }, + + [ AHD20_SD_H960_2EX_Btype_NT ] = { + .name = "AHD20_SD_H960_2EX_Btype_NT", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x00, + + .video_format = 0xa0, + .sd_mode = 0x0e, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x8b, + .s_point = 0xd0, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0x04, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x01, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x1, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x01, + + .hpll_mask_on = 0x84, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0xB9, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_SD_H960_2EX_Btype_PAL ] = { + .name = "AHD20_SD_H960_2EX_Btype_PAL", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0x00, + .brightnees = 0x00, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x00, + .v_gain = 0x00, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x00, + .burst_dec_c = 0x00, + + .video_format = 0xdd, + .sd_mode = 0x0F, + .ahd_mode = 0x00, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x0b, + .s_point = 0xd0, + .fsc_lock_mode = 0xcc, + .comb_mode = 0x0d, + + .sync_rs = 0xee, + .h_delay_lsb = 0x60, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x1, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x00, + + .h_down_scaler = 0x10, + .h_scaler_mode = 0x10, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x1, + + .hpll_mask_on = 0xc6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0xB9, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x20, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + /* ===================================================== + * AHD + * =====================================================*/ + [ AHD20_1080P_30P ] = { + .name = "AHD20_1080P_30P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x02, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x04, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_1080P_25P ] = { + .name = "AHD20_1080P_25P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x03, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x03, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_60P ] = { + .name = "AHD20_720P_60P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x04, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x04, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x10, + .vblk_end_ext = 0x1B, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_50P ] = { + .name = "AHD20_720P_50P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x05, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x03, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_30P ] = { + .name = "AHD20_720P_30P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x06, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_25P ] = { + .name = "AHD20_720P_25P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0d, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_30P_EX ] = { + .name = "AHD20_720P_30P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0A, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x00, + .h_mask_sel = 0x00, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x00, + .clk_post = 0x04, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_25P_EX ] = { + .name = "AHD20_720P_25P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0B, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x00, + .clk_post = 0x04, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_30P_EX_Btype ] = { + .name = "AHD20_720P_30P_EX_Btype", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0c, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x01, + .h_mask_sel = 0x5, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x10, + .vblk_end_ext = 0x1C, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_25P_EX_Btype ] = { + .name = "AHD20_720P_25P_EX_Btype", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0, + .u_gain = 0, + .v_gain = 0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0d, + .spl_mode = 0x00, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x01, + .h_mask_sel = 0x5, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_960P_30P ] = { + .name = "AHD20_720P_960P_30P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0x0, + .brightnees = 0x0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0x0, + .u_gain = 0x0, + .v_gain = 0x0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x0, + .burst_dec_c = 0x00, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x02, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x04, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ AHD20_720P_960P_25P ] = { + .name = "AHD20_720P_960P_25P", + .powerdown = 0x0, + .gain = 0x1, + .spd = 0xD, + .ctrlreg = 0x1, + .ctrlibs = 0x2, + .adcspd = 0x0, + .clplevel = 0x2, + .eq_band = 0x0, + .lpf_front_band = 0x7, + .clpmode = 0x0, + .f_lpf_bypass = 0x1, + .clproff = 0x0, + .b_lpf_bypass = 0x0, + .duty = 0x4, + .ref_vol = 0x1, + .lpf_back_band = 0x7, + .clk_sel = 0x1, + .eq_gainsel = 0x0, + + .new_wpd_sel = 0x0, + .brightnees = 0x0, + .contrast = 0x86, + .black_level = 0x80, + .hue = 0x0, + .u_gain = 0x0, + .v_gain = 0x0, + .u_offset = 0xF8, + .v_offset = 0xF8, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x0, + .burst_dec_c = 0x0, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x03, + .spl_mode = 0x0, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x1, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x48, + .h_mask_on = 0x01, + .h_mask_sel = 0x03, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + + /* ===================================================== + * TVI + * =====================================================*/ + [ TVI_FHD_30P ] = { + .name = "TVI_FHD_30P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0xD, + .ctrlreg = 0x01, + .ctrlibs = 2, + .adcspd = 0, + .clplevel = 2, + .eq_band = 0, + .lpf_front_band = 7, + .clpmode = 0, + .f_lpf_bypass = 1, + .clproff = 0, + .b_lpf_bypass = 0, + .duty = 4, + .ref_vol = 1, + .lpf_back_band = 7, + .clk_sel = 1, + .eq_gainsel = 0, + + .new_wpd_sel = 0, + .brightnees = 0x00, + .contrast = 0x8c, + .black_level = 0x84, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x02, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x68, + .h_mask_on = 0x01, + .h_mask_sel = 0x2, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_FHD_25P ] = { + .name = "TVI_FHD_25P", + .powerdown = 0, + .gain = 1, + .spd = 0xD, + .ctrlreg = 1, + .ctrlibs = 2, + .adcspd = 0, + .clplevel = 2, + .eq_band = 0, + .lpf_front_band = 7, + .clpmode = 0, + .f_lpf_bypass = 1, + .clproff = 0, + .b_lpf_bypass = 0, + .duty = 4, + .ref_vol = 1, + .lpf_back_band = 7, + .clk_sel = 1, + .eq_gainsel = 0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x75, + .black_level = 0x84, + .hue = 0x3, + .u_gain = 0xC, + .v_gain = 0x1A, + .u_offset = 0xFA, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x03, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x60, + .h_mask_on = 0x01, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_60P ] = { + .name = "TVI_HD_60P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x75, + .black_level = 0x84, + .hue = 0x00, + .u_gain = 0xC, + .v_gain = 0x1A, + .u_offset = 0xFA, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x04, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x98, + .h_mask_on = 0x66, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x00, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_50P ] = { + .name = "TVI_HD_50P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x75, + .black_level = 0x84, + .hue = 0x00, + .u_gain = 0xC, + .v_gain = 0x1A, + .u_offset = 0xFA, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x05, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x66, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x00, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_30P ] = { + .name = "TVI_HD_30P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0A, + .spl_mode = 0x01, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x70, + .h_mask_on = 0x01, + .h_mask_sel = 0x2, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x00, + .h_scaler_mode = 0x59, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_25P ] = { + .name = "TVI_HD_25P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x84, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0B, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x70, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x59, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_30P_EX ] = { + .name = "TVI_HD_30P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0A, + .spl_mode = 0x01, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x70, + .h_mask_on = 0x01, + .h_mask_sel = 0x2, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x00, + .h_scaler_mode = 0x59, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_25P_EX ] = { + .name = "TVI_HD_25P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x84, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x0B, + .spl_mode = 0x1, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x70, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x59, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_B_30P ] = { + .name = "TVI_HD_B_30P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x06, + .spl_mode = 0x3, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x10, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_B_25P ] = { + .name = "TVI_HD_B_25P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x07, + .spl_mode = 0x3, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_B_30P_EX ] = { + .name = "TVI_HD_B_30P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0A, + .spl_mode = 0x3, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x70, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ TVI_HD_B_25P_EX ] = { + .name = "TVI_HD_B_25P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xF4, + .saturation_a = 0x80, + .saturation_b = 0xA8, + .burst_dec_a = 0x2A, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0B, + .spl_mode = 0x03, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x60, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x0, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + /* ===================================================== + * CVI + * =====================================================*/ + [ CVI_FHD_30P ] = { + .name = "CVI_FHD_30P", + .powerdown = 0, + .gain = 1, + .spd = 0xD, + .ctrlreg = 1, + .ctrlibs = 2, + .adcspd = 0, + .clplevel = 2, + .eq_band = 0, + .lpf_front_band = 7, + .clpmode = 0, + .f_lpf_bypass = 1, + .clproff = 0, + .b_lpf_bypass = 0, + .duty = 4, + .ref_vol = 1, + .lpf_back_band = 7, + .clk_sel = 1, + .eq_gainsel = 0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x98, + .black_level = 0x86, + .hue = 0x3, + .u_gain = 0xC, + .v_gain = 0x1A, + .u_offset = 0xFA, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x02, + .spl_mode = 0x02, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x00, + .h_mask_on = 0x01, + .h_mask_sel = 0x4, + .mem_rdp = 0x21, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x39, + .ref_base_lsb = 0x78, + .ref_base_msb = 0x1, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_FHD_25P ] = { + .name = "CVI_FHD_25P", + .powerdown = 0, + .gain = 1, + .spd = 0xD, + .ctrlreg = 1, + .ctrlibs = 2, + .adcspd = 0, + .clplevel = 2, + .eq_band = 0, + .lpf_front_band = 7, + .clpmode = 0, + .f_lpf_bypass = 1, + .clproff = 0, + .b_lpf_bypass = 0, + .duty = 4, + .ref_vol = 1, + .lpf_back_band = 7, + .clk_sel = 1, + .eq_gainsel = 0, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x98, + .black_level = 0x86, + .hue = 0x00, + .u_gain = 0xC, + .v_gain = 0x1A, + .u_offset = 0xFA, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x03, + .spl_mode = 0x02, + .sd_freq_sel = 0x00, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x01, + .h_mask_sel = 0x2, + .mem_rdp = 0x22, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x49, + .ref_base_lsb = 0x4f, + .ref_base_msb = 0x2, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x00, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_60P ] = { + .name = "CVI_HD_60P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x86, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x04, + .spl_mode = 0x02, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0xa8, + .h_mask_on = 0x00, + .h_mask_sel = 0x00, + .mem_rdp = 0x09, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x00, + .h_scaler_mode = 0x19, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_50P ] = { + .name = "CVI_HD_50P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x86, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x05, + .spl_mode = 0x02, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x60, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x00, + .h_scaler_mode = 0x29, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x08, + .clk_pre = 0x02, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_30P ] = { + .name = "CVI_HD_30P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x06, + .spl_mode = 0x2, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x1, + .h_scaler_mode = 0x19, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x1, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x04, + .clk_pre = 0x04, + .clk_post = 0x04, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_25P ] = { + .name = "CVI_HD_25P", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .video_format = 0x0, + .sd_mode = 0x00, + .ahd_mode = 0x07, + .spl_mode = 0x2, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x80, + .h_mask_on = 0x0, + .h_mask_sel = 0x0, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x1, + .h_scaler_mode = 0x29, + .ref_base_lsb = 0xc0, + .ref_base_msb = 0x1, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x04, + .clk_pre = 0x04, + .clk_post = 0x04, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_30P_EX ] = { + .name = "CVI_HD_30P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0A, + .spl_mode = 0x02, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x82, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0xa0, + .h_mask_on = 0x01, + .h_mask_sel = 0x5, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x19, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x1, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, + + [ CVI_HD_25P_EX ] = { + .name = "CVI_HD_25P_EX", + .powerdown = 0x00, + .gain = 0x01, + .spd = 0x0D, + .ctrlreg = 0x01, + .ctrlibs = 0x02, + .adcspd = 0x00, + .clplevel = 0x02, + .eq_band = 0x00, + .lpf_front_band = 0x07, + .clpmode = 0x00, + .f_lpf_bypass = 0x01, + .clproff = 0x00, + .b_lpf_bypass = 0x00, + .duty = 0x04, + .ref_vol = 0x03, + .lpf_back_band = 0x07, + .clk_sel = 0x01, + .eq_gainsel = 0x00, + + .new_wpd_sel = 0, + .brightnees = 0, + .contrast = 0x8c, + .black_level = 0x80, + .hue = 0x00, + .u_gain = 0x10, + .v_gain = 0x10, + .u_offset = 0xF6, + .v_offset = 0xFA, + .saturation_a = 0x80, + .saturation_b = 0xa8, + .burst_dec_a = 0x2a, + .burst_dec_b = 0x30, + .burst_dec_c = 0x30, + + .video_format = 0x20, + .sd_mode = 0x00, + .ahd_mode = 0x0B, + .spl_mode = 0x02, + .sd_freq_sel = 0x0, + + .pal_cm_off = 0x83, + .s_point = 0x90, + .fsc_lock_mode = 0xDC, + .comb_mode = 0x5, + + .sync_rs = 0xEE, + .h_delay_lsb = 0x60, + .h_mask_on = 0x01, + .h_mask_sel = 0x1, + .mem_rdp = 0x0, + .v_blk_end_b = 0x0, + .y_delay = 0x10, + .fld_inv = 0x0, + .v_blk_end_a = 0x80, + + .h_down_scaler = 0x0, + .h_scaler_mode = 0x29, + .ref_base_lsb = 0x0, + .ref_base_msb = 0x0, + .line_mem_mode = 0x0, + + .hpll_mask_on = 0xC6, + .hafc_byp_th_e = 0xF, + .hafc_byp_th_s = 0xFC, + .hafc_op_md = 0x39, + + .clk_adc = 0x44, + .clk_pre = 0x01, + .clk_post = 0x02, + + .h_dly_msb = 0x00, + .vblk_end_sel = 0x00, + .vblk_end_ext = 0x00, + .h_scaler_active = 0x80, + .cml_mode = 0x2c, + .agc_op = 0x24, + .g_sel = 0x0c, + .sync_sel = 0x20, + }, +}; + + +NC_VD_VO_Init_STR vd_vo_init_list[]= +{ + [ AHD20_1080P_30P ] = { + .name = "AHD20_1080P_30P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ AHD20_1080P_25P ] = { + .name = "AHD20_1080P_25P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ AHD20_720P_30P_EX_Btype ] = { + .name = "AHD20_720P_30P_EX_Btype", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ AHD20_720P_25P_EX_Btype ] = { + .name = "AHD20_720P_25P_EX_Btype", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_FHD_30P ] = { + .name = "CVI_FHD_30P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_FHD_25P ] = { + .name = "CVI_FHD_25P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_HD_60P ] = { + .name = "CVI_HD_60P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_HD_50P ] = { + .name = "CVI_HD_50P", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_HD_30P_EX ] = { + .name = "CVI_HD_30P_EX", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, + + [ CVI_HD_25P_EX ] = { + .name = "CVI_HD_30P_EX", + + .vport_oclk_sel = 0x40, + .mux_yc_merge = 0x00, + .port_seq_ch01 = {0x00, 0x11, 0x22, 0x33}, + .port_seq_ch23 = {0x00, 0x11, 0x22, 0x33}, + .chid_vin = 0x00, + .vport_out_sel = 0x30, + + .manual_ahd = 0x00, + .manual_cvi = 0x00, + .manual_tvi = 0x00, + }, +}; + + +NC_VD_Jaguar1_Init_STR vd_jaguar1_init_list[]= +{ + [ AHD20_SD_H960_2EX_Btype_NT ] = { + .name = "AHD20_SD_H960_2EX_Btype_NT", + .vadc_clk_sel = 0x80, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x21, + + .vport_oclk_sel = 0x60, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc6, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_SD_H960_2EX_Btype_PAL ] = { + .name = "AHD20_SD_H960_2EX_Btype_PAL", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x60, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc6, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + + [ AHD20_1080P_30P ] = { + .name = "AHD20_1080P_30P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_1080P_25P ] = { + .name = "AHD20_1080P_25P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_720P_30P ] = { + .name = "AHD20_720P_30P_EX_Btype", + .vadc_clk_sel = 0x80, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x20, + + .vport_oclk_sel = 0x60, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_720P_25P ] = { + .name = "AHD20_720P_25P_EX_Btype", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_720P_30P_EX_Btype ] = { + .name = "AHD20_720P_30P_EX_Btype", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ AHD20_720P_25P_EX_Btype ] = { + .name = "AHD20_720P_25P_EX_Btype", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ TVI_FHD_30P ] = { + .name = "TVI_FHD_30P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ TVI_FHD_25P ] = { + .name = "TVI_FHD_25P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ TVI_HD_60P ] = { + .name = "TVI_HD_60P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ TVI_HD_50P ] = { + .name = "TVI_HD_50P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ TVI_HD_30P_EX ] = { + .name = "TVI_HD_30P_EX", + .vadc_clk_sel = 0x80, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x20, + + .vport_oclk_sel = 0x60, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + + }, + + [ TVI_HD_25P_EX ] = { + .name = "TVI_HD_25P_EX", + .vadc_clk_sel = 0x80, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x40, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x01, + + .a_cmp_pw_mode = 0xc0, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_FHD_30P ] = { + .name = "CVI_FHD_30P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_FHD_25P ] = { + .name = "CVI_FHD_25P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_HD_60P ] = { + .name = "CVI_HD_60P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, // 0x66 > 5x5b + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_HD_50P ] = { + .name = "CVI_HD_50P", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_HD_30P_EX ] = { + .name = "CVI_HD_30P_EX", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, + + [ CVI_HD_25P_EX ] = { + .name = "CVI_HD_30P_EX", + .vadc_clk_sel = 0x00, + .vafe_clp_level = 0x03, + .vafe_f_lpf_sel = 0x03, + .clp_mode_sel = 0x00, + .vafe_duty = 0x01, + + .novid_det_b = 0x13, + .h_dly_msb = 0x00, + .vblk_end = 0x22, + + .vport_oclk_sel = 0x70, + .new_c_peak_mode = 0x00, + .auto_gnos_mode = 0x00, + .y_temp_sel = 0xc6, + .no_mem_path = 0x00, + + .a_cmp_pw_mode = 0x00, + .eoh_rst_dly = 0x10, + + .hafc_lpf_sel = 0x72, + .tm_clk_sel = 0x10, + }, +}; + +/******************************************************************** + * End of file + ********************************************************************/ + +#endif